summaryrefslogtreecommitdiff
path: root/source3/locking
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2022-08-30 05:55:57 +0000
committerJeremy Allison <jra@samba.org>2022-09-20 00:34:35 +0000
commitbb7d765663813875a5391df203038edc9747bf0d (patch)
treeaa75d48c06501f0b862e232fc477e6d308d8b35f /source3/locking
parent432272a7c834b3ebf56d335a1f458fdc392f7e51 (diff)
downloadsamba-bb7d765663813875a5391df203038edc9747bf0d.tar.gz
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 <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
Diffstat (limited to 'source3/locking')
-rw-r--r--source3/locking/locking.c20
1 files changed, 2 insertions, 18 deletions
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;