diff options
Diffstat (limited to 'fs/btrfs/inode.c')
-rw-r--r-- | fs/btrfs/inode.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index 1eacc78f6614..a48c084f6d3a 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c | |||
@@ -3587,12 +3587,6 @@ static struct inode *btrfs_new_inode(struct btrfs_trans_handle *trans, | |||
3587 | owner = 1; | 3587 | owner = 1; |
3588 | BTRFS_I(inode)->block_group = | 3588 | BTRFS_I(inode)->block_group = |
3589 | btrfs_find_block_group(root, 0, alloc_hint, owner); | 3589 | btrfs_find_block_group(root, 0, alloc_hint, owner); |
3590 | if ((mode & S_IFREG)) { | ||
3591 | if (btrfs_test_opt(root, NODATASUM)) | ||
3592 | BTRFS_I(inode)->flags |= BTRFS_INODE_NODATASUM; | ||
3593 | if (btrfs_test_opt(root, NODATACOW)) | ||
3594 | BTRFS_I(inode)->flags |= BTRFS_INODE_NODATACOW; | ||
3595 | } | ||
3596 | 3590 | ||
3597 | key[0].objectid = objectid; | 3591 | key[0].objectid = objectid; |
3598 | btrfs_set_key_type(&key[0], BTRFS_INODE_ITEM_KEY); | 3592 | btrfs_set_key_type(&key[0], BTRFS_INODE_ITEM_KEY); |
@@ -3647,6 +3641,13 @@ static struct inode *btrfs_new_inode(struct btrfs_trans_handle *trans, | |||
3647 | 3641 | ||
3648 | btrfs_inherit_iflags(inode, dir); | 3642 | btrfs_inherit_iflags(inode, dir); |
3649 | 3643 | ||
3644 | if ((mode & S_IFREG)) { | ||
3645 | if (btrfs_test_opt(root, NODATASUM)) | ||
3646 | BTRFS_I(inode)->flags |= BTRFS_INODE_NODATASUM; | ||
3647 | if (btrfs_test_opt(root, NODATACOW)) | ||
3648 | BTRFS_I(inode)->flags |= BTRFS_INODE_NODATACOW; | ||
3649 | } | ||
3650 | |||
3650 | insert_inode_hash(inode); | 3651 | insert_inode_hash(inode); |
3651 | inode_tree_add(inode); | 3652 | inode_tree_add(inode); |
3652 | return inode; | 3653 | return inode; |