Changeset 204 for branches/samba-3.2.x/source/smbd/dosmode.c
- Timestamp:
- May 20, 2009, 6:46:53 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/samba-3.2.x/source/smbd/dosmode.c
r149 r204 632 632 } 633 633 634 /****************************************************************** *635 Change a filetime - possibly allowing DOS semantics.636 *******************************************************************/ 637 638 bool set_write_time_path(connection_struct *conn, const char *fname, 639 struct file_id fileid, const struct timespec mtime,640 bool overwrite)634 /****************************************************************** 635 Force a "sticky" write time on a pathname. This will always be 636 returned on all future write time queries and set on close. 637 ******************************************************************/ 638 639 bool set_sticky_write_time_path(connection_struct *conn, const char *fname, 640 struct file_id fileid, const struct timespec mtime) 641 641 { 642 642 if (null_timespec(mtime)) { … … 644 644 } 645 645 646 if (!set_ write_time(fileid, mtime, overwrite)) {646 if (!set_sticky_write_time(fileid, mtime)) { 647 647 return false; 648 648 } 649 649 650 /* in the overwrite case the caller should trigger the notify */651 if (!overwrite) {652 notify_fname(conn, NOTIFY_ACTION_MODIFIED,653 FILE_NOTIFY_CHANGE_LAST_WRITE, fname);654 }655 656 650 return true; 657 651 } 658 652 659 bool set_write_time_fsp(struct files_struct *fsp, const struct timespec mtime, 660 bool overwrite) 661 { 662 if (overwrite) { 663 fsp->write_time_forced = true; 664 TALLOC_FREE(fsp->update_write_time_event); 665 } 666 667 return set_write_time_path(fsp->conn, fsp->fsp_name, fsp->file_id, 668 mtime, overwrite); 669 } 653 /****************************************************************** 654 Force a "sticky" write time on an fsp. This will always be 655 returned on all future write time queries and set on close. 656 ******************************************************************/ 657 658 bool set_sticky_write_time_fsp(struct files_struct *fsp, const struct timespec mtime) 659 { 660 fsp->write_time_forced = true; 661 TALLOC_FREE(fsp->update_write_time_event); 662 663 return set_sticky_write_time_path(fsp->conn, fsp->fsp_name, 664 fsp->file_id, mtime); 665 } 666 667 /****************************************************************** 668 Update a write time immediately, without the 2 second delay. 669 ******************************************************************/ 670 671 bool update_write_time(struct files_struct *fsp) 672 { 673 if (!set_write_time(fsp->file_id, timespec_current())) { 674 return false; 675 } 676 677 notify_fname(fsp->conn, NOTIFY_ACTION_MODIFIED, 678 FILE_NOTIFY_CHANGE_LAST_WRITE, fsp->fsp_name); 679 680 return true; 681 }
Note:
See TracChangeset
for help on using the changeset viewer.