From 9cf6d735d43f6f905b19f52d38c93aa30092333d Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Mon, 9 Jan 2012 14:30:53 +0100 Subject: 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 --- source3/smbd/oplock.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'source3/smbd/oplock.c') diff --git a/source3/smbd/oplock.c b/source3/smbd/oplock.c index 7a810d9a20..e1731f1e10 100644 --- a/source3/smbd/oplock.c +++ b/source3/smbd/oplock.c @@ -162,8 +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, NULL, NULL, - NULL); + lck = get_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))); @@ -189,8 +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, NULL, NULL, - NULL); + lck = get_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))); @@ -760,8 +758,7 @@ static void contend_level2_oplocks_begin_default(files_struct *fsp, if (!LEVEL_II_OPLOCK_TYPE(fsp->oplock_type)) return; - 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,("release_level_2_oplocks_on_change: failed to lock " "share mode entry for file %s.\n", fsp_str_dbg(fsp))); -- cgit