svn commit: linux-cifs-client r55 - in branches: linux-2.6-cifs-git-devel/fs/cifs linux-2.6.9-RHEL4/fs/cifs linux-converged-for-old-kernels/fs/cifs

jra at samba.org jra at samba.org
Fri Jul 14 01:41:18 GMT 2006


Author: jra
Date: 2006-07-14 01:41:17 +0000 (Fri, 14 Jul 2006)
New Revision: 55

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=linux-cifs-client&rev=55

Log:
Make POSIX locks non-experimental. Add in code that *stores*
the capabilities we've selected, rather than just using the
value returned from the server.
Jeremy.

Modified:
   branches/linux-2.6-cifs-git-devel/fs/cifs/connect.c
   branches/linux-2.6-cifs-git-devel/fs/cifs/file.c
   branches/linux-2.6.9-RHEL4/fs/cifs/connect.c
   branches/linux-2.6.9-RHEL4/fs/cifs/file.c
   branches/linux-converged-for-old-kernels/fs/cifs/connect.c
   branches/linux-converged-for-old-kernels/fs/cifs/file.c


Changeset:
Modified: branches/linux-2.6-cifs-git-devel/fs/cifs/connect.c
===================================================================
--- branches/linux-2.6-cifs-git-devel/fs/cifs/connect.c	2006-07-14 01:18:51 UTC (rev 54)
+++ branches/linux-2.6-cifs-git-devel/fs/cifs/connect.c	2006-07-14 01:41:17 UTC (rev 55)
@@ -1967,11 +1967,21 @@
 					cifs_sb->mnt_cifs_flags |= 
 						CIFS_MOUNT_POSIX_PATHS;
 				}
+
+				if (cap & CIFS_UNIX_FCNTL_CAP) {
+					cFYI(1,("negotiate posix fcntl locking"));
+				} else {
+					cFYI(1,("posix fcntl locking not supported"));
+					cap &= ~CIFS_UNIX_FCNTL_CAP;
+				}
 					
 				cFYI(1,("Negotiate caps 0x%x",(int)cap));
 
 				if (CIFSSMBSetFSUnixInfo(xid, tcon, cap)) {
 					cFYI(1,("setting capabilities failed"));
+				} else {
+					/* Remember the capabilities we set. */
+					tcon->fsUnixInfo.Capability = cpu_to_le64(cap);
 				}
 			}
 		}

