Commit ccdf7741 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Jens Axboe

mm: don't include <linux/blkdev.h> in <linux/backing-dev.h>

Move inode_to_bdi out of line to avoid having to include blkdev.h.
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatarJohannes Thumshirn <johannes.thumshirn@wdc.com>
Link: https://lore.kernel.org/r/20210920123328.1399408-4-hch@lst.deSigned-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent e41d12f5
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/major.h> #include <linux/major.h>
#include <linux/backing-dev.h> #include <linux/backing-dev.h>
#include <linux/blkdev.h>
#include <linux/fs_context.h> #include <linux/fs_context.h>
#include "mtdcore.h" #include "mtdcore.h"
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
* Copyright (c) 2001-2015 Anton Altaparmakov and Tuxera Inc. * Copyright (c) 2001-2015 Anton Altaparmakov and Tuxera Inc.
*/ */
#include <linux/blkdev.h>
#include <linux/backing-dev.h> #include <linux/backing-dev.h>
#include <linux/buffer_head.h> #include <linux/buffer_head.h>
#include <linux/gfp.h> #include <linux/gfp.h>
......
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
*/ */
#include <linux/backing-dev.h> #include <linux/backing-dev.h>
#include <linux/blkdev.h>
#include <linux/buffer_head.h> #include <linux/buffer_head.h>
#include <linux/compat.h> #include <linux/compat.h>
#include <linux/falloc.h> #include <linux/falloc.h>
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
* Linux VFS inode operations. * Linux VFS inode operations.
*/ */
#include <linux/bvec.h> #include <linux/blkdev.h>
#include <linux/fileattr.h> #include <linux/fileattr.h>
#include "protocol.h" #include "protocol.h"
#include "orangefs-kernel.h" #include "orangefs-kernel.h"
......
...@@ -12,7 +12,6 @@ ...@@ -12,7 +12,6 @@
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/fs.h> #include <linux/fs.h>
#include <linux/sched.h> #include <linux/sched.h>
#include <linux/blkdev.h>
#include <linux/device.h> #include <linux/device.h>
#include <linux/writeback.h> #include <linux/writeback.h>
#include <linux/backing-dev-defs.h> #include <linux/backing-dev-defs.h>
...@@ -134,20 +133,7 @@ static inline bool writeback_in_progress(struct bdi_writeback *wb) ...@@ -134,20 +133,7 @@ static inline bool writeback_in_progress(struct bdi_writeback *wb)
return test_bit(WB_writeback_running, &wb->state); return test_bit(WB_writeback_running, &wb->state);
} }
static inline struct backing_dev_info *inode_to_bdi(struct inode *inode) 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;
}
static inline int wb_congested(struct bdi_writeback *wb, int cong_bits) static inline int wb_congested(struct bdi_writeback *wb, int cong_bits)
{ {
......
...@@ -978,6 +978,22 @@ void bdi_put(struct backing_dev_info *bdi) ...@@ -978,6 +978,22 @@ void bdi_put(struct backing_dev_info *bdi)
} }
EXPORT_SYMBOL(bdi_put); 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) const char *bdi_dev_name(struct backing_dev_info *bdi)
{ {
if (!bdi || !bdi->dev) if (!bdi || !bdi->dev)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment