aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorMatthew Macy <[email protected]>2019-10-02 09:15:12 -0700
committerBrian Behlendorf <[email protected]>2019-10-02 09:15:12 -0700
commit6360e2779e47f4bf2233071b427ad522eca9bdd4 (patch)
tree2b60eb443d5893b4a281df72658ecc8bc2030e14 /include
parent13a4027a7cd68069cb252e94c18ba1e5eb5af1cd (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 'include')
-rw-r--r--include/sys/zfs_znode.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/include/sys/zfs_znode.h b/include/sys/zfs_znode.h
index acaaf2884..4eb1da650 100644
--- a/include/sys/zfs_znode.h
+++ b/include/sys/zfs_znode.h
@@ -258,7 +258,15 @@ zfs_inherit_projid(znode_t *dzp)
#define ZTOZSB(znode) ((zfsvfs_t *)(ZTOI(znode)->i_sb->s_fs_info))
#define ITOZSB(inode) ((zfsvfs_t *)((inode)->i_sb->s_fs_info))
-#define S_ISDEV(mode) (S_ISCHR(mode) || S_ISBLK(mode) || S_ISFIFO(mode))
+#define ZTOTYPE(zp) (ZTOI(zp)->i_mode)
+#define ZTOGID(zp) (ZTOI(zp)->i_gid)
+#define ZTOUID(zp) (ZTOI(zp)->i_uid)
+#define ZTONLNK(zp) (ZTOI(zp)->i_nlink)
+
+#define Z_ISBLK(type) S_ISBLK(type)
+#define Z_ISCHR(type) S_ISCHR(type)
+#define Z_ISLNK(type) S_ISLNK(type)
+#define S_ISDEV(type) (S_ISCHR(type) || S_ISBLK(type) || S_ISFIFO(type))
/* Called on entry to each ZFS inode and vfs operation. */
#define ZFS_ENTER_ERROR(zfsvfs, error) \