SCCS-vsn: sys/miscfs/umapfs/umap_subr.c 7.1
SCCS-vsn: sys/miscfs/umapfs/umap_vfsops.c 7.1
SCCS-vsn: sys/miscfs/umapfs/umap_vnops.c 7.1
*
* %sccs.include.redist.c%
*
*
* %sccs.include.redist.c%
*
- * @(#)lofs_subr.c 1.2 (Berkeley) 6/18/92
+ * @(#)umap_subr.c 7.1 (Berkeley) %G%
*
* $Id: lofs_subr.c,v 1.11 1992/05/30 10:05:43 jsp Exp jsp $
*/
*
* $Id: lofs_subr.c,v 1.11 1992/05/30 10:05:43 jsp Exp jsp $
*/
#include <sys/mount.h>
#include <sys/namei.h>
#include <sys/malloc.h>
#include <sys/mount.h>
#include <sys/namei.h>
#include <sys/malloc.h>
-#include <umapfs/umap.h>
+#include <miscfs/umapfs/umap.h>
#define LOG2_SIZEVNODE 7 /* log2(sizeof struct vnode) */
#define NUMAPNODECACHE 16
#define LOG2_SIZEVNODE 7 /* log2(sizeof struct vnode) */
#define NUMAPNODECACHE 16
umap_node_hash(targetvp)
struct vnode *targetvp;
{
umap_node_hash(targetvp)
struct vnode *targetvp;
{
return (&umap_node_cache[UMAP_NHASH(targetvp)]);
}
return (&umap_node_cache[UMAP_NHASH(targetvp)]);
}
loop:
for (a = hd->ac_forw; a != (struct umap_node *) hd; a = a->umap_forw) {
loop:
for (a = hd->ac_forw; a != (struct umap_node *) hd; a = a->umap_forw) {
- if (a->umap_lowervp == targetvp && a->umap_vnode->v_mount == mp) {
+ if (a->umap_lowervp == targetvp &&
+ a->umap_vnode->v_mount == mp) {
vp = UMAPTOV(a);
/*
* We need vget for the VXLOCK
vp = UMAPTOV(a);
/*
* We need vget for the VXLOCK
if (vget_nolock(vp)) {
printf ("null_node_find: vget failed.\n");
goto loop;
if (vget_nolock(vp)) {
printf ("null_node_find: vget failed.\n");
goto loop;
return (error); /* XXX: VT_UMAP above */
vp = *vpp;
return (error); /* XXX: VT_UMAP above */
vp = *vpp;
- MALLOC(xp, struct umap_node *, sizeof(struct umap_node), M_TEMP, M_WAITOK);
+ MALLOC(xp, struct umap_node *, sizeof(struct umap_node),
+ M_TEMP, M_WAITOK);
vp->v_type = lowervp->v_type;
xp->umap_vnode = vp;
vp->v_data = xp;
vp->v_type = lowervp->v_type;
xp->umap_vnode = vp;
vp->v_data = xp;
vp->v_type = VBAD; /* node is discarded */
vp->v_usecount = 0; /* XXX */
*vpp = othervp;
vp->v_type = VBAD; /* node is discarded */
vp->v_usecount = 0; /* XXX */
*vpp = othervp;
VREF(lowervp); /* Extra VREF will be vrele'd in umap_node_create */
hd = umap_node_hash(lowervp);
insque(xp, hd);
VREF(lowervp); /* Extra VREF will be vrele'd in umap_node_create */
hd = umap_node_hash(lowervp);
insque(xp, hd);
* Make new vnode reference the umap_node.
*/
if (error = umap_node_alloc(mp, targetvp, &aliasvp))
* Make new vnode reference the umap_node.
*/
if (error = umap_node_alloc(mp, targetvp, &aliasvp))
/*
* aliasvp is already VREF'd by getnewvnode()
/*
* aliasvp is already VREF'd by getnewvnode()
*newvpp = aliasvp;
return (0);
}
*newvpp = aliasvp;
return (0);
}
#ifdef UMAPFS_DIAGNOSTIC
int umap_checkvp_barrier = 1;
struct vnode *
#ifdef UMAPFS_DIAGNOSTIC
int umap_checkvp_barrier = 1;
struct vnode *
printf ("umap_checkvp: on non-umap-node\n");
while (umap_checkvp_barrier) /*WAIT*/ ;
panic("umap_checkvp");
printf ("umap_checkvp: on non-umap-node\n");
while (umap_checkvp_barrier) /*WAIT*/ ;
panic("umap_checkvp");
#endif
if (a->umap_lowervp == NULL) {
/* Should never happen */
#endif
if (a->umap_lowervp == NULL) {
/* Should never happen */
/* wait for debugger */
while (umap_checkvp_barrier) /*WAIT*/ ;
panic ("umap with unref'ed lowervp");
/* wait for debugger */
while (umap_checkvp_barrier) /*WAIT*/ ;
panic ("umap with unref'ed lowervp");
#if 0
printf("umap %x/%d -> %x/%d [%s, %d]\n",
a->umap_vnode, a->umap_vnode->v_usecount,
a->umap_lowervp, a->umap_lowervp->v_usecount,
fil, lno);
#endif
#if 0
printf("umap %x/%d -> %x/%d [%s, %d]\n",
a->umap_vnode, a->umap_vnode->v_usecount,
a->umap_lowervp, a->umap_lowervp->v_usecount,
fil, lno);
#endif
- return a->umap_lowervp;
+ return (a->umap_lowervp);
*
* %sccs.include.redist.c%
*
*
* %sccs.include.redist.c%
*
- * @(#)umap_vfsops.c 1.2 (Berkeley) %G%
+ * @(#)umap_vfsops.c 7.1 (Berkeley) %G%
*
* @(#)null_vfsops.c 1.5 (Berkeley) 7/10/92
*/
*
* @(#)null_vfsops.c 1.5 (Berkeley) 7/10/92
*/
* ever get anything cached at this level at the
* moment, but who knows...
*/
* ever get anything cached at this level at the
* moment, but who knows...
*/
mntflushbuf(mp, 0);
if (mntinvalbuf(mp, 1))
return (EBUSY);
mntflushbuf(mp, 0);
if (mntinvalbuf(mp, 1))
return (EBUSY);
*
* %sccs.include.redist.c%
*
*
* %sccs.include.redist.c%
*
- * @(#)umap_vnops.c 1.2 (Berkeley) %G%
+ * @(#)umap_vnops.c 7.1 (Berkeley) %G%
*
* @(#)umap_vnops.c 1.5 (Berkeley) 7/10/92
*/
*
* @(#)umap_vnops.c 1.5 (Berkeley) 7/10/92
*/