mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 02:27:36 +03:00
linux/super: add tunable to request immediate reclaim of unused dentries
Traditionally, unused dentries would be cached in the dentry cache until the associated entry is no longer on disk. The cached dentry continues to hold an inode reference, causing the inode to be pinned (see previous commit). Here we implement the dentry op d_delete, which is roughly analogous to the drop_inode superblock op, and add a zfs_delete_dentry tunable to control its behaviour. By default it continues the traditional behaviour, but when the tunable is enabled, we signal that an unused dentry should be freed immediately, releasing its inode reference, and so allowing that inode to be deleted if no longer in use. Sponsored-by: Klara, Inc. Sponsored-by: Fastmail Pty Ltd Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: Alexander Motin <alexander.motin@TrueNAS.com> Signed-off-by: Rob Norris <rob.norris@klarasystems.com> Closes #17746
This commit is contained in:
committed by
Brian Behlendorf
parent
ab93b4b70e
commit
ab8cc63c77
@@ -46,12 +46,37 @@ AC_DEFUN([ZFS_AC_KERNEL_D_SET_D_OP], [
|
||||
])
|
||||
])
|
||||
|
||||
dnl #
|
||||
dnl # 6.17 API change
|
||||
dnl # sb->s_d_op removed; set_default_d_op(sb, dop) added
|
||||
dnl #
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_SET_DEFAULT_D_OP], [
|
||||
ZFS_LINUX_TEST_SRC([set_default_d_op], [
|
||||
#include <linux/dcache.h>
|
||||
], [
|
||||
set_default_d_op(NULL, NULL);
|
||||
])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SET_DEFAULT_D_OP], [
|
||||
AC_MSG_CHECKING([whether set_default_d_op() is available])
|
||||
ZFS_LINUX_TEST_RESULT([set_default_d_op], [
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HAVE_SET_DEFAULT_D_OP, 1,
|
||||
[Define if set_default_d_op() is available])
|
||||
], [
|
||||
AC_MSG_RESULT(no)
|
||||
])
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_SRC_DENTRY], [
|
||||
ZFS_AC_KERNEL_SRC_D_OBTAIN_ALIAS
|
||||
ZFS_AC_KERNEL_SRC_D_SET_D_OP
|
||||
ZFS_AC_KERNEL_SRC_SET_DEFAULT_D_OP
|
||||
])
|
||||
|
||||
AC_DEFUN([ZFS_AC_KERNEL_DENTRY], [
|
||||
ZFS_AC_KERNEL_D_OBTAIN_ALIAS
|
||||
ZFS_AC_KERNEL_D_SET_D_OP
|
||||
ZFS_AC_KERNEL_SET_DEFAULT_D_OP
|
||||
])
|
||||
|
||||
Reference in New Issue
Block a user