mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-28 17:39:23 +03:00
FreeBSD: add support for lockless symlink lookup
Reviewed-by: Ryan Moeller <ryan@iXsystems.com> Signed-off-by: Mateusz Guzik <mjguzik@gmail.com> Closes #11883
This commit is contained in:
committed by
Brian Behlendorf
parent
ffc2e74f79
commit
4568b5cfba
@@ -444,6 +444,9 @@ zfs_znode_alloc(zfsvfs_t *zfsvfs, dmu_buf_t *db, int blksz,
|
||||
zp->z_blksz = blksz;
|
||||
zp->z_seq = 0x7A4653;
|
||||
zp->z_sync_cnt = 0;
|
||||
#if __FreeBSD_version >= 1300139
|
||||
atomic_store_ptr(&zp->z_cached_symlink, NULL);
|
||||
#endif
|
||||
|
||||
vp = ZTOV(zp);
|
||||
|
||||
@@ -1237,6 +1240,9 @@ void
|
||||
zfs_znode_free(znode_t *zp)
|
||||
{
|
||||
zfsvfs_t *zfsvfs = zp->z_zfsvfs;
|
||||
#if __FreeBSD_version >= 1300139
|
||||
char *symlink;
|
||||
#endif
|
||||
|
||||
ASSERT(zp->z_sa_hdl == NULL);
|
||||
zp->z_vnode = NULL;
|
||||
@@ -1246,6 +1252,15 @@ zfs_znode_free(znode_t *zp)
|
||||
zfsvfs->z_nr_znodes--;
|
||||
mutex_exit(&zfsvfs->z_znodes_lock);
|
||||
|
||||
#if __FreeBSD_version >= 1300139
|
||||
symlink = atomic_load_ptr(&zp->z_cached_symlink);
|
||||
if (symlink != NULL) {
|
||||
atomic_store_rel_ptr((uintptr_t *)&zp->z_cached_symlink,
|
||||
(uintptr_t)NULL);
|
||||
cache_symlink_free(symlink, strlen(symlink) + 1);
|
||||
}
|
||||
#endif
|
||||
|
||||
if (zp->z_acl_cached) {
|
||||
zfs_acl_free(zp->z_acl_cached);
|
||||
zp->z_acl_cached = NULL;
|
||||
|
||||
Reference in New Issue
Block a user