aboutsummaryrefslogtreecommitdiff
path: root/module/os
diff options
context:
space:
mode:
authorRyan Moeller <ryan@iXsystems.com>2021-04-30 23:39:07 +0000
committerGitHub <noreply@github.com>2021-04-30 23:39:07 +0000
commitc903a756ac5ff151b99080f60eead22fc6302f0f (patch)
tree8cf2931fd54bc6b1467ab960a6de6cee749d9cf1 /module/os
parente4efb7095093be70acd8f347e384c803ec2e0886 (diff)
downloadsrc-c903a756ac5ff151b99080f60eead22fc6302f0f.tar.gz
src-c903a756ac5ff151b99080f60eead22fc6302f0f.zip
Miscellaneous code cleanup
Remove some extra whitespace. Use pointer-typed asserts in Linux's znode cache destructor for more info when debugging. Simplify a couple of conversions from inode to znode when we already have the znode. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Ryan Moeller <ryan@iXsystems.com> Closes #11974
Diffstat (limited to 'module/os')
-rw-r--r--module/os/freebsd/zfs/zfs_znode.c4
-rw-r--r--module/os/linux/zfs/zfs_znode.c6
-rw-r--r--module/os/linux/zfs/zpl_xattr.c4
3 files changed, 5 insertions, 9 deletions
diff --git a/module/os/freebsd/zfs/zfs_znode.c b/module/os/freebsd/zfs/zfs_znode.c
index 4a98bcee8fc3..f99cbaee6766 100644
--- a/module/os/freebsd/zfs/zfs_znode.c
+++ b/module/os/freebsd/zfs/zfs_znode.c
@@ -175,14 +175,12 @@ static int
zfs_znode_cache_constructor_smr(void *mem, int size __unused, void *private,
int flags)
{
-
return (zfs_znode_cache_constructor(mem, private, flags));
}
static void
zfs_znode_cache_destructor_smr(void *mem, int size __unused, void *private)
{
-
zfs_znode_cache_destructor(mem, private);
}
@@ -202,7 +200,6 @@ zfs_znode_init(void)
static znode_t *
zfs_znode_alloc_kmem(int flags)
{
-
return (uma_zalloc_smr(znode_uma_zone, flags));
}
@@ -228,7 +225,6 @@ zfs_znode_init(void)
static znode_t *
zfs_znode_alloc_kmem(int flags)
{
-
return (kmem_cache_alloc(znode_cache, flags));
}
diff --git a/module/os/linux/zfs/zfs_znode.c b/module/os/linux/zfs/zfs_znode.c
index 4bfb26302b52..6015aea62dca 100644
--- a/module/os/linux/zfs/zfs_znode.c
+++ b/module/os/linux/zfs/zfs_znode.c
@@ -151,9 +151,9 @@ zfs_znode_cache_destructor(void *buf, void *arg)
rw_destroy(&zp->z_xattr_lock);
zfs_rangelock_fini(&zp->z_rangelock);
- ASSERT(zp->z_dirlocks == NULL);
- ASSERT(zp->z_acl_cached == NULL);
- ASSERT(zp->z_xattr_cached == NULL);
+ ASSERT3P(zp->z_dirlocks, ==, NULL);
+ ASSERT3P(zp->z_acl_cached, ==, NULL);
+ ASSERT3P(zp->z_xattr_cached, ==, NULL);
}
static int
diff --git a/module/os/linux/zfs/zpl_xattr.c b/module/os/linux/zfs/zpl_xattr.c
index 971cd6ad031e..9ab7859be968 100644
--- a/module/os/linux/zfs/zpl_xattr.c
+++ b/module/os/linux/zfs/zpl_xattr.c
@@ -605,7 +605,7 @@ zpl_xattr_set(struct inode *ip, const char *name, const void *value,
cookie = spl_fstrans_mark();
ZPL_ENTER(zfsvfs);
ZPL_VERIFY_ZP(zp);
- rw_enter(&ITOZ(ip)->z_xattr_lock, RW_WRITER);
+ rw_enter(&zp->z_xattr_lock, RW_WRITER);
/*
* Before setting the xattr check to see if it already exists.
@@ -656,7 +656,7 @@ zpl_xattr_set(struct inode *ip, const char *name, const void *value,
if (error == 0 && (where & XATTR_IN_SA))
zpl_xattr_set_sa(ip, name, NULL, 0, 0, cr);
out:
- rw_exit(&ITOZ(ip)->z_xattr_lock);
+ rw_exit(&zp->z_xattr_lock);
ZPL_EXIT(zfsvfs);
spl_fstrans_unmark(cookie);
crfree(cr);