aboutsummaryrefslogtreecommitdiffstats
path: root/fs/fuse/dev.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/fuse/dev.c')
-rw-r--r--fs/fuse/dev.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/fs/fuse/dev.c b/fs/fuse/dev.c
index b2e8613a26d8..438770f8867f 100644
--- a/fs/fuse/dev.c
+++ b/fs/fuse/dev.c
@@ -317,6 +317,7 @@ static void queue_request(struct fuse_conn *fc, struct fuse_req *req)
317 list_add_tail(&req->list, &fc->pending); 317 list_add_tail(&req->list, &fc->pending);
318 req->state = FUSE_REQ_PENDING; 318 req->state = FUSE_REQ_PENDING;
319 wake_up(&fc->waitq); 319 wake_up(&fc->waitq);
320 kill_fasync(&fc->fasync, SIGIO, POLL_IN);
320} 321}
321 322
322/* 323/*
@@ -901,6 +902,7 @@ void fuse_abort_conn(struct fuse_conn *fc)
901 end_requests(fc, &fc->pending); 902 end_requests(fc, &fc->pending);
902 end_requests(fc, &fc->processing); 903 end_requests(fc, &fc->processing);
903 wake_up_all(&fc->waitq); 904 wake_up_all(&fc->waitq);
905 kill_fasync(&fc->fasync, SIGIO, POLL_IN);
904 } 906 }
905 spin_unlock(&fuse_lock); 907 spin_unlock(&fuse_lock);
906} 908}
@@ -917,12 +919,24 @@ static int fuse_dev_release(struct inode *inode, struct file *file)
917 end_requests(fc, &fc->processing); 919 end_requests(fc, &fc->processing);
918 } 920 }
919 spin_unlock(&fuse_lock); 921 spin_unlock(&fuse_lock);
920 if (fc) 922 if (fc) {
923 fasync_helper(-1, file, 0, &fc->fasync);
921 kobject_put(&fc->kobj); 924 kobject_put(&fc->kobj);
925 }
922 926
923 return 0; 927 return 0;
924} 928}
925 929
930static int fuse_dev_fasync(int fd, struct file *file, int on)
931{
932 struct fuse_conn *fc = fuse_get_conn(file);
933 if (!fc)
934 return -ENODEV;
935
936 /* No locking - fasync_helper does its own locking */
937 return fasync_helper(fd, file, on, &fc->fasync);
938}
939
926const struct file_operations fuse_dev_operations = { 940const struct file_operations fuse_dev_operations = {
927 .owner = THIS_MODULE, 941 .owner = THIS_MODULE,
928 .llseek = no_llseek, 942 .llseek = no_llseek,
@@ -932,6 +946,7 @@ const struct file_operations fuse_dev_operations = {
932 .writev = fuse_dev_writev, 946 .writev = fuse_dev_writev,
933 .poll = fuse_dev_poll, 947 .poll = fuse_dev_poll,
934 .release = fuse_dev_release, 948 .release = fuse_dev_release,
949 .fasync = fuse_dev_fasync,
935}; 950};
936 951
937static struct miscdevice fuse_miscdevice = { 952static struct miscdevice fuse_miscdevice = {