Relax the vnode locking for read only operations.
This commit is contained in:
parent
a96b1911b8
commit
df56983676
@ -36,7 +36,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)vfs_vnops.c 8.2 (Berkeley) 1/21/94
|
||||
* $Id: vfs_vnops.c,v 1.37 1997/09/02 20:06:04 bde Exp $
|
||||
* $Id: vfs_vnops.c,v 1.38 1997/09/14 02:51:16 peter Exp $
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
@ -275,7 +275,7 @@ vn_read(fp, uio, cred)
|
||||
int flag, seq;
|
||||
|
||||
VOP_LEASE(vp, p, cred, LEASE_READ);
|
||||
vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, p);
|
||||
vn_lock(vp, LK_SHARED | LK_NOPAUSE | LK_RETRY, p);
|
||||
uio->uio_offset = fp->f_offset;
|
||||
count = uio->uio_resid;
|
||||
flag = 0;
|
||||
@ -525,7 +525,7 @@ vn_lock(vp, flags, p)
|
||||
tsleep((caddr_t)vp, PINOD, "vn_lock", 0);
|
||||
error = ENOENT;
|
||||
} else {
|
||||
error = VOP_LOCK(vp, flags | LK_INTERLOCK, p);
|
||||
error = VOP_LOCK(vp, flags | LK_NOPAUSE | LK_INTERLOCK, p);
|
||||
if (error == 0)
|
||||
return (error);
|
||||
}
|
||||
|
@ -38,7 +38,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* from: @(#)vnode_pager.c 7.5 (Berkeley) 4/20/91
|
||||
* $Id: vnode_pager.c,v 1.73 1997/08/25 22:15:31 bde Exp $
|
||||
* $Id: vnode_pager.c,v 1.74 1997/09/01 03:17:34 bde Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -973,7 +973,8 @@ vnode_pager_lock(object)
|
||||
if (object->type != OBJT_VNODE)
|
||||
continue;
|
||||
|
||||
vn_lock(object->handle, LK_EXCLUSIVE | LK_RETRY | LK_CANRECURSE, p);
|
||||
vn_lock(object->handle,
|
||||
LK_NOPAUSE | LK_SHARED | LK_RETRY | LK_CANRECURSE, p);
|
||||
return object->handle;
|
||||
}
|
||||
return NULL;
|
||||
|
Loading…
Reference in New Issue
Block a user