]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3:locking: make use of new share_mode_set_{changed,old}_write_time() helpers
authorStefan Metzmacher <metze@samba.org>
Tue, 30 Aug 2022 05:55:57 +0000 (05:55 +0000)
committerJeremy Allison <jra@samba.org>
Tue, 20 Sep 2022 00:34:35 +0000 (00:34 +0000)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15125

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/locking/locking.c

index cf96d9bb13a16cd936e3baccba5e7bdd2a40384f..6a2dcbd1f98afff48dc3067c3bb878c75ab00dfd 100644 (file)
@@ -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;