summary refs log tree commit diff
path: root/fs/reiserfs/super.c
diff options
context:
space:
mode:
authorJeff Mahoney <jeffm@suse.com>2014-04-23 10:00:34 -0400
committerJan Kara <jack@suse.cz>2014-05-06 22:44:45 +0200
commit797d9016ceca69879bb273218810fa0beef46aac (patch)
tree5a1e4e6bb653d4887fbc55915ecb8eea3c50edf1 /fs/reiserfs/super.c
parent38583f095c5a8138ae2a1c9173d0fd8a9f10e8aa (diff)
downloadlinux-797d9016ceca69879bb273218810fa0beef46aac.tar.gz
reiserfs: use per-fs commit workqueues
The reiserfs write lock hasn't been the BKL for some time. There's no
need to have different file systems queued up on the same workqueue.

Signed-off-by: Jeff Mahoney <jeffm@suse.com>
Signed-off-by: Jan Kara <jack@suse.cz>
Diffstat (limited to 'fs/reiserfs/super.c')
-rw-r--r--fs/reiserfs/super.c21
1 files changed, 15 insertions, 6 deletions
diff --git a/fs/reiserfs/super.c b/fs/reiserfs/super.c
index 9fb20426005e..16927b800562 100644
--- a/fs/reiserfs/super.c
+++ b/fs/reiserfs/super.c
@@ -559,6 +559,7 @@ static void reiserfs_put_super(struct super_block *s)
 
 	reiserfs_write_unlock(s);
 	mutex_destroy(&REISERFS_SB(s)->lock);
+	destroy_workqueue(REISERFS_SB(s)->commit_wq);
 	kfree(s->s_fs_info);
 	s->s_fs_info = NULL;
 }
@@ -1796,6 +1797,14 @@ static int reiserfs_fill_super(struct super_block *s, void *data, int silent)
 	mutex_init(&sbi->lock);
 	sbi->lock_depth = -1;
 
+	sbi->commit_wq = alloc_workqueue("reiserfs/%s", WQ_MEM_RECLAIM, 0,
+					 s->s_id);
+	if (!sbi->commit_wq) {
+		SWARN(silent, s, "", "Cannot allocate commit workqueue");
+		errval = -ENOMEM;
+		goto error_unlocked;
+	}
+
 	jdev_name = NULL;
 	if (reiserfs_parse_options
 	    (s, (char *)data, &(sbi->s_mount_opt), &blocks, &jdev_name,
@@ -2402,18 +2411,18 @@ static int __init init_reiserfs_fs(void)
 {
 	int ret;
 
-	if ((ret = init_inodecache())) {
+	ret = init_inodecache();
+	if (ret)
 		return ret;
-	}
 
 	reiserfs_proc_info_global_init();
 
 	ret = register_filesystem(&reiserfs_fs_type);
+	if (ret)
+		goto out;
 
-	if (ret == 0) {
-		return 0;
-	}
-
+	return 0;
+out:
 	reiserfs_proc_info_global_done();
 	destroy_inodecache();