aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/inode.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/btrfs/inode.c')
-rw-r--r--fs/btrfs/inode.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index 0612231aaeba..b166ee0763b6 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -376,12 +376,12 @@ static inline int inode_need_compress(struct inode *inode)
376 struct btrfs_root *root = BTRFS_I(inode)->root; 376 struct btrfs_root *root = BTRFS_I(inode)->root;
377 377
378 /* force compress */ 378 /* force compress */
379 if (btrfs_test_opt(root, FORCE_COMPRESS)) 379 if (btrfs_test_opt(root->fs_info, FORCE_COMPRESS))
380 return 1; 380 return 1;
381 /* bad compression ratios */ 381 /* bad compression ratios */
382 if (BTRFS_I(inode)->flags & BTRFS_INODE_NOCOMPRESS) 382 if (BTRFS_I(inode)->flags & BTRFS_INODE_NOCOMPRESS)
383 return 0; 383 return 0;
384 if (btrfs_test_opt(root, COMPRESS) || 384 if (btrfs_test_opt(root->fs_info, COMPRESS) ||
385 BTRFS_I(inode)->flags & BTRFS_INODE_COMPRESS || 385 BTRFS_I(inode)->flags & BTRFS_INODE_COMPRESS ||
386 BTRFS_I(inode)->force_compress) 386 BTRFS_I(inode)->force_compress)
387 return 1; 387 return 1;
@@ -622,7 +622,7 @@ cont:
622 nr_pages_ret = 0; 622 nr_pages_ret = 0;
623 623
624 /* flag the file so we don't compress in the future */ 624 /* flag the file so we don't compress in the future */
625 if (!btrfs_test_opt(root, FORCE_COMPRESS) && 625 if (!btrfs_test_opt(root->fs_info, FORCE_COMPRESS) &&
626 !(BTRFS_I(inode)->force_compress)) { 626 !(BTRFS_I(inode)->force_compress)) {
627 BTRFS_I(inode)->flags |= BTRFS_INODE_NOCOMPRESS; 627 BTRFS_I(inode)->flags |= BTRFS_INODE_NOCOMPRESS;
628 } 628 }
@@ -1159,7 +1159,7 @@ static int cow_file_range_async(struct inode *inode, struct page *locked_page,
1159 async_cow->start = start; 1159 async_cow->start = start;
1160 1160
1161 if (BTRFS_I(inode)->flags & BTRFS_INODE_NOCOMPRESS && 1161 if (BTRFS_I(inode)->flags & BTRFS_INODE_NOCOMPRESS &&
1162 !btrfs_test_opt(root, FORCE_COMPRESS)) 1162 !btrfs_test_opt(root->fs_info, FORCE_COMPRESS))
1163 cur_end = end; 1163 cur_end = end;
1164 else 1164 else
1165 cur_end = min(end, start + SZ_512K - 1); 1165 cur_end = min(end, start + SZ_512K - 1);
@@ -6255,9 +6255,9 @@ static struct inode *btrfs_new_inode(struct btrfs_trans_handle *trans,
6255 btrfs_inherit_iflags(inode, dir); 6255 btrfs_inherit_iflags(inode, dir);
6256 6256
6257 if (S_ISREG(mode)) { 6257 if (S_ISREG(mode)) {
6258 if (btrfs_test_opt(root, NODATASUM)) 6258 if (btrfs_test_opt(root->fs_info, NODATASUM))
6259 BTRFS_I(inode)->flags |= BTRFS_INODE_NODATASUM; 6259 BTRFS_I(inode)->flags |= BTRFS_INODE_NODATASUM;
6260 if (btrfs_test_opt(root, NODATACOW)) 6260 if (btrfs_test_opt(root->fs_info, NODATACOW))
6261 BTRFS_I(inode)->flags |= BTRFS_INODE_NODATACOW | 6261 BTRFS_I(inode)->flags |= BTRFS_INODE_NODATACOW |
6262 BTRFS_INODE_NODATASUM; 6262 BTRFS_INODE_NODATASUM;
6263 } 6263 }