diff options
author | Enke Chen <enkechen@yahoo.com> | 2013-02-07 14:58:50 +0100 |
---|---|---|
committer | Miklos Szeredi <mszeredi@suse.cz> | 2013-02-07 14:58:50 +0100 |
commit | 74f9acbd18c55708698831b4cfb980c262ee91ee (patch) | |
tree | 2527f09b765a8b111135fbe90a9e83c92cbb78ca | |
parent | f448ac69d1791f4b5c1ce2771624e261cb1797b4 (diff) |
libfuse: add poll_events to fuse_file_info
Make requested poll events available to the filesystem. If the requested
eventsare not available, then this field is zero.
-rw-r--r-- | ChangeLog | 2 | ||||
-rw-r--r-- | include/fuse_common.h | 5 | ||||
-rw-r--r-- | include/fuse_kernel.h | 3 | ||||
-rw-r--r-- | lib/fuse.c | 5 | ||||
-rw-r--r-- | lib/fuse_lowlevel.c | 1 |
5 files changed, 13 insertions, 3 deletions
@@ -3,6 +3,8 @@ * libfuse: add readdirplus support in fuse_lowlevel_ops. Patch by Feng Shuo + * libfuse: add poll_events to fuse_file_info. Patch by Enke Chen + 2013-02-06 Miklos Szeredi <miklos@szeredi.hu> * libfuse: set close-on-exec flag on pipe file descriptors. Patch diff --git a/include/fuse_common.h b/include/fuse_common.h index c8a2409..cb2d8cf 100644 --- a/include/fuse_common.h +++ b/include/fuse_common.h @@ -84,6 +84,11 @@ struct fuse_file_info { /** Lock owner id. Available in locking operations and flush */ uint64_t lock_owner; + + /** Requested poll events. Available in ->poll. Only set on kernels + which support it. If unsupported, this field is set to zero. + Introduced in version 3.0 */ + uint32_t poll_events; }; /** diff --git a/include/fuse_kernel.h b/include/fuse_kernel.h index 28fefbb..baee03e 100644 --- a/include/fuse_kernel.h +++ b/include/fuse_kernel.h @@ -89,6 +89,7 @@ * * 7.21 * - add FUSE_READDIRPLUS + * - send the requested events in POLL request */ #ifndef _LINUX_FUSE_H @@ -620,7 +621,7 @@ struct fuse_poll_in { __u64 fh; __u64 kh; __u32 flags; - __u32 padding; + __u32 events; }; struct fuse_poll_out { @@ -2196,8 +2196,9 @@ int fuse_fs_poll(struct fuse_fs *fs, const char *path, int res; if (fs->debug) - fprintf(stderr, "poll[%llu] ph: %p\n", - (unsigned long long) fi->fh, ph); + fprintf(stderr, "poll[%llu] ph: %p, events 0x%x\n", + (unsigned long long) fi->fh, ph, + fi->poll_events); res = fs->op.poll(path, fi, ph, reventsp); diff --git a/lib/fuse_lowlevel.c b/lib/fuse_lowlevel.c index feaa076..2ac9aab 100644 --- a/lib/fuse_lowlevel.c +++ b/lib/fuse_lowlevel.c @@ -1746,6 +1746,7 @@ static void do_poll(fuse_req_t req, fuse_ino_t nodeid, const void *inarg) memset(&fi, 0, sizeof(fi)); fi.fh = arg->fh; fi.fh_old = fi.fh; + fi.poll_events = arg->events; if (req->f->op.poll) { struct fuse_pollhandle *ph = NULL; |