unsigned reserved_extents;
/*
- * always compress this one file
+ * Cached values of inode properties
*/
- unsigned force_compress;
+ unsigned prop_compress; /* per-file compression algorithm */
struct btrfs_delayed_node *delayed_node;
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;
}
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
/* 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;
}
}
ei->reserved_extents = 0;
ei->runtime_flags = 0;
- ei->force_compress = BTRFS_COMPRESS_NONE;
+ ei->prop_compress = BTRFS_COMPRESS_NONE;
ei->delayed_node = NULL;
inode_lock(inode);
if (range->flags & BTRFS_DEFRAG_RANGE_COMPRESS)
- BTRFS_I(inode)->force_compress = compress_type;
+ BTRFS_I(inode)->prop_compress = compress_type;
ret = cluster_pages_for_defrag(inode, pages, i, cluster);
if (ret < 0) {
inode_unlock(inode);
out_ra:
if (range->flags & BTRFS_DEFRAG_RANGE_COMPRESS) {
inode_lock(inode);
- BTRFS_I(inode)->force_compress = BTRFS_COMPRESS_NONE;
+ BTRFS_I(inode)->prop_compress = BTRFS_COMPRESS_NONE;
inode_unlock(inode);
}
if (!file)
if (len == 0) {
BTRFS_I(inode)->flags |= BTRFS_INODE_NOCOMPRESS;
BTRFS_I(inode)->flags &= ~BTRFS_INODE_COMPRESS;
- BTRFS_I(inode)->force_compress = BTRFS_COMPRESS_NONE;
+ BTRFS_I(inode)->prop_compress = BTRFS_COMPRESS_NONE;
return 0;
}
BTRFS_I(inode)->flags &= ~BTRFS_INODE_NOCOMPRESS;
BTRFS_I(inode)->flags |= BTRFS_INODE_COMPRESS;
- BTRFS_I(inode)->force_compress = type;
+ BTRFS_I(inode)->prop_compress = type;
return 0;
}
static const char *prop_compression_extract(struct inode *inode)
{
- switch (BTRFS_I(inode)->force_compress) {
+ switch (BTRFS_I(inode)->prop_compress) {
case BTRFS_COMPRESS_ZLIB:
return "zlib";
case BTRFS_COMPRESS_LZO: