[SCM] Samba Shared Repository - branch v3-5-test updated - tevent-0-9-8-952-g763c95c

Volker Lendecke vlendec at samba.org
Tue Oct 6 11:30:49 MDT 2009


The branch, v3-5-test has been updated
       via  763c95c145b6313a1460a7e45685a7f966e8bd4d (commit)
      from  2a9accd85e992798ee36cb1ea74ed06f5379be3d (commit)

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-5-test


- Log -----------------------------------------------------------------
commit 763c95c145b6313a1460a7e45685a7f966e8bd4d
Author: Abhidnya P Chirmule <achirmul at in.ibm.com>
Date:   Tue Oct 6 17:14:56 2009 +0200

    s3: Add access_mask to the flock VFS call

-----------------------------------------------------------------------

Summary of changes:
 source3/include/proto.h          |    2 +-
 source3/include/vfs.h            |    6 ++++--
 source3/include/vfs_macros.h     |    8 ++++----
 source3/lib/system.c             |    2 +-
 source3/modules/onefs_open.c     |    2 +-
 source3/modules/vfs_default.c    |    4 ++--
 source3/modules/vfs_full_audit.c |    4 ++--
 source3/modules/vfs_gpfs.c       |    6 +++---
 source3/smbd/open.c              |    2 +-
 source3/smbd/vfs.c               |    6 ++++--
 10 files changed, 23 insertions(+), 19 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/include/proto.h b/source3/include/proto.h
index c8e4fe1..d31483a 100644
--- a/source3/include/proto.h
+++ b/source3/include/proto.h
@@ -937,7 +937,7 @@ SMB_OFF_T sys_ftell(FILE *fp);
 int sys_creat(const char *path, mode_t mode);
 int sys_open(const char *path, int oflag, mode_t mode);
 FILE *sys_fopen(const char *path, const char *type);
-void kernel_flock(int fd, uint32 share_mode);
+void kernel_flock(int fd, uint32 share_mode, uint32 access_mask);
 SMB_STRUCT_DIR *sys_opendir(const char *name);
 SMB_STRUCT_DIRENT *sys_readdir(SMB_STRUCT_DIR *dirp);
 void sys_seekdir(SMB_STRUCT_DIR *dirp, long offset);
diff --git a/source3/include/vfs.h b/source3/include/vfs.h
index ed49d1f..f9c1f0a 100644
--- a/source3/include/vfs.h
+++ b/source3/include/vfs.h
@@ -247,7 +247,8 @@ struct vfs_fn_pointers {
 		      struct smb_file_time *ft);
 	int (*ftruncate)(struct vfs_handle_struct *handle, struct files_struct *fsp, SMB_OFF_T offset);
 	bool (*lock)(struct vfs_handle_struct *handle, struct files_struct *fsp, int op, SMB_OFF_T offset, SMB_OFF_T count, int type);
-	int (*kernel_flock)(struct vfs_handle_struct *handle, struct files_struct *fsp, uint32 share_mode);
+	int (*kernel_flock)(struct vfs_handle_struct *handle, struct files_struct *fsp,
+			    uint32 share_mode, uint32_t access_mask);
 	int (*linux_setlease)(struct vfs_handle_struct *handle, struct files_struct *fsp, int leasetype);
 	bool (*getlock)(struct vfs_handle_struct *handle, struct files_struct *fsp, SMB_OFF_T *poffset, SMB_OFF_T *pcount, int *ptype, pid_t *ppid);
 	int (*symlink)(struct vfs_handle_struct *handle, const char *oldpath, const char *newpath);
@@ -598,7 +599,8 @@ bool smb_vfs_call_lock(struct vfs_handle_struct *handle,
 		       struct files_struct *fsp, int op, SMB_OFF_T offset,
 		       SMB_OFF_T count, int type);
 int smb_vfs_call_kernel_flock(struct vfs_handle_struct *handle,
-			      struct files_struct *fsp, uint32 share_mode);
+			      struct files_struct *fsp, uint32 share_mode,
+			      uint32_t access_mask);
 int smb_vfs_call_linux_setlease(struct vfs_handle_struct *handle,
 				struct files_struct *fsp, int leasetype);
 bool smb_vfs_call_getlock(struct vfs_handle_struct *handle,
diff --git a/source3/include/vfs_macros.h b/source3/include/vfs_macros.h
index 8ca7f37..7206bf4 100644
--- a/source3/include/vfs_macros.h
+++ b/source3/include/vfs_macros.h
@@ -250,10 +250,10 @@
 #define SMB_VFS_NEXT_LOCK(handle, fsp, op, offset, count, type) \
 	smb_vfs_call_lock((handle)->next, (fsp), (op), (offset), (count), (type))
 
-#define SMB_VFS_KERNEL_FLOCK(fsp, share_mode) \
-	smb_vfs_call_kernel_flock((fsp)->conn->vfs_handles, (fsp), (share_mode))
-#define SMB_VFS_NEXT_KERNEL_FLOCK(handle, fsp, share_mode) \
-	smb_vfs_call_kernel_flock((handle)->next, (fsp), (share_mode))
+#define SMB_VFS_KERNEL_FLOCK(fsp, share_mode, access_mask) \
+	smb_vfs_call_kernel_flock((fsp)->conn->vfs_handles, (fsp), (share_mode), (access_mask))
+#define SMB_VFS_NEXT_KERNEL_FLOCK(handle, fsp, share_mode, access_mask)	\
+	smb_vfs_call_kernel_flock((handle)->next, (fsp), (share_mode), (access_mask))
 
 #define SMB_VFS_LINUX_SETLEASE(fsp, leasetype) \
 	smb_vfs_call_linux_setlease((fsp)->conn->vfs_handles, (fsp), (leasetype))
diff --git a/source3/lib/system.c b/source3/lib/system.c
index 2c6894f..f9cd4a2 100644
--- a/source3/lib/system.c
+++ b/source3/lib/system.c
@@ -702,7 +702,7 @@ FILE *sys_fopen(const char *path, const char *type)
  A flock() wrapper that will perform the kernel flock.
 ********************************************************************/
 
-void kernel_flock(int fd, uint32 share_mode)
+void kernel_flock(int fd, uint32 share_mode, uint32 access_mask)
 {
 #if HAVE_KERNEL_SHARE_MODES
 	int kernel_mode = 0;
diff --git a/source3/modules/onefs_open.c b/source3/modules/onefs_open.c
index b9a2c30..d90f165 100644
--- a/source3/modules/onefs_open.c
+++ b/source3/modules/onefs_open.c
@@ -1253,7 +1253,7 @@ NTSTATUS onefs_open_file_ntcreate(connection_struct *conn,
 	   note that GPFS supports it as well - jmcd */
 
 	if (fsp->fh->fd != -1) {
-		ret_flock = SMB_VFS_KERNEL_FLOCK(fsp, share_access);
+		ret_flock = SMB_VFS_KERNEL_FLOCK(fsp, share_access, access_mask);
 		if(ret_flock == -1 ){
 
 			TALLOC_FREE(lck);
diff --git a/source3/modules/vfs_default.c b/source3/modules/vfs_default.c
index 680eb12..036a438 100644
--- a/source3/modules/vfs_default.c
+++ b/source3/modules/vfs_default.c
@@ -1057,10 +1057,10 @@ static bool vfswrap_lock(vfs_handle_struct *handle, files_struct *fsp, int op, S
 }
 
 static int vfswrap_kernel_flock(vfs_handle_struct *handle, files_struct *fsp,
-				uint32 share_mode)
+				uint32 share_mode, uint32 access_mask)
 {
 	START_PROFILE(syscall_kernel_flock);
-	kernel_flock(fsp->fh->fd, share_mode);
+	kernel_flock(fsp->fh->fd, share_mode, access_mask);
 	END_PROFILE(syscall_kernel_flock);
 	return 0;
 }
diff --git a/source3/modules/vfs_full_audit.c b/source3/modules/vfs_full_audit.c
index 22abee4..5305af4 100644
--- a/source3/modules/vfs_full_audit.c
+++ b/source3/modules/vfs_full_audit.c
@@ -1245,11 +1245,11 @@ static bool smb_full_audit_lock(vfs_handle_struct *handle, files_struct *fsp,
 
 static int smb_full_audit_kernel_flock(struct vfs_handle_struct *handle,
 				       struct files_struct *fsp,
-				       uint32 share_mode)
+				       uint32 share_mode, uint32 access_mask)
 {
 	int result;
 
-	result = SMB_VFS_NEXT_KERNEL_FLOCK(handle, fsp, share_mode);
+	result = SMB_VFS_NEXT_KERNEL_FLOCK(handle, fsp, share_mode, access_mask);
 
 	do_log(SMB_VFS_OP_KERNEL_FLOCK, (result >= 0), handle, "%s",
 	       fsp_str_do_log(fsp));
diff --git a/source3/modules/vfs_gpfs.c b/source3/modules/vfs_gpfs.c
index c1131a9..7c481d6 100644
--- a/source3/modules/vfs_gpfs.c
+++ b/source3/modules/vfs_gpfs.c
@@ -31,14 +31,14 @@
 #include "vfs_gpfs.h"
 
 static int vfs_gpfs_kernel_flock(vfs_handle_struct *handle, files_struct *fsp, 
-				 uint32 share_mode)
+				 uint32 share_mode, uint32 access_mask)
 {
 
 	START_PROFILE(syscall_kernel_flock);
 
-	kernel_flock(fsp->fh->fd, share_mode);
+	kernel_flock(fsp->fh->fd, share_mode, access_mask);
 
-	if (!set_gpfs_sharemode(fsp, fsp->access_mask, fsp->share_access)) {
+	if (!set_gpfs_sharemode(fsp, access_mask, fsp->share_access)) {
 
 		return -1;
 
diff --git a/source3/smbd/open.c b/source3/smbd/open.c
index 492164c..85b7d91 100644
--- a/source3/smbd/open.c
+++ b/source3/smbd/open.c
@@ -2091,7 +2091,7 @@ static NTSTATUS open_file_ntcreate(connection_struct *conn,
 	   note that GPFS supports it as well - jmcd */
 
 	if (fsp->fh->fd != -1) {
-		ret_flock = SMB_VFS_KERNEL_FLOCK(fsp, share_access);
+		ret_flock = SMB_VFS_KERNEL_FLOCK(fsp, share_access, access_mask);
 		if(ret_flock == -1 ){
 
 			TALLOC_FREE(lck);
diff --git a/source3/smbd/vfs.c b/source3/smbd/vfs.c
index 966742a..35e4f3f 100644
--- a/source3/smbd/vfs.c
+++ b/source3/smbd/vfs.c
@@ -1417,10 +1417,12 @@ int smb_vfs_call_ftruncate(struct vfs_handle_struct *handle,
 }
 
 int smb_vfs_call_kernel_flock(struct vfs_handle_struct *handle,
-			      struct files_struct *fsp, uint32 share_mode)
+			      struct files_struct *fsp, uint32 share_mode,
+			      uint32_t access_mask)
 {
 	VFS_FIND(kernel_flock);
-	return handle->fns->kernel_flock(handle, fsp, share_mode);
+	return handle->fns->kernel_flock(handle, fsp, share_mode,
+					 access_mask);
 }
 
 int smb_vfs_call_linux_setlease(struct vfs_handle_struct *handle,


-- 
Samba Shared Repository


More information about the samba-cvs mailing list