svn commit: linux-cifs-client r39 - in branches/SOC/linux-2.6bk-dnotify/fs/cifs: .

asser at samba.org asser at samba.org
Fri Aug 26 16:35:21 GMT 2005


Author: asser
Date: 2005-08-26 16:35:18 +0000 (Fri, 26 Aug 2005)
New Revision: 39

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

Log:
Changed struct dir_notify_req to use struct file instead of struct dentry.

Fixed handling of responses with status NT_STATUS_CANCELLED

Modified:
   branches/SOC/linux-2.6bk-dnotify/fs/cifs/cifsfs.c
   branches/SOC/linux-2.6bk-dnotify/fs/cifs/cifsglob.h
   branches/SOC/linux-2.6bk-dnotify/fs/cifs/cifsproto.h
   branches/SOC/linux-2.6bk-dnotify/fs/cifs/cifssmb.c
   branches/SOC/linux-2.6bk-dnotify/fs/cifs/fcntl.c
   branches/SOC/linux-2.6bk-dnotify/fs/cifs/misc.c


Changeset:
Modified: branches/SOC/linux-2.6bk-dnotify/fs/cifs/cifsfs.c
===================================================================
--- branches/SOC/linux-2.6bk-dnotify/fs/cifs/cifsfs.c	2005-08-23 13:13:27 UTC (rev 38)
+++ branches/SOC/linux-2.6bk-dnotify/fs/cifs/cifsfs.c	2005-08-26 16:35:18 UTC (rev 39)
@@ -870,8 +870,8 @@
 				list_del(&dnotify_req->lhead);
 				spin_unlock(&GlobalMid_Lock);
 
-				inode = dnotify_req->dentry->d_inode;
-				cFYI(1,("Notifying file %s mask %lx", build_path_from_dentry(dnotify_req->dentry), inode->i_dnotify_mask));
+				inode = dnotify_req->file->f_dentry->d_inode;
+				cFYI(1,("Notifying file %s mask %lx", build_path_from_dentry(dnotify_req->file->f_dentry), inode->i_dnotify_mask));
 
 				/* use the inode's own mask since we don't know exactly what happened */
 				inode_dir_notify(inode, inode->i_dnotify_mask);
@@ -884,7 +884,7 @@
 					/* multishot, re-request notification */
 					cFYI(1,("Re-requesting notification (multishot)"));
 					rc = CIFSSMBNotify(xid, tcon, 0, dnotify_req->netfid,
-						dnotify_req->filter, cifs_sb->local_nls, dnotify_req->dentry, 1);
+						dnotify_req->filter, cifs_sb->local_nls, dnotify_req->file, 1 /* multishot */);
 					if(rc) {
 						cERROR(1,("CIFSSMBNotify failed in cifs_dnotify_thread rc = %d", rc));
 					}

Modified: branches/SOC/linux-2.6bk-dnotify/fs/cifs/cifsglob.h
===================================================================
--- branches/SOC/linux-2.6bk-dnotify/fs/cifs/cifsglob.h	2005-08-23 13:13:27 UTC (rev 38)
+++ branches/SOC/linux-2.6bk-dnotify/fs/cifs/cifsglob.h	2005-08-26 16:35:18 UTC (rev 39)
@@ -342,7 +342,7 @@
 	__u16 netfid;
 	__u32 filter; /* CompletionFilter (for multishot) */
 	int multishot; 
-	struct dentry * dentry;
+	struct file *file;
 };
 
 #define   MID_FREE 0

