direct-io: Implement generic deferred AIO completions
[linux-2.6-block.git] / fs / super.c
index 68307c029228c51efc0e7967c90c39edd1a85113..5536a95186e28cc60d27676714cc5bb8a1ec350b 100644 (file)
@@ -152,15 +152,9 @@ static struct super_block *alloc_super(struct file_system_type *type, int flags)
        static const struct super_operations default_op;
 
        if (s) {
-               if (security_sb_alloc(s)) {
-                       /*
-                        * We cannot call security_sb_free() without
-                        * security_sb_alloc() succeeding. So bail out manually
-                        */
-                       kfree(s);
-                       s = NULL;
-                       goto out;
-               }
+               if (security_sb_alloc(s))
+                       goto out_free_sb;
+
 #ifdef CONFIG_SMP
                s->s_files = alloc_percpu(struct list_head);
                if (!s->s_files)
@@ -228,6 +222,7 @@ err_out:
                free_percpu(s->s_files);
 #endif
        destroy_sb_writers(s);
+out_free_sb:
        kfree(s);
        s = NULL;
        goto out;
@@ -414,6 +409,11 @@ void generic_shutdown_super(struct super_block *sb)
 
                evict_inodes(sb);
 
+               if (sb->s_dio_done_wq) {
+                       destroy_workqueue(sb->s_dio_done_wq);
+                       sb->s_dio_done_wq = NULL;
+               }
+
                if (sop->put_super)
                        sop->put_super(sb);