Add sysctl and support code to allow directories to be VMIO'd. The default
setting for the sysctl is OFF, which is the historical operation. Submitted by: dillon
This commit is contained in:
parent
0afb35f188
commit
46dacf1591
@ -11,7 +11,7 @@
|
||||
* 2. Absolutely no warranty of function or purpose is made by the author
|
||||
* John S. Dyson.
|
||||
*
|
||||
* $Id: vfs_bio.c,v 1.222 1999/07/08 17:58:55 mckusick Exp $
|
||||
* $Id: vfs_bio.c,v 1.223 1999/07/09 16:41:19 peter Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -83,6 +83,7 @@ static void buf_daemon __P((void));
|
||||
*/
|
||||
vm_page_t bogus_page;
|
||||
int runningbufspace;
|
||||
int vmiodirenable = FALSE;
|
||||
static vm_offset_t bogus_offset;
|
||||
|
||||
static int bufspace, maxbufspace, vmiospace,
|
||||
@ -136,6 +137,8 @@ SYSCTL_INT(_vfs, OID_AUTO, getnewbufcalls, CTLFLAG_RW,
|
||||
&getnewbufcalls, 0, "");
|
||||
SYSCTL_INT(_vfs, OID_AUTO, getnewbufrestarts, CTLFLAG_RW,
|
||||
&getnewbufrestarts, 0, "");
|
||||
SYSCTL_INT(_vfs, OID_AUTO, vmiodirenable, CTLFLAG_RW,
|
||||
&vmiodirenable, 0, "");
|
||||
|
||||
|
||||
static int bufhashmask;
|
||||
|
@ -36,7 +36,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)vfs_subr.c 8.31 (Berkeley) 5/26/95
|
||||
* $Id: vfs_subr.c,v 1.212 1999/07/19 09:37:59 phk Exp $
|
||||
* $Id: vfs_subr.c,v 1.213 1999/07/20 09:47:44 phk Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -2622,12 +2622,12 @@ vfs_object_create(vp, p, cred)
|
||||
vm_object_t object;
|
||||
int error = 0;
|
||||
|
||||
if ((vp->v_type != VREG) && (vp->v_type != VBLK))
|
||||
if (vp->v_type != VBLK && vn_canvmio(vp) == FALSE)
|
||||
return 0;
|
||||
|
||||
retry:
|
||||
if ((object = vp->v_object) == NULL) {
|
||||
if (vp->v_type == VREG) {
|
||||
if (vp->v_type == VREG || vp->v_type == VDIR) {
|
||||
if ((error = VOP_GETATTR(vp, &vat, cred, p)) != 0)
|
||||
goto retn;
|
||||
object = vnode_pager_alloc(vp, vat.va_size, 0, 0);
|
||||
|
@ -36,7 +36,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)vfs_syscalls.c 8.13 (Berkeley) 4/15/94
|
||||
* $Id: vfs_syscalls.c,v 1.122 1999/04/27 11:16:25 phk Exp $
|
||||
* $Id: vfs_syscalls.c,v 1.123 1999/04/28 11:37:09 phk Exp $
|
||||
*/
|
||||
|
||||
/* For 4.3 integer FS ID compatibility */
|
||||
@ -1020,7 +1020,7 @@ open(p, uap)
|
||||
vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, p);
|
||||
fp->f_flag |= FHASLOCK;
|
||||
}
|
||||
if ((vp->v_type == VREG) && (vp->v_object == NULL))
|
||||
if (vn_canvmio(vp) == TRUE && vp->v_object == NULL)
|
||||
vfs_object_create(vp, p, p->p_ucred);
|
||||
VOP_UNLOCK(vp, 0, p);
|
||||
p->p_retval[0] = indx;
|
||||
|
@ -36,7 +36,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)vfs_lookup.c 8.4 (Berkeley) 2/16/94
|
||||
* $Id: vfs_lookup.c,v 1.32 1999/01/27 21:49:58 dillon Exp $
|
||||
* $Id: vfs_lookup.c,v 1.33 1999/01/28 00:57:47 dillon Exp $
|
||||
*/
|
||||
|
||||
#include "opt_ktrace.h"
|
||||
@ -163,7 +163,7 @@ namei(ndp)
|
||||
else
|
||||
cnp->cn_flags |= HASBUF;
|
||||
|
||||
if (ndp->ni_vp && ndp->ni_vp->v_type == VREG &&
|
||||
if (vn_canvmio(ndp->ni_vp) == TRUE &&
|
||||
(cnp->cn_nameiop != DELETE) &&
|
||||
((cnp->cn_flags & (NOOBJ|LOCKLEAF)) ==
|
||||
LOCKLEAF))
|
||||
@ -687,7 +687,7 @@ relookup(dvp, vpp, cnp)
|
||||
if (!wantparent)
|
||||
vrele(dvp);
|
||||
|
||||
if (dp->v_type == VREG &&
|
||||
if (vn_canvmio(dp) == TRUE &&
|
||||
((cnp->cn_flags & (NOOBJ|LOCKLEAF)) == LOCKLEAF))
|
||||
vfs_object_create(dp, cnp->cn_proc, cnp->cn_cred);
|
||||
|
||||
|
@ -36,7 +36,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)vfs_subr.c 8.31 (Berkeley) 5/26/95
|
||||
* $Id: vfs_subr.c,v 1.212 1999/07/19 09:37:59 phk Exp $
|
||||
* $Id: vfs_subr.c,v 1.213 1999/07/20 09:47:44 phk Exp $
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -2622,12 +2622,12 @@ vfs_object_create(vp, p, cred)
|
||||
vm_object_t object;
|
||||
int error = 0;
|
||||
|
||||
if ((vp->v_type != VREG) && (vp->v_type != VBLK))
|
||||
if (vp->v_type != VBLK && vn_canvmio(vp) == FALSE)
|
||||
return 0;
|
||||
|
||||
retry:
|
||||
if ((object = vp->v_object) == NULL) {
|
||||
if (vp->v_type == VREG) {
|
||||
if (vp->v_type == VREG || vp->v_type == VDIR) {
|
||||
if ((error = VOP_GETATTR(vp, &vat, cred, p)) != 0)
|
||||
goto retn;
|
||||
object = vnode_pager_alloc(vp, vat.va_size, 0, 0);
|
||||
|
@ -36,7 +36,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)vfs_syscalls.c 8.13 (Berkeley) 4/15/94
|
||||
* $Id: vfs_syscalls.c,v 1.122 1999/04/27 11:16:25 phk Exp $
|
||||
* $Id: vfs_syscalls.c,v 1.123 1999/04/28 11:37:09 phk Exp $
|
||||
*/
|
||||
|
||||
/* For 4.3 integer FS ID compatibility */
|
||||
@ -1020,7 +1020,7 @@ open(p, uap)
|
||||
vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, p);
|
||||
fp->f_flag |= FHASLOCK;
|
||||
}
|
||||
if ((vp->v_type == VREG) && (vp->v_object == NULL))
|
||||
if (vn_canvmio(vp) == TRUE && vp->v_object == NULL)
|
||||
vfs_object_create(vp, p, p->p_ucred);
|
||||
VOP_UNLOCK(vp, 0, p);
|
||||
p->p_retval[0] = indx;
|
||||
|
@ -36,7 +36,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)vfs_vnops.c 8.2 (Berkeley) 1/21/94
|
||||
* $Id: vfs_vnops.c,v 1.69 1999/07/02 16:29:15 phk Exp $
|
||||
* $Id: vfs_vnops.c,v 1.70 1999/07/08 06:05:56 mckusick Exp $
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
@ -171,7 +171,7 @@ vn_open(ndp, fmode, cmode)
|
||||
/*
|
||||
* Make sure that a VM object is created for VMIO support.
|
||||
*/
|
||||
if (vp->v_type == VREG) {
|
||||
if (vn_canvmio(vp) == TRUE) {
|
||||
if ((error = vfs_object_create(vp, p, cred)) != 0)
|
||||
goto bad;
|
||||
}
|
||||
|
@ -31,7 +31,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)vnode.h 8.7 (Berkeley) 2/4/94
|
||||
* $Id: vnode.h,v 1.90 1999/07/18 14:30:30 phk Exp $
|
||||
* $Id: vnode.h,v 1.91 1999/07/20 09:47:54 phk Exp $
|
||||
*/
|
||||
|
||||
#ifndef _SYS_VNODE_H_
|
||||
@ -454,6 +454,20 @@ struct vop_generic_args {
|
||||
#define VDESC(OP) (& __CONCAT(OP,_desc))
|
||||
#define VOFFSET(OP) (VDESC(OP)->vdesc_offset)
|
||||
|
||||
/*
|
||||
* VMIO support inline
|
||||
*/
|
||||
|
||||
extern int vmiodirenable;
|
||||
|
||||
static __inline int
|
||||
vn_canvmio(struct vnode *vp)
|
||||
{
|
||||
if (vp && (vp->v_type == VREG || (vmiodirenable && vp->v_type == VDIR)))
|
||||
return(TRUE);
|
||||
return(FALSE);
|
||||
}
|
||||
|
||||
/*
|
||||
* Finally, include the default set of vnode operations.
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user