btrfs: remove unnecessary inode_set_bytes(0) call
authorOmar Sandoval <osandov@fb.com>
Thu, 10 Mar 2022 01:31:36 +0000 (17:31 -0800)
committerDavid Sterba <dsterba@suse.com>
Mon, 16 May 2022 15:03:06 +0000 (17:03 +0200)
new_inode() always returns an inode with i_blocks and i_bytes set to 0
(via inode_init_always()). Remove the unnecessary call to
inode_set_bytes() in btrfs_new_inode().

Reviewed-by: Sweet Tea Dorminy <sweettea-kernel@dorminy.me>
Signed-off-by: Omar Sandoval <osandov@fb.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/inode.c

index b5059b1..c3d0529 100644 (file)
@@ -6202,7 +6202,6 @@ static struct inode *btrfs_new_inode(struct btrfs_trans_handle *trans,
                goto fail_unlock;
 
        inode_init_owner(mnt_userns, inode, dir, mode);
-       inode_set_bytes(inode, 0);
 
        inode->i_mtime = current_time(inode);
        inode->i_atime = inode->i_mtime;