diff options
author | kib <kib@FreeBSD.org> | 2012-05-30 16:06:38 +0000 |
---|---|---|
committer | kib <kib@FreeBSD.org> | 2012-05-30 16:06:38 +0000 |
commit | 6f4e16f8338923e9fd89009ec9cb4a5a3d770983 (patch) | |
tree | 4caf91c8f8e723003a46c63db3286a9280250541 /sys/kern/vfs_subr.c | |
parent | b4b050eda28e90a7c843fa7fa999ce50dd3c3872 (diff) | |
download | FreeBSD-src-6f4e16f8338923e9fd89009ec9cb4a5a3d770983.zip FreeBSD-src-6f4e16f8338923e9fd89009ec9cb4a5a3d770983.tar.gz |
Add a rangelock implementation, intended to be used to range-locking
the i/o regions of the vnode data space. The implementation is quite
simple-minded, it uses the list of the lock requests, ordered by
arrival time. Each request may be for read or for write. The
implementation is fair FIFO.
MFC after: 2 month
Diffstat (limited to 'sys/kern/vfs_subr.c')
-rw-r--r-- | sys/kern/vfs_subr.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c index a06ba31..8d999c3 100644 --- a/sys/kern/vfs_subr.c +++ b/sys/kern/vfs_subr.c @@ -1027,6 +1027,7 @@ alloc: if ((mp->mnt_kern_flag & MNTK_NOKNOTE) != 0) vp->v_vflag |= VV_NOKNOTE; } + rangelock_init(&vp->v_rl); *vpp = vp; return (0); @@ -2468,6 +2469,7 @@ vdropl(struct vnode *vp) /* XXX Elsewhere we detect an already freed vnode via NULL v_op. */ vp->v_op = NULL; #endif + rangelock_destroy(&vp->v_rl); lockdestroy(vp->v_vnlock); mtx_destroy(&vp->v_interlock); mtx_destroy(BO_MTX(bo)); |