mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2024-12-25 02:49:32 +03:00
278bee9319
Re-factor the .zfs/snapshot auto-mouting code to take in to account changes made to the upstream kernels. And to lay the groundwork for enabling access to .zfs snapshots via NFS clients. This patch makes the following core improvements. * All actively auto-mounted snapshots are now tracked in two global trees which are indexed by snapshot name and objset id respectively. This allows for fast lookups of any auto-mounted snapshot regardless without needing access to the parent dataset. * Snapshot entries are added to the tree in zfsctl_snapshot_mount(). However, they are now removed from the tree in the context of the unmount process. This eliminates the need complicated error logic in zfsctl_snapshot_unmount() to handle unmount failures. * References are now taken on the snapshot entries in the tree to ensure they always remain valid while a task is outstanding. * The MNT_SHRINKABLE flag is set on the snapshot vfsmount_t right after the auto-mount succeeds. This allows to kernel to unmount idle auto-mounted snapshots if needed removing the need for the zfsctl_unmount_snapshots() function. * Snapshots in active use will not be automatically unmounted. As long as at least one dentry is revalidated every zfs_expire_snapshot/2 seconds the auto-unmount expiration timer will be extended. * Commit torvalds/linux@bafc9b7 caused snapshots auto-mounted by ZFS to be immediately unmounted when the dentry was revalidated. This was a consequence of ZFS invaliding all snapdir dentries to ensure that negative dentries didn't mask new snapshots. This patch modifies the behavior such that only negative dentries are invalidated. This solves the issue and may result in a performance improvement. Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov> Closes #3589 Closes #3344 Closes #3295 Closes #3257 Closes #3243 Closes #3030 Closes #2841
21 lines
518 B
Plaintext
21 lines
518 B
Plaintext
dnl #
|
|
dnl # 2.6.38 API change
|
|
dnl # follow_down() renamed follow_down_one(). The original follow_down()
|
|
dnl # symbol still exists but will traverse down all the layers.
|
|
dnl #
|
|
AC_DEFUN([ZFS_AC_KERNEL_FOLLOW_DOWN_ONE], [
|
|
AC_MSG_CHECKING([whether follow_down_one() is available])
|
|
ZFS_LINUX_TRY_COMPILE([
|
|
#include <linux/namei.h>
|
|
],[
|
|
struct path *p = NULL;
|
|
follow_down_one(p);
|
|
],[
|
|
AC_MSG_RESULT(yes)
|
|
AC_DEFINE(HAVE_FOLLOW_DOWN_ONE, 1,
|
|
[follow_down_one() is available])
|
|
],[
|
|
AC_MSG_RESULT(no)
|
|
])
|
|
])
|