Btrfs: don't use threaded IO completion helpers for metadata writes
authorChris Mason <chris.mason@oracle.com>
Fri, 23 Mar 2012 14:22:46 +0000 (10:22 -0400)
committerChris Mason <chris.mason@oracle.com>
Mon, 26 Mar 2012 21:04:24 +0000 (17:04 -0400)
The metadata write IO completion code is now simple enough that we
don't need the threaded helpers anymore.

Signed-off-by: Chris Mason <chris.mason@oracle.com>
fs/btrfs/disk-io.c

index c54aec87e89db38dfe8f94da86955a0b5b0dc707..53c5ea7027998fa0e5aa3beb52c68578992086af 100644 (file)
@@ -840,15 +840,15 @@ static int btree_submit_bio_hook(struct inode *inode, int rw, struct bio *bio,
 {
        int ret;
 
-       ret = btrfs_bio_wq_end_io(BTRFS_I(inode)->root->fs_info,
-                                         bio, 1);
-       BUG_ON(ret);
-
        if (!(rw & REQ_WRITE)) {
+
                /*
                 * called for a read, do the setup so that checksum validation
                 * can happen in the async kernel threads
                 */
+               ret = btrfs_bio_wq_end_io(BTRFS_I(inode)->root->fs_info,
+                                         bio, 1);
+               BUG_ON(ret);
                return btrfs_map_bio(BTRFS_I(inode)->root, rw, bio,
                                     mirror_num, 0);
        }