Modified: branches/SOC/linux-2.6bk-dnotify/fs/cifs/cifsproto.h
===================================================================
--- branches/SOC/linux-2.6bk-dnotify/fs/cifs/cifsproto.h	2005-08-23 13:13:27 UTC (rev 38)
+++ branches/SOC/linux-2.6bk-dnotify/fs/cifs/cifsproto.h	2005-08-26 16:35:18 UTC (rev 39)
@@ -266,7 +266,7 @@
 extern int CIFSSMBNotify(const int xid, struct cifsTconInfo *tcon, 
 			const int notify_subdirs,const __u16 netfid,
 			__u32 filter, const struct nls_table *nls_codepage,
-			struct dentry *dentry, int multishot);
+			struct file *file, int multishot);
 extern int CIFSSMBCancel(const int xid, struct cifsTconInfo *tcon,
 			__u16 Uid, __le16 Pid, __le16 PidHigh,
 			__u16 Tid, __u16 Mid);

Modified: branches/SOC/linux-2.6bk-dnotify/fs/cifs/cifssmb.c
===================================================================
--- branches/SOC/linux-2.6bk-dnotify/fs/cifs/cifssmb.c	2005-08-23 13:13:27 UTC (rev 38)
+++ branches/SOC/linux-2.6bk-dnotify/fs/cifs/cifssmb.c	2005-08-26 16:35:18 UTC (rev 39)
@@ -3866,7 +3866,7 @@
 int CIFSSMBNotify(const int xid, struct cifsTconInfo *tcon, 
 			const int notify_subdirs, const __u16 netfid,
 			__u32 filter, const struct nls_table *nls_codepage,
-			struct dentry *dentry, int multishot)
+			struct file *file, int multishot)
 {
 	int rc = 0;
 	struct smb_com_transaction_change_notify_req * pSMB = NULL;
@@ -3914,11 +3914,13 @@
 		dnotify_req->Tid = pSMB->hdr.Tid;
 		dnotify_req->Uid = pSMB->hdr.Uid;
 		dnotify_req->netfid = netfid;
-		dnotify_req->dentry = dentry;
+		dnotify_req->file = file;
 		dnotify_req->filter = filter;
 		dnotify_req->multishot = multishot;
+		cFYI(1,("Locking GlobalMid_Lock"));
 		spin_lock(&GlobalMid_Lock);
 		list_add_tail(&dnotify_req->lhead, &GlobalDnotifyReqList);
+		cFYI(1,("Unlocking GlobalMid_Lock"));
 		spin_unlock(&GlobalMid_Lock);
 	}
 	cifs_buf_release(pSMB);

