]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Use native inode->i_nlink instead of znode->z_links
authorChris Dunlop <chris@onthe.net.au>
Thu, 14 Jul 2016 14:44:38 +0000 (00:44 +1000)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Thu, 14 Jul 2016 23:25:34 +0000 (16:25 -0700)
commitdfbc86309fd8ebb70a55cafa876320dc1ea8e833
tree32c1b694d9d6b6bd89db7b3041cd459bc4e44541
parent02de3e3c5d54bd545b34cccfd35ace80edd1f864
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 <chris@onthe.net.au>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Chunwei Chen <david.chen@osnexus.com>
Closes #4838
Issue #227
include/sys/trace_acl.h
include/sys/zfs_znode.h
module/zfs/zfs_ctldir.c
module/zfs/zfs_dir.c
module/zfs/zfs_sa.c
module/zfs/zfs_vnops.c
module/zfs/zfs_znode.c