diff options
author | Nikolay Borisov <nborisov@suse.com> | 2020-06-03 08:55:26 +0300 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2020-07-27 12:55:33 +0200 |
commit | 99c88dc71cae52050892798e20c63d5d7053bb94 (patch) | |
tree | 842f67d974227a7f37d6a76015c512ca61d9a3e7 /fs | |
parent | 64e1db566deb5fd5bd9ece981b609de7c540c12a (diff) | |
download | lwn-99c88dc71cae52050892798e20c63d5d7053bb94.tar.gz lwn-99c88dc71cae52050892798e20c63d5d7053bb94.zip |
btrfs: make inode_can_compress take btrfs_inode
Gets rid of superfluous BTRFS_I() calls.
Signed-off-by: Nikolay Borisov <nborisov@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/btrfs/inode.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index 445085cd58be..0d3f0b3c1621 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c @@ -412,10 +412,10 @@ static noinline int add_async_extent(struct async_chunk *cow, /* * Check if the inode has flags compatible with compression */ -static inline bool inode_can_compress(struct inode *inode) +static inline bool inode_can_compress(struct btrfs_inode *inode) { - if (BTRFS_I(inode)->flags & BTRFS_INODE_NODATACOW || - BTRFS_I(inode)->flags & BTRFS_INODE_NODATASUM) + if (inode->flags & BTRFS_INODE_NODATACOW || + inode->flags & BTRFS_INODE_NODATASUM) return false; return true; } @@ -428,7 +428,7 @@ static inline int inode_need_compress(struct inode *inode, u64 start, u64 end) { struct btrfs_fs_info *fs_info = btrfs_sb(inode->i_sb); - if (!inode_can_compress(inode)) { + if (!inode_can_compress(BTRFS_I(inode))) { WARN(IS_ENABLED(CONFIG_BTRFS_DEBUG), KERN_ERR "BTRFS: unexpected compression for ino %llu\n", btrfs_ino(BTRFS_I(inode))); @@ -1826,7 +1826,7 @@ int btrfs_run_delalloc_range(struct inode *inode, struct page *locked_page, } else if (BTRFS_I(inode)->flags & BTRFS_INODE_PREALLOC && !force_cow) { ret = run_delalloc_nocow(BTRFS_I(inode), locked_page, start, end, page_started, 0, nr_written); - } else if (!inode_can_compress(inode) || + } else if (!inode_can_compress(BTRFS_I(inode)) || !inode_need_compress(inode, start, end)) { ret = cow_file_range(BTRFS_I(inode), locked_page, start, end, page_started, nr_written, 1); |