aboutsummaryrefslogtreecommitdiff
path: root/sys/sys/mount.h
diff options
context:
space:
mode:
authorMateusz Guzik <mjg@FreeBSD.org>2019-10-06 22:14:32 +0000
committerMateusz Guzik <mjg@FreeBSD.org>2019-10-06 22:14:32 +0000
commitdc20b834ca29b80c2ea74172121542557af19ae9 (patch)
treea58a1b8c250ccc5d4dac024a0150432c1d3169e1 /sys/sys/mount.h
parent6114fc8b8555c83a7fd5a90ecb67e5aa3daae7c7 (diff)
downloadsrc-dc20b834ca29b80c2ea74172121542557af19ae9.tar.gz
src-dc20b834ca29b80c2ea74172121542557af19ae9.zip
vfs: add optional root vnode caching
Root vnodes looekd up all the time, e.g. when crossing a mount point. Currently used routines always perform a costly lookup which can be trivially avoided. Reviewed by: jeff (previous version), kib Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D21646
Notes
Notes: svn path=/head/; revision=353150
Diffstat (limited to 'sys/sys/mount.h')
-rw-r--r--sys/sys/mount.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/sys/sys/mount.h b/sys/sys/mount.h
index 4b60055ca6dd..e9cdd63e37fc 100644
--- a/sys/sys/mount.h
+++ b/sys/sys/mount.h
@@ -231,6 +231,7 @@ struct mount {
int *mnt_ref_pcpu;
int *mnt_lockref_pcpu;
int *mnt_writeopcount_pcpu;
+ struct vnode *mnt_rootvnode;
};
/*
@@ -702,6 +703,7 @@ struct vfsops {
vfs_cmount_t *vfs_cmount;
vfs_unmount_t *vfs_unmount;
vfs_root_t *vfs_root;
+ vfs_root_t *vfs_cachedroot;
vfs_quotactl_t *vfs_quotactl;
vfs_statfs_t *vfs_statfs;
vfs_sync_t *vfs_sync;
@@ -741,6 +743,12 @@ vfs_statfs_t __vfs_statfs;
_rc = (*(MP)->mnt_op->vfs_root)(MP, FLAGS, VPP); \
_rc; })
+#define VFS_CACHEDROOT(MP, FLAGS, VPP) ({ \
+ int _rc; \
+ \
+ _rc = (*(MP)->mnt_op->vfs_cachedroot)(MP, FLAGS, VPP); \
+ _rc; })
+
#define VFS_QUOTACTL(MP, C, U, A) ({ \
int _rc; \
\
@@ -950,6 +958,9 @@ vfs_sysctl_t vfs_stdsysctl;
void syncer_suspend(void);
void syncer_resume(void);
+struct vnode *vfs_cache_root_clear(struct mount *);
+void vfs_cache_root_set(struct mount *, struct vnode *);
+
void vfs_op_barrier_wait(struct mount *);
void vfs_op_enter(struct mount *);
void vfs_op_exit_locked(struct mount *);