cifs: add SMB3 change notification support
[linux-2.6-microblaze.git] / fs / cifs / ioctl.c
index 1a01e10..4a73e63 100644 (file)
@@ -65,7 +65,7 @@ static long cifs_ioctl_query_info(unsigned int xid, struct file *filep,
 
        if (tcon->ses->server->ops->ioctl_query_info)
                rc = tcon->ses->server->ops->ioctl_query_info(
-                               xid, tcon, utf16_path,
+                               xid, tcon, cifs_sb, utf16_path,
                                filep->private_data ? 0 : 1, p);
        else
                rc = -EOPNOTSUPP;
@@ -169,6 +169,7 @@ long cifs_ioctl(struct file *filep, unsigned int command, unsigned long arg)
        unsigned int xid;
        struct cifsFileInfo *pSMBFile = filep->private_data;
        struct cifs_tcon *tcon;
+       struct cifs_sb_info *cifs_sb;
        __u64   ExtAttrBits = 0;
        __u64   caps;
 
@@ -299,6 +300,21 @@ long cifs_ioctl(struct file *filep, unsigned int command, unsigned long arg)
                        else
                                rc = 0;
                        break;
+               case CIFS_IOC_NOTIFY:
+                       if (!S_ISDIR(inode->i_mode)) {
+                               /* Notify can only be done on directories */
+                               rc = -EOPNOTSUPP;
+                               break;
+                       }
+                       cifs_sb = CIFS_SB(inode->i_sb);
+                       tcon = tlink_tcon(cifs_sb_tlink(cifs_sb));
+                       if (tcon && tcon->ses->server->ops->notify) {
+                               rc = tcon->ses->server->ops->notify(xid,
+                                               filep, (void __user *)arg);
+                               cifs_dbg(FYI, "ioctl notify rc %d\n", rc);
+                       } else
+                               rc = -EOPNOTSUPP;
+                       break;
                default:
                        cifs_dbg(FYI, "unsupported ioctl\n");
                        break;