summaryrefslogtreecommitdiff
path: root/source3/smbd/open.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/open.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/open.c')
-rw-r--r--source3/smbd/open.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/source3/smbd/open.c b/source3/smbd/open.c
index dbc4dba448..46d5d28863 100644
--- a/source3/smbd/open.c
+++ b/source3/smbd/open.c
@@ -1584,8 +1584,7 @@ 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,
- NULL, NULL, NULL);
+ struct share_mode_lock *lck = get_share_mode_lock(talloc_tos(), id);
if (lck == NULL) {
DEBUG(0, ("could not get share mode lock\n"));
return;
@@ -1629,11 +1628,8 @@ static bool acquire_ordered_locks(TALLOC_CTX *mem_ctx,
lock on the brlock database. */
}
- *p_lck = get_share_mode_lock(mem_ctx,
- id,
- connectpath,
- smb_fname,
- p_old_write_time);
+ *p_lck = get_share_mode_lock_fresh(
+ mem_ctx, id, connectpath, smb_fname, p_old_write_time);
if (*p_lck == NULL) {
DEBUG(0, ("Could not get share mode lock\n"));
@@ -2928,8 +2924,9 @@ static NTSTATUS open_directory(connection_struct *conn,
return NT_STATUS_ACCESS_DENIED;
}
- lck = get_share_mode_lock(talloc_tos(), fsp->file_id,
- conn->connectpath, smb_dname, &mtimespec);
+ lck = get_share_mode_lock_fresh(talloc_tos(), fsp->file_id,
+ conn->connectpath, smb_dname,
+ &mtimespec);
if (lck == NULL) {
DEBUG(0, ("open_directory: Could not get share mode lock for "