svn commit: linux-cifs-client r54 - in branches: linux-2.6-cifs-git-devel/fs/cifs linux-2.6.9-RHEL4/fs/cifs

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


Author: jra
Date: 2006-07-14 01:18:51 +0000 (Fri, 14 Jul 2006)
New Revision: 54

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

Log:
Add in POSIX lock infinite timeout change across all branches
that apply.
Jeremy.

Modified:
   branches/linux-2.6-cifs-git-devel/fs/cifs/cifssmb.c
   branches/linux-2.6.9-RHEL4/fs/cifs/cifssmb.c


Changeset:
Modified: branches/linux-2.6-cifs-git-devel/fs/cifs/cifssmb.c
===================================================================
--- branches/linux-2.6-cifs-git-devel/fs/cifs/cifssmb.c	2006-07-14 01:07:07 UTC (rev 53)
+++ branches/linux-2.6-cifs-git-devel/fs/cifs/cifssmb.c	2006-07-14 01:18:51 UTC (rev 54)
@@ -1485,6 +1485,7 @@
 	struct cifs_posix_lock *parm_data;
 	int rc = 0;
 	int bytes_returned = 0;
+	int timeout = 0;
 	__u16 params, param_offset, offset, byte_count, count;
 
 	cFYI(1, ("Posix Lock"));
@@ -1529,8 +1530,11 @@
 			(((char *) &pSMB->hdr.Protocol) + offset);
 
 	parm_data->lock_type = cpu_to_le16(lock_type);
-	if(waitFlag)
+	if(waitFlag) {
+		timeout = 3;  /* blocking operation, no timeout */
+		pSMB->Timeout = cpu_to_le32(-1);/* blocking - do not time out */
 		parm_data->lock_flags = cpu_to_le16(1);
+	}
 	parm_data->pid = cpu_to_le32(current->tgid);
 	parm_data->start = cpu_to_le64(pLockData->fl_start);
 	parm_data->length = cpu_to_le64(len);  /* normalize negative numbers */
@@ -1542,7 +1546,7 @@
 	pSMB->hdr.smb_buf_length += byte_count;
 	pSMB->ByteCount = cpu_to_le16(byte_count);
 	rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
-			(struct smb_hdr *) pSMBr, &bytes_returned, 0);
+			(struct smb_hdr *) pSMBr, &bytes_returned, timeout);
 	if (rc) {
 		cFYI(1, ("Send error in Posix Lock = %d", rc));
 	} else if (get_flag) {

Modified: branches/linux-2.6.9-RHEL4/fs/cifs/cifssmb.c
===================================================================
--- branches/linux-2.6.9-RHEL4/fs/cifs/cifssmb.c	2006-07-14 01:07:07 UTC (rev 53)
+++ branches/linux-2.6.9-RHEL4/fs/cifs/cifssmb.c	2006-07-14 01:18:51 UTC (rev 54)
@@ -1373,6 +1373,7 @@
 	struct cifs_posix_lock *parm_data;
 	int rc = 0;
 	int bytes_returned = 0;
+	int timeout = 0;
 	__u16 params, param_offset, offset, byte_count, count;
 
 	cFYI(1, ("Posix Lock"));
@@ -1413,8 +1414,12 @@
 			(((char *) &pSMB->hdr.Protocol) + offset);
 
 	parm_data->lock_type = cpu_to_le16(lock_type);
-	if(waitFlag)
+	if(waitFlag) {
+		timeout = 3;  /* blocking operation, no timeout */
+		pSMB->Timeout = cpu_to_le32(-1);/* blocking - do not time out */
 		parm_data->lock_flags = 1;
+	}
+
 	parm_data->pid = cpu_to_le32(current->tgid);
 	parm_data->start = lkoffset;
 	parm_data->length = len;  /* normalize negative numbers */
@@ -1426,7 +1431,7 @@
 	pSMB->hdr.smb_buf_length += byte_count;
 	pSMB->ByteCount = cpu_to_le16(byte_count);
 	rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
-			(struct smb_hdr *) pSMBr, &bytes_returned, 0);
+			(struct smb_hdr *) pSMBr, &bytes_returned, timeout);
 	if (rc) {
 		cFYI(1, ("Send error in Posix Lock = %d", rc));
 	}



More information about the samba-cvs mailing list