diff options
-rw-r--r-- | source3/locking/locking.c | 10 | ||||
-rw-r--r-- | source3/locking/proto.h | 4 | ||||
-rw-r--r-- | source3/smbd/close.c | 6 | ||||
-rw-r--r-- | source3/smbd/open.c | 3 | ||||
-rw-r--r-- | source3/smbd/oplock.c | 6 | ||||
-rw-r--r-- | source3/smbd/reply.c | 2 | ||||
-rw-r--r-- | source3/smbd/trans2.c | 2 |
7 files changed, 17 insertions, 16 deletions
diff --git a/source3/locking/locking.c b/source3/locking/locking.c index 7063b54d9c..385db18b95 100644 --- a/source3/locking/locking.c +++ b/source3/locking/locking.c @@ -453,8 +453,8 @@ char *share_mode_str(TALLOC_CTX *ctx, int num, const struct share_mode_entry *e) counts it internally to allow for nested lock fetches. ********************************************************************/ -struct share_mode_lock *get_share_mode_lock(TALLOC_CTX *mem_ctx, - const struct file_id id) +struct share_mode_lock *get_existing_share_mode_lock(TALLOC_CTX *mem_ctx, + const struct file_id id) { return get_share_mode_lock_fresh(mem_ctx, id, NULL, NULL, NULL); } @@ -953,7 +953,7 @@ bool set_delete_on_close(files_struct *fsp, bool delete_on_close, const struct s delete_on_close ? "Adding" : "Removing", fsp->fnum, fsp_str_dbg(fsp))); - lck = get_share_mode_lock(talloc_tos(), fsp->file_id); + lck = get_existing_share_mode_lock(talloc_tos(), fsp->file_id); if (lck == NULL) { return False; } @@ -1006,7 +1006,7 @@ bool set_sticky_write_time(struct file_id fileid, struct timespec write_time) convert_timespec_to_time_t(write_time)), file_id_string_tos(&fileid))); - lck = get_share_mode_lock(talloc_tos(), fileid); + lck = get_existing_share_mode_lock(talloc_tos(), fileid); if (lck == NULL) { return False; } @@ -1029,7 +1029,7 @@ bool set_write_time(struct file_id fileid, struct timespec write_time) convert_timespec_to_time_t(write_time)), file_id_string_tos(&fileid))); - lck = get_share_mode_lock(talloc_tos(), fileid); + lck = get_existing_share_mode_lock(talloc_tos(), fileid); if (lck == NULL) { return False; } diff --git a/source3/locking/proto.h b/source3/locking/proto.h index 25f3d196b8..1aa1d5035a 100644 --- a/source3/locking/proto.h +++ b/source3/locking/proto.h @@ -146,8 +146,8 @@ bool locking_init(void); bool locking_init_readonly(void); bool locking_end(void); char *share_mode_str(TALLOC_CTX *ctx, int num, const struct share_mode_entry *e); -struct share_mode_lock *get_share_mode_lock(TALLOC_CTX *mem_ctx, - const struct file_id id); +struct share_mode_lock *get_existing_share_mode_lock(TALLOC_CTX *mem_ctx, + const struct file_id id); struct share_mode_lock *get_share_mode_lock_fresh( TALLOC_CTX *mem_ctx, const struct file_id id, diff --git a/source3/smbd/close.c b/source3/smbd/close.c index 42e88d82ea..1a123b49c8 100644 --- a/source3/smbd/close.c +++ b/source3/smbd/close.c @@ -347,7 +347,7 @@ static NTSTATUS close_remove_share_mode(files_struct *fsp, * This prevents race conditions with the file being created. JRA. */ - lck = get_share_mode_lock(talloc_tos(), fsp->file_id); + lck = get_existing_share_mode_lock(talloc_tos(), fsp->file_id); if (lck == NULL) { DEBUG(0, ("close_remove_share_mode: Could not get share mode " "lock for file %s\n", fsp_str_dbg(fsp))); @@ -615,7 +615,7 @@ static NTSTATUS update_write_time_on_close(struct files_struct *fsp) * must update it in the open file db too. */ (void)set_write_time(fsp->file_id, fsp->close_write_time); - lck = get_share_mode_lock(talloc_tos(), fsp->file_id); + lck = get_existing_share_mode_lock(talloc_tos(), fsp->file_id); if (lck) { /* Close write times overwrite sticky write times so we must replace any sticky write time here. */ @@ -1017,7 +1017,7 @@ static NTSTATUS close_directory(struct smb_request *req, files_struct *fsp, * reference to a directory also. */ - lck = get_share_mode_lock(talloc_tos(), fsp->file_id); + lck = get_existing_share_mode_lock(talloc_tos(), fsp->file_id); if (lck == NULL) { DEBUG(0, ("close_directory: Could not get share mode lock for " "%s\n", fsp_str_dbg(fsp))); diff --git a/source3/smbd/open.c b/source3/smbd/open.c index daa9bb9188..ed3ef90f16 100644 --- a/source3/smbd/open.c +++ b/source3/smbd/open.c @@ -1594,7 +1594,8 @@ NTSTATUS smbd_calculate_access_mask(connection_struct *conn, void remove_deferred_open_entry(struct file_id id, uint64_t mid, struct server_id pid) { - struct share_mode_lock *lck = get_share_mode_lock(talloc_tos(), id); + struct share_mode_lock *lck = get_existing_share_mode_lock( + talloc_tos(), id); if (lck == NULL) { DEBUG(0, ("could not get share mode lock\n")); return; diff --git a/source3/smbd/oplock.c b/source3/smbd/oplock.c index 0c4155d9d6..f760171c3a 100644 --- a/source3/smbd/oplock.c +++ b/source3/smbd/oplock.c @@ -162,7 +162,7 @@ bool remove_oplock(files_struct *fsp) struct share_mode_lock *lck; /* Remove the oplock flag from the sharemode. */ - lck = get_share_mode_lock(talloc_tos(), fsp->file_id); + lck = get_existing_share_mode_lock(talloc_tos(), fsp->file_id); if (lck == NULL) { DEBUG(0,("remove_oplock: failed to lock share entry for " "file %s\n", fsp_str_dbg(fsp))); @@ -188,7 +188,7 @@ bool downgrade_oplock(files_struct *fsp) bool ret; struct share_mode_lock *lck; - lck = get_share_mode_lock(talloc_tos(), fsp->file_id); + lck = get_existing_share_mode_lock(talloc_tos(), fsp->file_id); if (lck == NULL) { DEBUG(0,("downgrade_oplock: failed to lock share entry for " "file %s\n", fsp_str_dbg(fsp))); @@ -804,7 +804,7 @@ static void do_break_to_none(struct tevent_req *req) DEBUG(1, ("tevent_wakeup_recv failed\n")); goto done; } - lck = get_share_mode_lock(talloc_tos(), state->id); + lck = get_existing_share_mode_lock(talloc_tos(), state->id); if (lck == NULL) { DEBUG(1, ("release_level_2_oplocks_on_change: failed to lock " "share mode entry for file %s.\n", diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c index b026d34c67..eebd77d3ef 100644 --- a/source3/smbd/reply.c +++ b/source3/smbd/reply.c @@ -6205,7 +6205,7 @@ NTSTATUS rename_internals_fsp(connection_struct *conn, status = NT_STATUS_ACCESS_DENIED; } - lck = get_share_mode_lock(talloc_tos(), fsp->file_id); + lck = get_existing_share_mode_lock(talloc_tos(), fsp->file_id); /* * We have the file open ourselves, so not being able to get the diff --git a/source3/smbd/trans2.c b/source3/smbd/trans2.c index 336e76e481..d2eff4d8f5 100644 --- a/source3/smbd/trans2.c +++ b/source3/smbd/trans2.c @@ -7565,7 +7565,7 @@ static NTSTATUS smb_posix_unlink(connection_struct *conn, * non-POSIX opens return SHARING_VIOLATION. */ - lck = get_share_mode_lock(talloc_tos(), fsp->file_id); + lck = get_existing_share_mode_lock(talloc_tos(), fsp->file_id); if (lck == NULL) { DEBUG(0, ("smb_posix_unlink: Could not get share mode " "lock for file %s\n", fsp_str_dbg(fsp))); |