]> git.baikalelectronics.ru Git - kernel.git/commitdiff
mm: don't include <linux/blkdev.h> in <linux/backing-dev.h>
authorChristoph Hellwig <hch@lst.de>
Mon, 20 Sep 2021 12:33:14 +0000 (14:33 +0200)
committerJens Axboe <axboe@kernel.dk>
Mon, 18 Oct 2021 12:17:01 +0000 (06:17 -0600)
Move inode_to_bdi out of line to avoid having to include blkdev.h.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Link: https://lore.kernel.org/r/20210920123328.1399408-4-hch@lst.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/mtd/mtdsuper.c
fs/ntfs/file.c
fs/ntfs3/file.c
fs/orangefs/inode.c
include/linux/backing-dev.h
mm/backing-dev.c

index 38b6aa849c638343aebe1f1da8ed8ab90946ce3d..5ff001140ef4abe1437531ce85d2b8530d81aade 100644 (file)
@@ -15,6 +15,7 @@
 #include <linux/slab.h>
 #include <linux/major.h>
 #include <linux/backing-dev.h>
+#include <linux/blkdev.h>
 #include <linux/fs_context.h>
 #include "mtdcore.h"
 
index ab4f3362466d068d06c76497b68c70ed5481245f..373dbb627657089f2c1361350f583c93c98e346d 100644 (file)
@@ -5,6 +5,7 @@
  * Copyright (c) 2001-2015 Anton Altaparmakov and Tuxera Inc.
  */
 
+#include <linux/blkdev.h>
 #include <linux/backing-dev.h>
 #include <linux/buffer_head.h>
 #include <linux/gfp.h>
index 43b1451bff539576cd03c0f624708bf65b959270..a3cd3c3f091ec58b3d0626ae4e125555c11d8593 100644 (file)
@@ -8,6 +8,7 @@
  */
 
 #include <linux/backing-dev.h>
+#include <linux/blkdev.h>
 #include <linux/buffer_head.h>
 #include <linux/compat.h>
 #include <linux/falloc.h>
index c1bb4c4b5d672803214970542dc492b26b53a804..e5e3e500ed4627b4e450803ff9af603af43ec56d 100644 (file)
@@ -10,7 +10,7 @@
  *  Linux VFS inode operations.
  */
 
-#include <linux/bvec.h>
+#include <linux/blkdev.h>
 #include <linux/fileattr.h>
 #include "protocol.h"
 #include "orangefs-kernel.h"
index 843bf4be675f349ec0ca3b028ec89e0513a19da7..4ac7ce09601398936ffd2657676de030fe6a646f 100644 (file)
@@ -12,7 +12,6 @@
 #include <linux/kernel.h>
 #include <linux/fs.h>
 #include <linux/sched.h>
-#include <linux/blkdev.h>
 #include <linux/device.h>
 #include <linux/writeback.h>
 #include <linux/backing-dev-defs.h>
@@ -134,20 +133,7 @@ static inline bool writeback_in_progress(struct bdi_writeback *wb)
        return test_bit(WB_writeback_running, &wb->state);
 }
 
-static inline struct backing_dev_info *inode_to_bdi(struct inode *inode)
-{
-       struct super_block *sb;
-
-       if (!inode)
-               return &noop_backing_dev_info;
-
-       sb = inode->i_sb;
-#ifdef CONFIG_BLOCK
-       if (sb_is_blkdev_sb(sb))
-               return I_BDEV(inode)->bd_disk->bdi;
-#endif
-       return sb->s_bdi;
-}
+struct backing_dev_info *inode_to_bdi(struct inode *inode);
 
 static inline int wb_congested(struct bdi_writeback *wb, int cong_bits)
 {
index 5245744437dc93e3e3dea6b4c91cbb0ddd1ab7dd..c878d995af06ef3b5cb1c20238c73ce0b1816b44 100644 (file)
@@ -978,6 +978,22 @@ void bdi_put(struct backing_dev_info *bdi)
 }
 EXPORT_SYMBOL(bdi_put);
 
+struct backing_dev_info *inode_to_bdi(struct inode *inode)
+{
+       struct super_block *sb;
+
+       if (!inode)
+               return &noop_backing_dev_info;
+
+       sb = inode->i_sb;
+#ifdef CONFIG_BLOCK
+       if (sb_is_blkdev_sb(sb))
+               return I_BDEV(inode)->bd_disk->bdi;
+#endif
+       return sb->s_bdi;
+}
+EXPORT_SYMBOL(inode_to_bdi);
+
 const char *bdi_dev_name(struct backing_dev_info *bdi)
 {
        if (!bdi || !bdi->dev)