From c9581107856ac932817c4bb832042c968af45394 Mon Sep 17 00:00:00 2001 From: Gu Jinxiang Date: Fri, 26 Jan 2018 15:26:02 +0800 Subject: btrfs-progs: Sync code with kernel for BTRFS_MAX_INLINE_DATA_SIZE Do a cleanup. Also make it consistent with kernel. Use fs_info instead of root for BTRFS_MAX_INLINE_DATA_SIZE, since maybe in some situation we do not know root, but just know fs_info. Change macro to inline function to be consistent with kernel. And change the function body to match kernel. Signed-off-by: Gu Jinxiang Reviewed-by: Qu Wenruo Signed-off-by: David Sterba --- convert/source-ext2.c | 2 +- convert/source-reiserfs.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'convert') diff --git a/convert/source-ext2.c b/convert/source-ext2.c index e5c2a943..f5ecd8cf 100644 --- a/convert/source-ext2.c +++ b/convert/source-ext2.c @@ -309,7 +309,7 @@ static int ext2_create_file_extents(struct btrfs_trans_handle *trans, goto fail; if ((convert_flags & CONVERT_FLAG_INLINE_DATA) && data.first_block == 0 && data.num_blocks > 0 - && inode_size <= BTRFS_MAX_INLINE_DATA_SIZE(root)) { + && inode_size <= BTRFS_MAX_INLINE_DATA_SIZE(root->fs_info)) { u64 num_bytes = data.num_blocks * sectorsize; u64 disk_bytenr = data.disk_block * sectorsize; u64 nbytes; diff --git a/convert/source-reiserfs.c b/convert/source-reiserfs.c index e3582bda..39d6f072 100644 --- a/convert/source-reiserfs.c +++ b/convert/source-reiserfs.c @@ -376,7 +376,7 @@ static int reiserfs_convert_tail(struct btrfs_trans_handle *trans, u64 isize; int ret; - if (length >= BTRFS_MAX_INLINE_DATA_SIZE(root)) + if (length >= BTRFS_MAX_INLINE_DATA_SIZE(root->fs_info)) return convert_direct(trans, root, objectid, inode, body, length, offset, convert_flags); -- cgit v1.2.3