mirror of
https://gitee.com/bianbu-linux/linux-6.6
synced 2025-04-26 14:17:26 -04:00
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: 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>
This commit is contained in:
parent
e41d12f539
commit
ccdf774189
6 changed files with 21 additions and 16 deletions
|
@ -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)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue