diff options
author | David Sterba <dsterba@suse.com> | 2017-07-17 20:17:20 +0300 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2017-08-16 17:12:05 +0300 |
commit | b52aa8c93e1fec97fcd87345b13f532f0dee8239 (patch) | |
tree | 3d5cbb93ef75de3b7e920d5d608db61c3d621d74 /fs/btrfs/inode.c | |
parent | c2fcdcdf36bba08c5d2fbf4f17c2d8a944bfd4df (diff) | |
download | linux-b52aa8c93e1fec97fcd87345b13f532f0dee8239.tar.xz |
btrfs: rename variable holding per-inode compression type
This is preparatory for separating inode compression requested by defrag
and set via properties. This will fix a usability bug when defrag will
reset compression type to NONE. If the file has compression set via
property, it will not apply anymore (until next mount or reset through
command line).
We're going to fix that by adding another variable just for the defrag
call and won't touch the property. The defrag will have higher priority
when deciding whether to compress the data.
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/inode.c')
-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 0bd008b9e0d1..c60a6d692bc1 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c @@ -404,7 +404,7 @@ static inline int inode_need_compress(struct inode *inode, u64 start, u64 end) return 0; if (btrfs_test_opt(fs_info, COMPRESS) || BTRFS_I(inode)->flags & BTRFS_INODE_COMPRESS || - BTRFS_I(inode)->force_compress) + BTRFS_I(inode)->prop_compress) return btrfs_compress_heuristic(inode, start, end); return 0; } @@ -511,8 +511,8 @@ again: goto cont; } - if (BTRFS_I(inode)->force_compress) - compress_type = BTRFS_I(inode)->force_compress; + if (BTRFS_I(inode)->prop_compress) + compress_type = BTRFS_I(inode)->prop_compress; /* * we need to call clear_page_dirty_for_io on each @@ -645,7 +645,7 @@ cont: /* flag the file so we don't compress in the future */ if (!btrfs_test_opt(fs_info, FORCE_COMPRESS) && - !(BTRFS_I(inode)->force_compress)) { + !(BTRFS_I(inode)->prop_compress)) { BTRFS_I(inode)->flags |= BTRFS_INODE_NOCOMPRESS; } } @@ -9433,7 +9433,7 @@ struct inode *btrfs_alloc_inode(struct super_block *sb) ei->reserved_extents = 0; ei->runtime_flags = 0; - ei->force_compress = BTRFS_COMPRESS_NONE; + ei->prop_compress = BTRFS_COMPRESS_NONE; ei->delayed_node = NULL; |