block_dev: get bdev inode bdi directly from the block device
authorChristoph Hellwig <hch@lst.de>
Wed, 14 Jan 2015 09:42:34 +0000 (10:42 +0100)
committerJens Axboe <axboe@fb.com>
Tue, 20 Jan 2015 21:03:01 +0000 (14:03 -0700)
Directly grab the backing_dev_info from the request_queue instead of
detouring through the address_space.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Tejun Heo <tj@kernel.org>
Reviewed-by: Jan Kara <jack@suse.cz>
Signed-off-by: Jens Axboe <axboe@fb.com>
fs/fs-writeback.c

index 2d609a5fbfea96e6ebe8dc65ebf64cd64dca0c8d..e8116a44cc29e280fb438574849298649891d7a6 100644 (file)
@@ -69,10 +69,10 @@ EXPORT_SYMBOL(writeback_in_progress);
 static inline struct backing_dev_info *inode_to_bdi(struct inode *inode)
 {
        struct super_block *sb = inode->i_sb;
-
+#ifdef CONFIG_BLOCK
        if (sb_is_blkdev_sb(sb))
-               return inode->i_mapping->backing_dev_info;
-
+               return blk_get_backing_dev_info(I_BDEV(inode));
+#endif
        return sb->s_bdi;
 }