summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorChris Dunlop <[email protected]>2016-07-15 00:44:38 +1000
committerBrian Behlendorf <[email protected]>2016-07-14 16:25:34 -0700
commitdfbc86309fd8ebb70a55cafa876320dc1ea8e833 (patch)
tree32c1b694d9d6b6bd89db7b3041cd459bc4e44541 /include
parent02de3e3c5d54bd545b34cccfd35ace80edd1f864 (diff)
Use native inode->i_nlink instead of znode->z_links
A mostly mechanical change, taking into account i_nlink is 32 bits vs ZFS's 64 bit on-disk link count. We revert "xattr dir doesn't get purged during iput" (ddae16a) as this is a more Linux-integrated fix for the same issue. In addition, setting the initial link count on a new node has been changed from setting one less than required in zfs_mknode() then incrementing to the correct count in zfs_link_create() (which was somewhat bizarre in the first place), to setting the correct count in zfs_mknode() and not incrementing it in zfs_link_create(). This both means we no longer set the link count in sa_bulk_update() twice (once for the initial incorrect count then again for the correct count), as well as adhering to the Linux requirement of not incrementing a zero link count without I_LINKABLE (see linux commit f4e0c30c). Signed-off-by: Chris Dunlop <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Signed-off-by: Chunwei Chen <[email protected]> Closes #4838 Issue #227
Diffstat (limited to 'include')
-rw-r--r--include/sys/trace_acl.h6
-rw-r--r--include/sys/zfs_znode.h1
2 files changed, 2 insertions, 5 deletions
diff --git a/include/sys/trace_acl.h b/include/sys/trace_acl.h
index f1d8eb78c..db4334951 100644
--- a/include/sys/trace_acl.h
+++ b/include/sys/trace_acl.h
@@ -55,7 +55,6 @@ DECLARE_EVENT_CLASS(zfs_ace_class,
__field(uint_t, z_seq)
__field(uint64_t, z_mapcnt)
__field(uint64_t, z_size)
- __field(uint64_t, z_links)
__field(uint64_t, z_pflags)
__field(uint64_t, z_uid)
__field(uint64_t, z_gid)
@@ -91,7 +90,6 @@ DECLARE_EVENT_CLASS(zfs_ace_class,
__entry->z_seq = zn->z_seq;
__entry->z_mapcnt = zn->z_mapcnt;
__entry->z_size = zn->z_size;
- __entry->z_links = zn->z_links;
__entry->z_pflags = zn->z_pflags;
__entry->z_uid = zn->z_uid;
__entry->z_gid = zn->z_gid;
@@ -119,7 +117,7 @@ DECLARE_EVENT_CLASS(zfs_ace_class,
),
TP_printk("zn { id %llu unlinked %u atime_dirty %u "
"zn_prefetch %u moved %u blksz %u seq %u "
- "mapcnt %llu size %llu links %llu pflags %llu "
+ "mapcnt %llu size %llu pflags %llu "
"uid %llu gid %llu sync_cnt %u mode 0x%x is_sa %d "
"is_mapped %d is_ctldir %d is_stale %d inode { "
"ino %lu nlink %u version %llu size %lli blkbits %u "
@@ -128,7 +126,7 @@ DECLARE_EVENT_CLASS(zfs_ace_class,
__entry->z_id, __entry->z_unlinked, __entry->z_atime_dirty,
__entry->z_zn_prefetch, __entry->z_moved, __entry->z_blksz,
__entry->z_seq, __entry->z_mapcnt, __entry->z_size,
- __entry->z_links, __entry->z_pflags, __entry->z_uid,
+ __entry->z_pflags, __entry->z_uid,
__entry->z_gid, __entry->z_sync_cnt, __entry->z_mode,
__entry->z_is_sa, __entry->z_is_mapped,
__entry->z_is_ctldir, __entry->z_is_stale, __entry->i_ino,
diff --git a/include/sys/zfs_znode.h b/include/sys/zfs_znode.h
index 661628698..bf03c1530 100644
--- a/include/sys/zfs_znode.h
+++ b/include/sys/zfs_znode.h
@@ -187,7 +187,6 @@ typedef struct znode {
uint64_t z_mapcnt; /* number of pages mapped to file */
uint64_t z_dnodesize; /* dnode size */
uint64_t z_size; /* file size (cached) */
- uint64_t z_links; /* file links (cached) */
uint64_t z_pflags; /* pflags (cached) */
uint64_t z_uid; /* uid fuid (cached) */
uint64_t z_gid; /* gid fuid (cached) */