Skip to content

Commit

Permalink
Move assignment of i_blkbits field
Browse files Browse the repository at this point in the history
Currently i_blkbits is always set to SPA_MINBLOCKSHIFT every time
zfs_inode_update_impl is called. Since this value never changes
move its assignment to at inode creation time.

Signed-off-by: Nikolay Borisov <[email protected]>
Signed-off-by: Brian Behlendorf <[email protected]>
Closes #4906
  • Loading branch information
Nikolay Borisov authored and behlendorf committed Jul 29, 2016
1 parent e334e82 commit ba2fe6a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion module/zfs/zfs_znode.c
Original file line number Diff line number Diff line change
Expand Up @@ -535,7 +535,6 @@ zfs_inode_update_impl(znode_t *zp, boolean_t new)
spin_lock(&ip->i_lock);
ip->i_mode = zp->z_mode;
zfs_set_inode_flags(zp, ip);
ip->i_blkbits = SPA_MINBLOCKSHIFT;
ip->i_blocks = i_blocks;

/*
Expand Down Expand Up @@ -634,6 +633,7 @@ zfs_znode_alloc(zfs_sb_t *zsb, dmu_buf_t *db, int blksz,

zp->z_mode = mode;
ip->i_generation = (uint32_t)tmp_gen;
ip->i_blkbits = SPA_MINBLOCKSHIFT;
set_nlink(ip, (uint32_t)links);
zfs_uid_write(ip, z_uid);
zfs_gid_write(ip, z_gid);
Expand Down

0 comments on commit ba2fe6a

Please sign in to comment.