mirror of
https://github.com/versity/scoutfs.git
synced 2026-02-07 11:10:44 +00:00
RIP bd_inode.
v6.9-rc4-29-g203c1ce0bb06 removes bd_inode. The canonical replacement is bd_mapping->host, were applicable. We have one use where we directly need the mapping instead of the inode, as well. Signed-off-by: Auke Kok <auke.kok@versity.com>
This commit is contained in:
@@ -465,3 +465,11 @@ endif
|
||||
ifneq (,$(shell grep -s 'define __LINUX_UNALIGNED_H' include/linux/unaligned.h))
|
||||
ccflags-y += -DKC_HAVE__LINUX_UNALIGNED_H
|
||||
endif
|
||||
|
||||
#
|
||||
# v6.9-rc4-29-g203c1ce0bb06
|
||||
#
|
||||
# RIP bd_inode. (note, struct moved between headers!)
|
||||
ifneq (,$(shell grep -s 'struct inode.*bd_inode' include/linux/blk_types.h include/linux/fs.h))
|
||||
ccflags-y += -DKC_HAVE_BD_INODE
|
||||
endif
|
||||
|
||||
@@ -279,14 +279,14 @@ static bool invalid_extent(u64 start, u64 end, u64 first, u64 last)
|
||||
static bool invalid_meta_blkno(struct super_block *sb, u64 blkno)
|
||||
{
|
||||
struct scoutfs_sb_info *sbi = SCOUTFS_SB(sb);
|
||||
u64 last_meta = (i_size_read(sbi->meta_bdev->bd_inode) >> SCOUTFS_BLOCK_LG_SHIFT) - 1;
|
||||
u64 last_meta = (i_size_read(KC_BDEV_INODE(sbi->meta_bdev)) >> SCOUTFS_BLOCK_LG_SHIFT) - 1;
|
||||
|
||||
return invalid_extent(blkno, blkno, SCOUTFS_META_DEV_START_BLKNO, last_meta);
|
||||
}
|
||||
|
||||
static bool invalid_data_extent(struct super_block *sb, u64 start, u64 len)
|
||||
{
|
||||
u64 last_data = (i_size_read(sb->s_bdev->bd_inode) >> SCOUTFS_BLOCK_SM_SHIFT) - 1;
|
||||
u64 last_data = (i_size_read(KC_BDEV_INODE(sb->s_bdev)) >> SCOUTFS_BLOCK_SM_SHIFT) - 1;
|
||||
|
||||
return invalid_extent(start, start + len - 1, SCOUTFS_DATA_DEV_START_BLKNO, last_data);
|
||||
}
|
||||
|
||||
@@ -509,4 +509,12 @@ static inline long inode_get_atime_nsec(const struct inode *inode)
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef KC_HAVE_BD_INODE
|
||||
#define KC_BDEV_INODE(b) (b)->bd_inode
|
||||
#define KC_BDEV_MAPPING(b) (b)->bd_inode->i_mapping
|
||||
#else
|
||||
#define KC_BDEV_INODE(b) (b)->bd_mapping->host
|
||||
#define KC_BDEV_MAPPING(b) (b)->bd_mapping
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
@@ -3232,7 +3232,7 @@ out:
|
||||
|
||||
static u64 device_blocks(struct block_device *bdev, int shift)
|
||||
{
|
||||
return i_size_read(bdev->bd_inode) >> shift;
|
||||
return i_size_read(KC_BDEV_INODE(bdev)) >> shift;
|
||||
}
|
||||
|
||||
static int server_resize_devices(struct super_block *sb, struct scoutfs_net_connection *conn,
|
||||
|
||||
@@ -283,7 +283,7 @@ int scoutfs_write_super(struct super_block *sb,
|
||||
static bool small_bdev(struct super_block *sb, char *which, u64 blocks,
|
||||
struct block_device *bdev, int shift)
|
||||
{
|
||||
u64 size = (u64)i_size_read(bdev->bd_inode);
|
||||
u64 size = (u64)i_size_read(KC_BDEV_INODE(bdev));
|
||||
u64 count = size >> shift;
|
||||
|
||||
if (blocks > count) {
|
||||
@@ -508,7 +508,7 @@ static int scoutfs_fill_super(struct super_block *sb, void *data, int silent)
|
||||
sb->s_time_gran = 1;
|
||||
|
||||
/* btree blocks use long lived bh->b_data refs */
|
||||
mapping_set_gfp_mask(sb->s_bdev->bd_inode->i_mapping, GFP_NOFS);
|
||||
mapping_set_gfp_mask(KC_BDEV_MAPPING(sb->s_bdev), GFP_NOFS);
|
||||
|
||||
sbi = kzalloc(sizeof(struct scoutfs_sb_info), GFP_KERNEL);
|
||||
sb->s_fs_info = sbi;
|
||||
|
||||
Reference in New Issue
Block a user