From: Stefan Metzmacher Date: Tue, 30 Aug 2022 05:55:57 +0000 (+0000) Subject: s3:locking: make use of new share_mode_set_{changed,old}_write_time() helpers X-Git-Tag: talloc-2.4.0~873 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bb7d765663813875a5391df203038edc9747bf0d;p=thirdparty%2Fsamba.git s3:locking: make use of new share_mode_set_{changed,old}_write_time() helpers BUG: https://bugzilla.samba.org/show_bug.cgi?id=15125 Signed-off-by: Stefan Metzmacher Reviewed-by: Jeremy Allison --- diff --git a/source3/locking/locking.c b/source3/locking/locking.c index cf96d9bb13a..6a2dcbd1f98 100644 --- a/source3/locking/locking.c +++ b/source3/locking/locking.c @@ -1058,13 +1058,8 @@ bool set_sticky_write_time(struct file_id fileid, struct timespec write_time) struct share_mode_data *d = NULL; struct file_id_buf ftmp; struct timeval_buf tbuf; - NTTIME nt = full_timespec_to_nt_time(&write_time); NTSTATUS status; - DBG_INFO("%s id=%s\n", - timespec_string_buf(&write_time, true, &tbuf), - file_id_str_buf(fileid, &ftmp)); - lck = get_existing_share_mode_lock(talloc_tos(), fileid); if (lck == NULL) { return False; @@ -1081,10 +1076,7 @@ bool set_sticky_write_time(struct file_id fileid, struct timespec write_time) return false; } - if (d->changed_write_time != nt) { - d->modified = True; - d->changed_write_time = nt; - } + share_mode_set_changed_write_time(lck, write_time); TALLOC_FREE(lck); return True; @@ -1096,13 +1088,8 @@ bool set_write_time(struct file_id fileid, struct timespec write_time) struct share_mode_data *d = NULL; struct file_id_buf idbuf; struct timeval_buf tbuf; - NTTIME nt = full_timespec_to_nt_time(&write_time); NTSTATUS status; - DBG_INFO("%s id=%s\n", - timespec_string_buf(&write_time, true, &tbuf), - file_id_str_buf(fileid, &idbuf)); - lck = get_existing_share_mode_lock(talloc_tos(), fileid); if (lck == NULL) { return False; @@ -1119,10 +1106,7 @@ bool set_write_time(struct file_id fileid, struct timespec write_time) return false; } - if (d->old_write_time != nt) { - d->modified = True; - d->old_write_time = nt; - } + share_mode_set_old_write_time(lck, write_time); TALLOC_FREE(lck); return True;