aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorMiklos Szeredi <mszeredi@suse.cz>2014-12-12 03:49:04 -0500
committerMiklos Szeredi <mszeredi@suse.cz>2014-12-12 03:49:04 -0500
commit580640ba5d331eb5631a5de46941c98f5ed90886 (patch)
treed35634561892040cb1cd4a72f2646e2cbe88f05c /fs
parent0c4dd4ba1426c599072511dcf95a15ee5e12725b (diff)
fuse: flush requests on umount
Use fuse_abort_conn() instead of fuse_conn_kill() in fuse_put_super(). This flushes and aborts requests still on any queues. But since we've already reset fc->connected, those requests would not be useful anyway and would be flushed when the fuse device is closed. Next patches will rely on requests being flushed before the superblock is destroyed. Use fuse_abort_conn() in cuse_process_init_reply() too, since it makes no difference there, and we can get rid of fuse_conn_kill(). Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
Diffstat (limited to 'fs')
-rw-r--r--fs/fuse/cuse.c2
-rw-r--r--fs/fuse/fuse_i.h2
-rw-r--r--fs/fuse/inode.c16
3 files changed, 2 insertions, 18 deletions
diff --git a/fs/fuse/cuse.c b/fs/fuse/cuse.c
index 966ace8b243f..28d0c7abba1c 100644
--- a/fs/fuse/cuse.c
+++ b/fs/fuse/cuse.c
@@ -415,7 +415,7 @@ err_unlock:
415err_region: 415err_region:
416 unregister_chrdev_region(devt, 1); 416 unregister_chrdev_region(devt, 1);
417err: 417err:
418 fuse_conn_kill(fc); 418 fuse_abort_conn(fc);
419 goto out; 419 goto out;
420} 420}
421 421
diff --git a/fs/fuse/fuse_i.h b/fs/fuse/fuse_i.h
index e8e47a6ab518..fbc63ab149b6 100644
--- a/fs/fuse/fuse_i.h
+++ b/fs/fuse/fuse_i.h
@@ -804,8 +804,6 @@ void fuse_invalidate_atime(struct inode *inode);
804 */ 804 */
805struct fuse_conn *fuse_conn_get(struct fuse_conn *fc); 805struct fuse_conn *fuse_conn_get(struct fuse_conn *fc);
806 806
807void fuse_conn_kill(struct fuse_conn *fc);
808
809/** 807/**
810 * Initialize fuse_conn 808 * Initialize fuse_conn
811 */ 809 */
diff --git a/fs/fuse/inode.c b/fs/fuse/inode.c
index 15653a073d69..616a791270b7 100644
--- a/fs/fuse/inode.c
+++ b/fs/fuse/inode.c
@@ -376,27 +376,13 @@ static void fuse_bdi_destroy(struct fuse_conn *fc)
376 bdi_destroy(&fc->bdi); 376 bdi_destroy(&fc->bdi);
377} 377}
378 378
379void fuse_conn_kill(struct fuse_conn *fc)
380{
381 spin_lock(&fc->lock);
382 fc->connected = 0;
383 fc->blocked = 0;
384 fc->initialized = 1;
385 spin_unlock(&fc->lock);
386 /* Flush all readers on this fs */
387 kill_fasync(&fc->fasync, SIGIO, POLL_IN);
388 wake_up_all(&fc->waitq);
389 wake_up_all(&fc->blocked_waitq);
390}
391EXPORT_SYMBOL_GPL(fuse_conn_kill);
392
393static void fuse_put_super(struct super_block *sb) 379static void fuse_put_super(struct super_block *sb)
394{ 380{
395 struct fuse_conn *fc = get_fuse_conn_super(sb); 381 struct fuse_conn *fc = get_fuse_conn_super(sb);
396 382
397 fuse_send_destroy(fc); 383 fuse_send_destroy(fc);
398 384
399 fuse_conn_kill(fc); 385 fuse_abort_conn(fc);
400 mutex_lock(&fuse_mutex); 386 mutex_lock(&fuse_mutex);
401 list_del(&fc->entry); 387 list_del(&fc->entry);
402 fuse_ctl_remove_conn(fc); 388 fuse_ctl_remove_conn(fc);