]> git.hungrycats.org Git - linux/commitdiff
btrfs: make max inline data can be equal to sectorsize
authorWang Xiaoguang <wangxg.fnst@cn.fujitsu.com>
Tue, 11 Oct 2016 06:47:42 +0000 (14:47 +0800)
committerZygo Blaxell <zblaxell@thirteen.furryterror.org>
Wed, 12 Oct 2016 00:58:18 +0000 (20:58 -0400)
If we use mount option "-o max_inline=sectorsize", say 4096, indeed
even for a fresh fs, say nodesize is 16k, we can not make the first
4k data completely inline, I found this conditon causing this issue:
  !compressed_size && (actual_end & (root->sectorsize - 1)) == 0

If it retuns true, we'll not make data inline. For 4k sectorsize,
0~4094 dara range, we can make it inline, but 0~4095, it can not.
I don't think this limition is useful, so here remove it which will
make max inline data can be equal to sectorsize.

Signed-off-by: Wang Xiaoguang <wangxg.fnst@cn.fujitsu.com>
fs/btrfs/inode.c

index a39eaa894ddd2ac2de07819355615be8813b30ac..79e88a9d78918ec65f96da20cbefc42fa1324193 100644 (file)
@@ -267,8 +267,6 @@ static noinline int cow_file_range_inline(struct btrfs_root *root,
        if (start > 0 ||
            actual_end > PAGE_CACHE_SIZE ||
            data_len > BTRFS_MAX_INLINE_DATA_SIZE(root) ||
-           (!compressed_size &&
-           (actual_end & (root->sectorsize - 1)) == 0) ||
            end + 1 < isize ||
            data_len > root->fs_info->max_inline) {
                return 1;