diff options
author | Jeff Dike <jdike@addtoit.com> | 2006-04-11 01:54:52 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-04-11 09:18:48 -0400 |
commit | 385a17bfc3cb035333c8a91eddc78a6e04c4625e (patch) | |
tree | 7a9fde77c95f0e4cc86f31e8b1f5d23b6d815634 /fs/fuse/inode.c | |
parent | 7025d9ad10a38dadef8b286e0092731c2d3cdc53 (diff) |
[PATCH] fuse: add O_ASYNC support to FUSE device
This adds asynchronous notification to FUSE - a FUSE server can request
O_ASYNC on a /dev/fuse file descriptor and receive SIGIO when there is input
available.
One subtlety - fuse_dev_fasync, which is called when O_ASYNC is requested,
does no locking, unlink the other methods. I think it's unnecessary, as the
fuse_conn.fasync list is manipulated only by fasync_helper and kill_fasync,
which provide their own locking. It would also be wrong to use the fuse_lock,
as it's a spin lock and fasync_helper can sleep. My one concern with this is
the fuse_conn going away underneath fuse_dev_fasync - sys_fcntl takes a
reference on the file struct, so this seems not to be a problem.
Signed-off-by: Jeff Dike <jdike@addtoit.com>
Signed-off-by: Miklos Szeredi <miklos@szeredi.hu>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'fs/fuse/inode.c')
-rw-r--r-- | fs/fuse/inode.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/fuse/inode.c b/fs/fuse/inode.c index 879e6fba9480..78700cbb9cdf 100644 --- a/fs/fuse/inode.c +++ b/fs/fuse/inode.c | |||
@@ -216,6 +216,7 @@ static void fuse_put_super(struct super_block *sb) | |||
216 | spin_unlock(&fuse_lock); | 216 | spin_unlock(&fuse_lock); |
217 | up_write(&fc->sbput_sem); | 217 | up_write(&fc->sbput_sem); |
218 | /* Flush all readers on this fs */ | 218 | /* Flush all readers on this fs */ |
219 | kill_fasync(&fc->fasync, SIGIO, POLL_IN); | ||
219 | wake_up_all(&fc->waitq); | 220 | wake_up_all(&fc->waitq); |
220 | kobject_del(&fc->kobj); | 221 | kobject_del(&fc->kobj); |
221 | kobject_put(&fc->kobj); | 222 | kobject_put(&fc->kobj); |