Modified: branches/linux-2.6-cifs-git-devel/fs/cifs/file.c
===================================================================
--- branches/linux-2.6-cifs-git-devel/fs/cifs/file.c	2006-07-14 01:18:51 UTC (rev 54)
+++ branches/linux-2.6-cifs-git-devel/fs/cifs/file.c	2006-07-14 01:41:17 UTC (rev 55)
@@ -644,8 +644,7 @@
 	account for negative length which we can not accept over the
 	wire */
 	if (IS_GETLK(cmd)) {
-		if(experimEnabled && 
-		   (cifs_sb->tcon->ses->capabilities & CAP_UNIX) &&
+		if((cifs_sb->tcon->ses->capabilities & CAP_UNIX) &&
 		   (CIFS_UNIX_FCNTL_CAP & 
 			le64_to_cpu(cifs_sb->tcon->fsUnixInfo.Capability))) {
 			int posix_lock_type;
@@ -683,8 +682,7 @@
 		FreeXid(xid);
 		return rc;
 	}
-	if (experimEnabled &&
-		(cifs_sb->tcon->ses->capabilities & CAP_UNIX) &&
+	if ((cifs_sb->tcon->ses->capabilities & CAP_UNIX) &&
 		(CIFS_UNIX_FCNTL_CAP &
 			 le64_to_cpu(cifs_sb->tcon->fsUnixInfo.Capability))) {
 		int posix_lock_type;

Modified: branches/linux-2.6.9-RHEL4/fs/cifs/connect.c
===================================================================
--- branches/linux-2.6.9-RHEL4/fs/cifs/connect.c	2006-07-14 01:18:51 UTC (rev 54)
+++ branches/linux-2.6.9-RHEL4/fs/cifs/connect.c	2006-07-14 01:41:17 UTC (rev 55)
@@ -2023,11 +2023,21 @@
 					cifs_sb->mnt_cifs_flags |= 
 						CIFS_MOUNT_POSIX_PATHS;
 				}
+
+				if (cap & CIFS_UNIX_FCNTL_CAP) {
+					cFYI(1,("negotiate posix fcntl locking"));
+				} else {
+					cFYI(1,("posix fcntl locking not supported"));
+					cap &= ~CIFS_UNIX_FCNTL_CAP;
+				}
 					
 				cFYI(1,("Negotiate caps 0x%x",(int)cap));
 
 				if (CIFSSMBSetFSUnixInfo(xid, tcon, cap)) {
 					cFYI(1,("setting capabilities failed"));
+				} else {
+					/* Remember the capabilities we set. */
+					tcon->fsUnixInfo.Capability = cpu_to_le64(cap);
 				}
 			}
 		}

Modified: branches/linux-2.6.9-RHEL4/fs/cifs/file.c
===================================================================
--- branches/linux-2.6.9-RHEL4/fs/cifs/file.c	2006-07-14 01:18:51 UTC (rev 54)
+++ branches/linux-2.6.9-RHEL4/fs/cifs/file.c	2006-07-14 01:41:17 UTC (rev 55)
@@ -659,8 +659,7 @@
 	account for negative length which we can not accept over the
 	wire */
 	if (IS_GETLK(cmd)) {
-		if(experimEnabled && 
-		   (cifs_sb->tcon->ses->capabilities & CAP_UNIX) &&
+		if((cifs_sb->tcon->ses->capabilities & CAP_UNIX) &&
 		   (CIFS_UNIX_FCNTL_CAP & 
 			le64_to_cpu(cifs_sb->tcon->fsUnixInfo.Capability))) {
 			int posix_lock_type;
@@ -698,8 +697,7 @@
 		FreeXid(xid);
 		return rc;
 	}
-	if (experimEnabled &&
-		(cifs_sb->tcon->ses->capabilities & CAP_UNIX) &&
+	if ((cifs_sb->tcon->ses->capabilities & CAP_UNIX) &&
 		(CIFS_UNIX_FCNTL_CAP &
 			 le64_to_cpu(cifs_sb->tcon->fsUnixInfo.Capability))) {
 		int posix_lock_type;

Modified: branches/linux-converged-for-old-kernels/fs/cifs/connect.c
===================================================================
--- branches/linux-converged-for-old-kernels/fs/cifs/connect.c	2006-07-14 01:18:51 UTC (rev 54)
+++ branches/linux-converged-for-old-kernels/fs/cifs/connect.c	2006-07-14 01:41:17 UTC (rev 55)
@@ -2043,11 +2043,21 @@
 					cifs_sb->mnt_cifs_flags |= 
 						CIFS_MOUNT_POSIX_PATHS;
 				}
+
+				if (cap & CIFS_UNIX_FCNTL_CAP) {
+					cFYI(1,("negotiate posix fcntl locking"));
+				} else {
+					cFYI(1,("posix fcntl locking not supported"));
+					cap &= ~CIFS_UNIX_FCNTL_CAP;
+				}
 					
 				cFYI(1,("Negotiate caps 0x%x",(int)cap));
 
 				if (CIFSSMBSetFSUnixInfo(xid, tcon, cap)) {
 					cFYI(1,("setting capabilities failed"));
+				} else {
+					/* Remember the capabilities we set. */
+					tcon->fsUnixInfo.Capability = cpu_to_le64(cap);
 				}
 			}
 		}

Modified: branches/linux-converged-for-old-kernels/fs/cifs/file.c
===================================================================
--- branches/linux-converged-for-old-kernels/fs/cifs/file.c	2006-07-14 01:18:51 UTC (rev 54)
+++ branches/linux-converged-for-old-kernels/fs/cifs/file.c	2006-07-14 01:41:17 UTC (rev 55)
@@ -655,8 +655,7 @@
 	account for negative length which we can not accept over the
 	wire */
 	if (IS_GETLK(cmd)) {
-		if(experimEnabled && 
-		   (cifs_sb->tcon->ses->capabilities & CAP_UNIX) &&
+		if((cifs_sb->tcon->ses->capabilities & CAP_UNIX) &&
 		   (CIFS_UNIX_FCNTL_CAP & 
 			le64_to_cpu(cifs_sb->tcon->fsUnixInfo.Capability))) {
 			int posix_lock_type;
@@ -694,8 +693,7 @@
 		FreeXid(xid);
 		return rc;
 	}
-	if (experimEnabled &&
-		(cifs_sb->tcon->ses->capabilities & CAP_UNIX) &&
+	if ((cifs_sb->tcon->ses->capabilities & CAP_UNIX) &&
 		(CIFS_UNIX_FCNTL_CAP &
 			 le64_to_cpu(cifs_sb->tcon->fsUnixInfo.Capability))) {
 		int posix_lock_type;



More information about the samba-cvs mailing list