]> git.ipfire.org Git - thirdparty/linux.git/commit - fs/btrfs/ioctl.c
btrfs: separate defrag and property compression
authorDavid Sterba <dsterba@suse.com>
Mon, 17 Jul 2017 17:41:31 +0000 (19:41 +0200)
committerDavid Sterba <dsterba@suse.com>
Wed, 16 Aug 2017 14:12:05 +0000 (16:12 +0200)
commiteec63c65dcbeb14b59c95159eb225b1fc2310806
treef2c54de48515e48eea07a5ccd0ead6c990fe3a8f
parentb52aa8c93e1fec97fcd87345b13f532f0dee8239
btrfs: separate defrag and property compression

Add new value for compression to distinguish between defrag and
property. Previously, a single variable was used and this caused clashes
when the per-file 'compression' was set and a defrag -c was called.

The property-compression is loaded when the file is open, defrag will
overwrite the same variable and reset to 0 (ie. NONE) at when the file
defragmentaion is finished. That's considered a usability bug.

Now we won't touch the property value, use the defrag-compression. The
precedence of defrag is higher than for property (and whole-filesystem).

Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/btrfs_inode.h
fs/btrfs/inode.c
fs/btrfs/ioctl.c