From ab4fdc728feda5c56a632b3bcd6381c946947b30 Mon Sep 17 00:00:00 2001 From: Nikolay Borisov Date: Fri, 29 Jul 2016 20:02:59 +0300 Subject: [PATCH] Move assignment of i_blkbits field Currently i_blkbits is always set to SPA_MINBLOCKSHIFT everytime zfs_inode_update_impl is called. Since this value never changes move its assignment at inode creation time. --- module/zfs/zfs_znode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/zfs/zfs_znode.c b/module/zfs/zfs_znode.c index b43b576e88a2..74502935c4e9 100644 --- a/module/zfs/zfs_znode.c +++ b/module/zfs/zfs_znode.c @@ -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; /* @@ -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);