Modified: branches/SOC/linux-2.6bk-dnotify/fs/cifs/fcntl.c
===================================================================
--- branches/SOC/linux-2.6bk-dnotify/fs/cifs/fcntl.c	2005-08-23 13:13:27 UTC (rev 38)
+++ branches/SOC/linux-2.6bk-dnotify/fs/cifs/fcntl.c	2005-08-26 16:35:18 UTC (rev 39)
@@ -96,7 +96,7 @@
 			list_for_each_safe(tmp, tmp1, &GlobalDnotifyReqList) {
 				dnotify_req = list_entry(tmp, struct dir_notify_req, lhead);
 
-				if(dnotify_req->dentry == file->f_dentry) {
+				if(dnotify_req->file == file) {
 					rc = CIFSSMBCancel(xid, pTcon, dnotify_req->Uid, dnotify_req->Pid,
 							dnotify_req->PidHigh, dnotify_req->Tid, dnotify_req->Mid);
 
@@ -104,7 +104,6 @@
 					if(rc) {
 						cFYI(1,("Error in CIFSSMBCancel = %d", rc));
 					}
-					list_del(tmp);
 				}
 			}
 			spin_unlock(&GlobalMid_Lock);
@@ -120,7 +119,7 @@
 				filter = convert_to_cifs_notify_flags(arg);
 				if(filter != 0) {
 					rc = CIFSSMBNotify(xid, pTcon, 0 /* no subdirs */, netfid, 
-						filter, cifs_sb->local_nls, file->f_dentry, arg & DN_MULTISHOT);
+						filter, cifs_sb->local_nls, file, arg & DN_MULTISHOT);
 
 				} else {
 					/* ASF TODO: Close the file handle */

Modified: branches/SOC/linux-2.6bk-dnotify/fs/cifs/misc.c
===================================================================
--- branches/SOC/linux-2.6bk-dnotify/fs/cifs/misc.c	2005-08-23 13:13:27 UTC (rev 38)
+++ branches/SOC/linux-2.6bk-dnotify/fs/cifs/misc.c	2005-08-26 16:35:18 UTC (rev 39)
@@ -403,13 +403,13 @@
 			(struct smb_com_transaction_change_notify_rsp *)buf;
 		struct file_notify_information * pnotify;
 		__u32 data_offset = 0;
-		cFYI(1,("pSMBr ByteCount:%ld TotalParameterCount:%ld ParameterCount:%ld DataCount:%ld", pSMBr->ByteCount, pSMBr->TotalParameterCount, pSMBr->ParameterCount, pSMBr->DataCount));
-		cFYI(1,("pSMBr ParameterOffset:%ld DataOffset:%ld", pSMBr->ParameterOffset, pSMBr->DataOffset));
+		cFYI(1,("pSMBr ByteCount:%ld TotalParameterCount:%ld ParameterCount:%ld DataCount:%ld", (unsigned long)pSMBr->ByteCount, (unsigned long)pSMBr->TotalParameterCount, (unsigned long)pSMBr->ParameterCount, (unsigned long)pSMBr->DataCount));
+		cFYI(1,("pSMBr ParameterOffset:%ld DataOffset:%ld", (unsigned long)pSMBr->ParameterOffset, (unsigned long)pSMBr->DataOffset));
 		pnotify = (struct file_notify_information *) (&pSMBr->hdr.Protocol) + pSMBr->DataOffset;
-		cFYI(1,("pnotify NextEntryOffset:%lx Action:%lx FileNameLength:%ld",pnotify->NextEntryOffset,pnotify->Action,pnotify->FileNameLength));
-		cFYI(1,("notify err 0x%x",pSMBr->hdr.Status.CifsError));
+		cFYI(1,("pnotify NextEntryOffset:%lx Action:%lx FileNameLength:%ld",(unsigned long)pnotify->NextEntryOffset,(unsigned long)pnotify->Action,(unsigned long)pnotify->FileNameLength));
+		cFYI(1,("notify err 0x%x (cancelled == 0x%x)",pSMBr->hdr.Status.CifsError,(NT_STATUS_CANCELLED)));
 		if((pSMBr->ByteCount > sizeof(struct file_notify_information)) ||
-		   (pSMBr->hdr.Status.CifsError == STATUS_NOTIFY_ENUM_DIR)) {
+		   (pSMBr->hdr.Status.CifsError)) {
 		    /* Find the request on the req list */
 			spin_lock(&GlobalMid_Lock);
 			list_for_each_safe(tmp, tmp1, &GlobalDnotifyReqList) {
@@ -420,8 +420,9 @@
 				   dnotify_req->Pid == pSMBr->hdr.Pid)
 				{
 					list_del(tmp);
-					if(pSMBr->hdr.Status.CifsError == NT_STATUS_CANCELLED) {
-						cFYI(1,("Request was cancelled"));
+					if ((NT_STATUS_CANCELLED) == 
+					   le32_to_cpu(pSMBr->hdr.Status.CifsError)) {
+						cFYI(1,("Request was cancelled (err %lx nt_status_cancelled %lx)", pSMBr->hdr.Status.CifsError,NT_STATUS_CANCELLED));
 						kfree(dnotify_req);
 					} else {
 						list_add_tail(&dnotify_req->lhead, &GlobalDnotifyRsp_Q);
@@ -431,7 +432,7 @@
 			spin_unlock(&GlobalMid_Lock);
 			wake_up_process(dnotifyThread);
 			return TRUE;
-		} /* ASF TODO: NT_STATUS_CANCELLED && file_notify_information */
+		} /* ASF TODO: file_notify_information */
 	}  
 	return FALSE;
 }



More information about the samba-cvs mailing list