diff options
author | Volker Lendecke <vl@samba.org> | 2019-08-23 14:13:41 +0200 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2019-09-17 22:49:38 +0000 |
commit | b3473efa9d3ab7ccd364ab29a3e93e900b5a49e2 (patch) | |
tree | 41c4bce82698421e52fd9ecca34241703d52d068 /source3/locking | |
parent | 2185db6c610433e0651543b7179cf1fbd0e2c9eb (diff) | |
download | samba-b3473efa9d3ab7ccd364ab29a3e93e900b5a49e2.tar.gz |
smbd: Add reset_share_mode_entry
Mostly for durable reconnect at this point
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Diffstat (limited to 'source3/locking')
-rw-r--r-- | source3/locking/locking.c | 23 | ||||
-rw-r--r-- | source3/locking/proto.h | 7 |
2 files changed, 30 insertions, 0 deletions
diff --git a/source3/locking/locking.c b/source3/locking/locking.c index eccb680189a..cf64a962cd8 100644 --- a/source3/locking/locking.c +++ b/source3/locking/locking.c @@ -895,6 +895,29 @@ static struct share_mode_entry *find_share_mode_entry( return NULL; } +bool reset_share_mode_entry( + struct share_mode_lock *lck, + struct server_id old_pid, + uint64_t old_share_file_id, + struct server_id new_pid, + uint64_t new_mid, + uint64_t new_share_file_id) +{ + struct share_mode_entry *e = find_share_mode_entry( + lck, old_pid, old_share_file_id); + + if (e == NULL) { + return false; + } + + e->pid = new_pid; + e->op_mid = new_mid; + e->share_file_id = new_share_file_id; + + lck->data->modified = true; + return true; +} + /******************************************************************* Del the share mode of a file for this process. ********************************************************************/ diff --git a/source3/locking/proto.h b/source3/locking/proto.h index 32f6c64965c..c08517d8ce1 100644 --- a/source3/locking/proto.h +++ b/source3/locking/proto.h @@ -178,6 +178,13 @@ bool set_share_mode(struct share_mode_lock *lck, uint16_t op_type, uint32_t share_access, uint32_t access_mask); +bool reset_share_mode_entry( + struct share_mode_lock *lck, + struct server_id old_pid, + uint64_t old_share_file_id, + struct server_id new_pid, + uint64_t new_mid, + uint64_t new_share_file_id); NTSTATUS remove_lease_if_stale(const struct share_mode_data *d, const struct GUID *client_guid, const struct smb2_lease_key *lease_key); |