smb3: improve SMB3 change notification support
[linux-2.6-microblaze.git] / fs / cifs / ioctl.c
index b6e6e5d..89d5fa8 100644 (file)
@@ -484,12 +484,35 @@ long cifs_ioctl(struct file *filep, unsigned int command, unsigned long arg)
                        tcon = tlink_tcon(tlink);
                        if (tcon && tcon->ses->server->ops->notify) {
                                rc = tcon->ses->server->ops->notify(xid,
-                                               filep, (void __user *)arg);
+                                               filep, (void __user *)arg,
+                                               false /* no ret data */);
                                cifs_dbg(FYI, "ioctl notify rc %d\n", rc);
                        } else
                                rc = -EOPNOTSUPP;
                        cifs_put_tlink(tlink);
                        break;
+               case CIFS_IOC_NOTIFY_INFO:
+                       if (!S_ISDIR(inode->i_mode)) {
+                               /* Notify can only be done on directories */
+                               rc = -EOPNOTSUPP;
+                               break;
+                       }
+                       cifs_sb = CIFS_SB(inode->i_sb);
+                       tlink = cifs_sb_tlink(cifs_sb);
+                       if (IS_ERR(tlink)) {
+                               rc = PTR_ERR(tlink);
+                               break;
+                       }
+                       tcon = tlink_tcon(tlink);
+                       if (tcon && tcon->ses->server->ops->notify) {
+                               rc = tcon->ses->server->ops->notify(xid,
+                                               filep, (void __user *)arg,
+                                               true /* return details */);
+                               cifs_dbg(FYI, "ioctl notify info rc %d\n", rc);
+                       } else
+                               rc = -EOPNOTSUPP;
+                       cifs_put_tlink(tlink);
+                       break;
                case CIFS_IOC_SHUTDOWN:
                        rc = cifs_shutdown(inode->i_sb, arg);
                        break;