Slightly simplify open_mode_check

Volker Lendecke Volker.Lendecke at SerNet.DE
Sat Oct 12 09:56:18 MDT 2013


Hi!

Attached find two patches removing unused parameters from
open_mode_check.

Please review&push!

Thanks,

Volker

-- 
SerNet GmbH, Bahnhofsallee 1b, 37081 Göttingen
phone: +49-551-370000-0, fax: +49-551-370000-9
AG Göttingen, HRB 2816, GF: Dr. Johannes Loxen
http://www.sernet.de, mailto:kontakt at sernet.de
-------------- next part --------------
From eca797353e916ac503d965132e665af71e8a78ee Mon Sep 17 00:00:00 2001
From: Volker Lendecke <vl at samba.org>
Date: Thu, 26 Sep 2013 14:35:15 -0700
Subject: [PATCH 1/2] smbd: Remove name_hash param from open_mode_check

This came from delete_on_close handling which was factored out.

Signed-off-by: Volker Lendecke <vl at samba.org>
---
 source3/smbd/open.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/source3/smbd/open.c b/source3/smbd/open.c
index 6255180..5c05087 100644
--- a/source3/smbd/open.c
+++ b/source3/smbd/open.c
@@ -1121,7 +1121,6 @@ static bool has_delete_on_close(struct share_mode_lock *lck,
 
 static NTSTATUS open_mode_check(connection_struct *conn,
 				struct share_mode_lock *lck,
-				uint32_t name_hash,
 				uint32 access_mask,
 				uint32 share_access,
 				uint32 create_options,
@@ -2435,7 +2434,7 @@ static NTSTATUS open_file_ntcreate(connection_struct *conn,
 		return NT_STATUS_SHARING_VIOLATION;
 	}
 
-	status = open_mode_check(conn, lck, fsp->name_hash,
+	status = open_mode_check(conn, lck,
 				 access_mask, share_access,
 				 create_options, &file_existed);
 
@@ -3173,7 +3172,7 @@ static NTSTATUS open_directory(connection_struct *conn,
 		return NT_STATUS_DELETE_PENDING;
 	}
 
-	status = open_mode_check(conn, lck, fsp->name_hash,
+	status = open_mode_check(conn, lck,
 				access_mask, share_access,
 				 create_options, &dir_existed);
 
-- 
1.8.1.2


From bade4e000cbd622816628e29d96a3357d63ed729 Mon Sep 17 00:00:00 2001
From: Volker Lendecke <vl at samba.org>
Date: Thu, 26 Sep 2013 14:42:59 -0700
Subject: [PATCH 2/2] smbd: Remove unused create_options from open_mode_check

Signed-off-by: Volker Lendecke <vl at samba.org>
---
 source3/smbd/open.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/source3/smbd/open.c b/source3/smbd/open.c
index 5c05087..f6df035 100644
--- a/source3/smbd/open.c
+++ b/source3/smbd/open.c
@@ -1123,7 +1123,6 @@ static NTSTATUS open_mode_check(connection_struct *conn,
 				struct share_mode_lock *lck,
 				uint32 access_mask,
 				uint32 share_access,
-				uint32 create_options,
 				bool *file_existed)
 {
 	int i;
@@ -2436,7 +2435,7 @@ static NTSTATUS open_file_ntcreate(connection_struct *conn,
 
 	status = open_mode_check(conn, lck,
 				 access_mask, share_access,
-				 create_options, &file_existed);
+				 &file_existed);
 
 	if (NT_STATUS_IS_OK(status)) {
 		/* We might be going to allow this open. Check oplock
@@ -3174,7 +3173,7 @@ static NTSTATUS open_directory(connection_struct *conn,
 
 	status = open_mode_check(conn, lck,
 				access_mask, share_access,
-				 create_options, &dir_existed);
+				 &dir_existed);
 
 	if (!NT_STATUS_IS_OK(status)) {
 		TALLOC_FREE(lck);
-- 
1.8.1.2



More information about the samba-technical mailing list