summaryrefslogtreecommitdiff
path: root/source3/smbd/close.c
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2012-01-09 14:30:53 +0100
committerJeremy Allison <jra@samba.org>2012-01-12 23:59:22 +0100
commit9cf6d735d43f6f905b19f52d38c93aa30092333d (patch)
treefd75eba7dc698d61b3f8d5ef240c31fef068f28a /source3/smbd/close.c
parent540e51f77e07cc65b6b097f8ff01cd10f04644d0 (diff)
downloadsamba-9cf6d735d43f6f905b19f52d38c93aa30092333d.tar.gz
samba-9cf6d735d43f6f905b19f52d38c93aa30092333d.tar.bz2
samba-9cf6d735d43f6f905b19f52d38c93aa30092333d.zip
s3: Introduce get_share_mode_lock_fresh()
This slightly simplifies the code path for all callers which assume that a share mode exists already. Only the callers in open_file_ntcreate and open_directory will ever create new share modes. Signed-off-by: Jeremy Allison <jra@samba.org>
Diffstat (limited to 'source3/smbd/close.c')
-rw-r--r--source3/smbd/close.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/source3/smbd/close.c b/source3/smbd/close.c
index 26656f47a2..a07ab4b42c 100644
--- a/source3/smbd/close.c
+++ b/source3/smbd/close.c
@@ -347,9 +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, NULL, NULL,
- NULL);
-
+ lck = get_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)));
@@ -617,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, NULL, NULL, NULL);
+ lck = get_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. */
@@ -1019,9 +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, NULL, NULL,
- NULL);
-
+ lck = get_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)));