]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - fs/fuse/dev.c
fuse: implement poll support
[linux-2.6-omap-h63xx.git] / fs / fuse / dev.c
index ffd670bb8c8c540b735a4353a8bb07453c797f1d..6176e444c76edbdc39799b6c56563d2a078168d4 100644 (file)
@@ -816,10 +816,29 @@ static ssize_t fuse_dev_read(struct kiocb *iocb, const struct iovec *iov,
        return err;
 }
 
+static int fuse_notify_poll(struct fuse_conn *fc, unsigned int size,
+                           struct fuse_copy_state *cs)
+{
+       struct fuse_notify_poll_wakeup_out outarg;
+       int err;
+
+       if (size != sizeof(outarg))
+               return -EINVAL;
+
+       err = fuse_copy_one(cs, &outarg, sizeof(outarg));
+       if (err)
+               return err;
+
+       return fuse_notify_poll_wakeup(fc, &outarg);
+}
+
 static int fuse_notify(struct fuse_conn *fc, enum fuse_notify_code code,
                       unsigned int size, struct fuse_copy_state *cs)
 {
        switch (code) {
+       case FUSE_NOTIFY_POLL:
+               return fuse_notify_poll(fc, size, cs);
+
        default:
                return -EINVAL;
        }