Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs
[muen/linux.git] / fs / notify / inotify / inotify_user.c
index 43c23653ce2eb186277d09211dcfef46e5c4719c..ef32f36579589090535cd046ae3a193b77bb830d 100644 (file)
@@ -307,6 +307,20 @@ static long inotify_ioctl(struct file *file, unsigned int cmd,
                spin_unlock(&group->notification_lock);
                ret = put_user(send_len, (int __user *) p);
                break;
+#ifdef CONFIG_CHECKPOINT_RESTORE
+       case INOTIFY_IOC_SETNEXTWD:
+               ret = -EINVAL;
+               if (arg >= 1 && arg <= INT_MAX) {
+                       struct inotify_group_private_data *data;
+
+                       data = &group->inotify_data;
+                       spin_lock(&data->idr_lock);
+                       idr_set_cursor(&data->idr, (unsigned int)arg);
+                       spin_unlock(&data->idr_lock);
+                       ret = 0;
+               }
+               break;
+#endif /* CONFIG_CHECKPOINT_RESTORE */
        }
 
        return ret;