diff options
| author | Eivind Eklund <eivind@FreeBSD.org> | 1999-04-10 17:54:43 +0000 |
|---|---|---|
| committer | Eivind Eklund <eivind@FreeBSD.org> | 1999-04-10 17:54:43 +0000 |
| commit | c523e8b21d678b03751a8e1f4b4afcc9f631c0d0 (patch) | |
| tree | 649bd2363c697a5abbac87a0b2f4b4bd11229888 /sys | |
| parent | 377912b60422cd20b9e608f335506af9e55aefcd (diff) | |
Notes
Diffstat (limited to 'sys')
| -rw-r--r-- | sys/vm/vm_swap.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/sys/vm/vm_swap.c b/sys/vm/vm_swap.c index 8856332d4f792..1280eac6af598 100644 --- a/sys/vm/vm_swap.c +++ b/sys/vm/vm_swap.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)vm_swap.c 8.5 (Berkeley) 2/17/94 - * $Id: vm_swap.c,v 1.59 1999/01/21 10:17:12 dillon Exp $ + * $Id: vm_swap.c,v 1.60 1999/02/25 05:37:18 dillon Exp $ */ #include "opt_devfs.h" @@ -52,6 +52,7 @@ #include <sys/fcntl.h> #include <sys/blist.h> #include <sys/kernel.h> +#include <sys/lock.h> #include <vm/vm.h> #include <vm/vm_extern.h> #include <vm/swap_pager.h> @@ -278,6 +279,7 @@ swaponvp(p, vp, dev, nblks) swblk_t dvbase; int error; + ASSERT_VOP_UNLOCKED(vp, "swaponvp"); for (sp = swdevt, index = 0 ; index < nswdev; index++, sp++) { if (sp->sw_vp == vp) return EBUSY; @@ -287,7 +289,9 @@ swaponvp(p, vp, dev, nblks) } return EINVAL; found: + (void) vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, p); error = VOP_OPEN(vp, FREAD | FWRITE, p->p_ucred, p); + (void) VOP_UNLOCK(vp, 0, p); if (error) return (error); |
