diff options
author | Matthew Macy <[email protected]> | 2019-10-02 09:15:12 -0700 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2019-10-02 09:15:12 -0700 |
commit | 6360e2779e47f4bf2233071b427ad522eca9bdd4 (patch) | |
tree | 2b60eb443d5893b4a281df72658ecc8bc2030e14 /module | |
parent | 13a4027a7cd68069cb252e94c18ba1e5eb5af1cd (diff) |
Add inode accessors to common code
Reviewed-by: Brian Behlendorf <[email protected]>
Reviewed-by: Jorgen Lundman <[email protected]>
Signed-off-by: Matt Macy <[email protected]>
Closes #9389
Diffstat (limited to 'module')
-rw-r--r-- | module/zfs/sa.c | 6 | ||||
-rw-r--r-- | module/zfs/zfs_fuid.c | 4 | ||||
-rw-r--r-- | module/zfs/zfs_log.c | 12 | ||||
-rw-r--r-- | module/zfs/zfs_sa.c | 6 |
4 files changed, 14 insertions, 14 deletions
diff --git a/module/zfs/sa.c b/module/zfs/sa.c index 621838396..98bd2d330 100644 --- a/module/zfs/sa.c +++ b/module/zfs/sa.c @@ -1586,7 +1586,7 @@ sa_add_projid(sa_handle_t *hdl, dmu_tx_t *tx, uint64_t projid) &ctime, 16); SA_ADD_BULK_ATTR(bulk, count, SA_ZPL_CRTIME(zfsvfs), NULL, &crtime, 16); - if (S_ISBLK(ZTOI(zp)->i_mode) || S_ISCHR(ZTOI(zp)->i_mode)) + if (Z_ISBLK(ZTOTYPE(zp)) || Z_ISCHR(ZTOTYPE(zp))) SA_ADD_BULK_ATTR(bulk, count, SA_ZPL_RDEV(zfsvfs), NULL, &rdev, 8); } else { @@ -1625,7 +1625,7 @@ sa_add_projid(sa_handle_t *hdl, dmu_tx_t *tx, uint64_t projid) zp->z_projid = projid; zp->z_pflags |= ZFS_PROJID; - links = ZTOI(zp)->i_nlink; + links = ZTONLNK(zp); count = 0; err = 0; @@ -1646,7 +1646,7 @@ sa_add_projid(sa_handle_t *hdl, dmu_tx_t *tx, uint64_t projid) SA_ADD_BULK_ATTR(attrs, count, SA_ZPL_LINKS(zfsvfs), NULL, &links, 8); SA_ADD_BULK_ATTR(attrs, count, SA_ZPL_PROJID(zfsvfs), NULL, &projid, 8); - if (S_ISBLK(ZTOI(zp)->i_mode) || S_ISCHR(ZTOI(zp)->i_mode)) + if (Z_ISBLK(ZTOTYPE(zp)) || Z_ISCHR(ZTOTYPE(zp))) SA_ADD_BULK_ATTR(attrs, count, SA_ZPL_RDEV(zfsvfs), NULL, &rdev, 8); diff --git a/module/zfs/zfs_fuid.c b/module/zfs/zfs_fuid.c index e57753593..78071707a 100644 --- a/module/zfs/zfs_fuid.c +++ b/module/zfs/zfs_fuid.c @@ -382,9 +382,9 @@ zfs_fuid_find_by_idx(zfsvfs_t *zfsvfs, uint32_t idx) void zfs_fuid_map_ids(znode_t *zp, cred_t *cr, uid_t *uidp, uid_t *gidp) { - *uidp = zfs_fuid_map_id(ZTOZSB(zp), KUID_TO_SUID(ZTOI(zp)->i_uid), + *uidp = zfs_fuid_map_id(ZTOZSB(zp), KUID_TO_SUID(ZTOUID(zp)), cr, ZFS_OWNER); - *gidp = zfs_fuid_map_id(ZTOZSB(zp), KGID_TO_SGID(ZTOI(zp)->i_gid), + *gidp = zfs_fuid_map_id(ZTOZSB(zp), KGID_TO_SGID(ZTOGID(zp)), cr, ZFS_GROUP); } diff --git a/module/zfs/zfs_log.c b/module/zfs/zfs_log.c index ae4cbdec1..8b7c594f8 100644 --- a/module/zfs/zfs_log.c +++ b/module/zfs/zfs_log.c @@ -322,13 +322,13 @@ zfs_log_create(zilog_t *zilog, dmu_tx_t *tx, uint64_t txtype, /* Store dnode slot count in 8 bits above object id. */ LR_FOID_SET_SLOTS(lr->lr_foid, zp->z_dnodesize >> DNODE_SHIFT); lr->lr_mode = zp->z_mode; - if (!IS_EPHEMERAL(KUID_TO_SUID(ZTOI(zp)->i_uid))) { - lr->lr_uid = (uint64_t)KUID_TO_SUID(ZTOI(zp)->i_uid); + if (!IS_EPHEMERAL(KUID_TO_SUID(ZTOUID(zp)))) { + lr->lr_uid = (uint64_t)KUID_TO_SUID(ZTOUID(zp)); } else { lr->lr_uid = fuidp->z_fuid_owner; } - if (!IS_EPHEMERAL(KGID_TO_SGID(ZTOI(zp)->i_gid))) { - lr->lr_gid = (uint64_t)KGID_TO_SGID(ZTOI(zp)->i_gid); + if (!IS_EPHEMERAL(KGID_TO_SGID(ZTOGID(zp)))) { + lr->lr_gid = (uint64_t)KGID_TO_SGID(ZTOGID(zp)); } else { lr->lr_gid = fuidp->z_fuid_group; } @@ -460,8 +460,8 @@ zfs_log_symlink(zilog_t *zilog, dmu_tx_t *tx, uint64_t txtype, lr = (lr_create_t *)&itx->itx_lr; lr->lr_doid = dzp->z_id; lr->lr_foid = zp->z_id; - lr->lr_uid = KUID_TO_SUID(ZTOI(zp)->i_uid); - lr->lr_gid = KGID_TO_SGID(ZTOI(zp)->i_gid); + lr->lr_uid = KUID_TO_SUID(ZTOUID(zp)); + lr->lr_gid = KGID_TO_SGID(ZTOGID(zp)); lr->lr_mode = zp->z_mode; (void) sa_lookup(zp->z_sa_hdl, SA_ZPL_GEN(ZTOZSB(zp)), &lr->lr_gen, sizeof (uint64_t)); diff --git a/module/zfs/zfs_sa.c b/module/zfs/zfs_sa.c index bd21ba896..e20e92f12 100644 --- a/module/zfs/zfs_sa.c +++ b/module/zfs/zfs_sa.c @@ -300,7 +300,7 @@ zfs_sa_upgrade(sa_handle_t *hdl, dmu_tx_t *tx) * and ready the ACL would require special "locked" * interfaces that would be messy */ - if (zp->z_acl_cached == NULL || S_ISLNK(ZTOI(zp)->i_mode)) + if (zp->z_acl_cached == NULL || Z_ISLNK(ZTOTYPE(zp))) return; /* @@ -369,13 +369,13 @@ zfs_sa_upgrade(sa_handle_t *hdl, dmu_tx_t *tx) &ctime, 16); SA_ADD_BULK_ATTR(sa_attrs, count, SA_ZPL_CRTIME(zfsvfs), NULL, &crtime, 16); - links = ZTOI(zp)->i_nlink; + links = ZTONLNK(zp); SA_ADD_BULK_ATTR(sa_attrs, count, SA_ZPL_LINKS(zfsvfs), NULL, &links, 8); if (dmu_objset_projectquota_enabled(hdl->sa_os)) SA_ADD_BULK_ATTR(sa_attrs, count, SA_ZPL_PROJID(zfsvfs), NULL, &zp->z_projid, 8); - if (S_ISBLK(ZTOI(zp)->i_mode) || S_ISCHR(ZTOI(zp)->i_mode)) + if (Z_ISBLK(ZTOTYPE(zp)) || Z_ISCHR(ZTOTYPE(zp))) SA_ADD_BULK_ATTR(sa_attrs, count, SA_ZPL_RDEV(zfsvfs), NULL, &rdev, 8); SA_ADD_BULK_ATTR(sa_attrs, count, SA_ZPL_DACL_COUNT(zfsvfs), NULL, |