Skip to content

Commit

Permalink
Re-arrange z_blksz in zfs_znode_alloc()
Browse files Browse the repository at this point in the history
  • Loading branch information
lundman committed Nov 9, 2023
1 parent e8bb2a9 commit 106e765
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions module/os/macos/zfs/zfs_znode.c
Original file line number Diff line number Diff line change
Expand Up @@ -563,7 +563,13 @@ zfs_znode_alloc(zfsvfs_t *zfsvfs, dmu_buf_t *db, int blksz,
zp->z_atime_dirty = 0;
zp->z_mapcnt = 0;
zp->z_id = db->db_object;
zp->z_blksz = blksz;

/* Start from ashift instead of 512 */
if (zfsvfs->z_os->os_spa->spa_min_alloc > 0)
zp->z_blksz = zfsvfs->z_os->os_spa->spa_min_alloc;
else
zp->z_blksz = blksz;

zp->z_seq = 0x7A4653;
zp->z_sync_cnt = 0;

Expand Down Expand Up @@ -624,10 +630,6 @@ zfs_znode_alloc(zfsvfs_t *zfsvfs, dmu_buf_t *db, int blksz,
zp->z_zfsvfs = zfsvfs;
mutex_exit(&zfsvfs->z_znodes_lock);

/* This makes a large difference on 4096 block devices */
if (zfsvfs->z_os->os_spa->spa_min_alloc > zp->z_blksz)
zp->z_blksz = zfsvfs->z_os->os_spa->spa_min_alloc;

return (zp);
}

Expand Down

0 comments on commit 106e765

Please sign in to comment.