aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteve French <sfrench@us.ibm.com>2005-08-24 20:10:36 -0400
committerSteve French <sfrench@us.ibm.com>2005-08-24 20:10:36 -0400
commitff5dbd9ead0d82466cab8bdbdcbc9666707d328a (patch)
treea0ba466993aa0470fa86d942a6de3bf88fa1d5e1
parente2a98a7543696306346ba8302a8df6cedf20fdfc (diff)
[CIFS] Change notify support part 2
Signed-off-by: Asser Ferno <asser@diku.dk> Signed-off-by: Steve French <sfrench@us.ibm.com> and lightly modified
-rw-r--r--fs/cifs/cifsglob.h17
-rw-r--r--fs/cifs/cifspdu.h1
-rw-r--r--fs/cifs/cifssmb.c16
3 files changed, 34 insertions, 0 deletions
diff --git a/fs/cifs/cifsglob.h b/fs/cifs/cifsglob.h
index 9a3c85bdd77e..92fba7609e67 100644
--- a/fs/cifs/cifsglob.h
+++ b/fs/cifs/cifsglob.h
@@ -391,6 +391,20 @@ struct oplock_q_entry {
391 __u16 netfid; 391 __u16 netfid;
392}; 392};
393 393
394/* for pending dnotify requests */
395struct dir_notify_req {
396 struct list_head lhead;
397 __le16 Pid;
398 __le16 PidHigh;
399 __u16 Mid;
400 __u16 Tid;
401 __u16 Uid;
402 __u16 netfid;
403 __u32 filter; /* CompletionFilter (for multishot) */
404 int multishot;
405 struct dentry * dentry;
406};
407
394#define MID_FREE 0 408#define MID_FREE 0
395#define MID_REQUEST_ALLOCATED 1 409#define MID_REQUEST_ALLOCATED 1
396#define MID_REQUEST_SUBMITTED 2 410#define MID_REQUEST_SUBMITTED 2
@@ -459,6 +473,9 @@ GLOBAL_EXTERN rwlock_t GlobalSMBSeslock; /* protects list inserts on 3 above */
459 473
460GLOBAL_EXTERN struct list_head GlobalOplock_Q; 474GLOBAL_EXTERN struct list_head GlobalOplock_Q;
461 475
476GLOBAL_EXTERN struct list_head GlobalDnotifyReqList; /* Outstanding dir notify requests */
477GLOBAL_EXTERN struct list_head GlobalDnotifyRsp_Q; /* Dir notify response queue */
478
462/* 479/*
463 * Global transaction id (XID) information 480 * Global transaction id (XID) information
464 */ 481 */
diff --git a/fs/cifs/cifspdu.h b/fs/cifs/cifspdu.h
index 42c16cf32284..026c88f486a2 100644
--- a/fs/cifs/cifspdu.h
+++ b/fs/cifs/cifspdu.h
@@ -53,6 +53,7 @@
53#define SMB_COM_NT_TRANSACT 0xA0 53#define SMB_COM_NT_TRANSACT 0xA0
54#define SMB_COM_NT_TRANSACT_SECONDARY 0xA1 54#define SMB_COM_NT_TRANSACT_SECONDARY 0xA1
55#define SMB_COM_NT_CREATE_ANDX 0xA2 55#define SMB_COM_NT_CREATE_ANDX 0xA2
56#define SMB_COM_NT_CANCEL 0xA4 /* no response */
56#define SMB_COM_NT_RENAME 0xA5 /* trivial response */ 57#define SMB_COM_NT_RENAME 0xA5 /* trivial response */
57 58
58/* Transact2 subcommand codes */ 59/* Transact2 subcommand codes */
diff --git a/fs/cifs/cifssmb.c b/fs/cifs/cifssmb.c
index 698cdcebca04..36d45b1dffc2 100644
--- a/fs/cifs/cifssmb.c
+++ b/fs/cifs/cifssmb.c
@@ -4015,6 +4015,22 @@ int CIFSSMBNotify(const int xid, struct cifsTconInfo *tcon,
4015 (struct smb_hdr *) pSMBr, &bytes_returned, -1); 4015 (struct smb_hdr *) pSMBr, &bytes_returned, -1);
4016 if (rc) { 4016 if (rc) {
4017 cFYI(1, ("Error in Notify = %d", rc)); 4017 cFYI(1, ("Error in Notify = %d", rc));
4018 } else {
4019 /* Add file to outstanding requests */
4020 dnotify_req = (struct dir_notify_req *) kmalloc(
4021 sizeof(struct dir_notify_req), GFP_KERNEL);
4022 dnotify_req->Pid = pSMB->hdr.Pid;
4023 dnotify_req->PidHigh = pSMB->hdr.PidHigh;
4024 dnotify_req->Mid = pSMB->hdr.Mid;
4025 dnotify_req->Tid = pSMB->hdr.Tid;
4026 dnotify_req->Uid = pSMB->hdr.Uid;
4027 dnotify_req->netfid = netfid;
4028 dnotify_req->dentry = dentry;
4029 dnotify_req->filter = filter;
4030 dnotify_req->multishot = multishot;
4031 spin_lock(&GlobalMid_Lock);
4032 list_add_tail(&dnotify_req->lhead, &GlobalDnotifyReqList);
4033 spin_unlock(&GlobalMid_Lock);
4018 } 4034 }
4019 cifs_buf_release(pSMB); 4035 cifs_buf_release(pSMB);
4020 return rc; 4036 return rc;