Skip to content

Commit

Permalink
btrfs: S_ISREG(mode) is not mode & S_IFREG...
Browse files Browse the repository at this point in the history
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
  • Loading branch information
Al Viro committed Jul 26, 2011
1 parent 4b2a2c6 commit 569254b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions fs/btrfs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -4467,7 +4467,7 @@ static struct inode *btrfs_new_inode(struct btrfs_trans_handle *trans,
inode->i_generation = BTRFS_I(inode)->generation;
btrfs_set_inode_space_info(root, inode);

if (mode & S_IFDIR)
if (S_ISDIR(mode))
owner = 0;
else
owner = 1;
Expand Down Expand Up @@ -4512,7 +4512,7 @@ static struct inode *btrfs_new_inode(struct btrfs_trans_handle *trans,

btrfs_inherit_iflags(inode, dir);

if ((mode & S_IFREG)) {
if (S_ISREG(mode)) {
if (btrfs_test_opt(root, NODATASUM))
BTRFS_I(inode)->flags |= BTRFS_INODE_NODATASUM;
if (btrfs_test_opt(root, NODATACOW) ||
Expand Down

0 comments on commit 569254b

Please sign in to comment.