PERFORCE change 163531 for review
Tatsiana Severyna
tatsianka at FreeBSD.org
Thu Jun 4 22:58:46 UTC 2009
http://perforce.freebsd.org/chv.cgi?CH=163531
Change 163531 by tatsianka at tatsianka_zonder on 2009/06/04 22:57:52
Some fixes in puffs (but some important code paths are not ported yet). Add libpuffs port. Add puffs nullfs implementation - pnullfs.
Affected files ...
.. //depot/projects/soc2009/tatsianka_puffs/libpuffs/Makefile#1 add
.. //depot/projects/soc2009/tatsianka_puffs/libpuffs/callcontext.c#1 add
.. //depot/projects/soc2009/tatsianka_puffs/libpuffs/creds.c#1 add
.. //depot/projects/soc2009/tatsianka_puffs/libpuffs/dirent_compat.h#1 add
.. //depot/projects/soc2009/tatsianka_puffs/libpuffs/dispatcher.c#1 add
.. //depot/projects/soc2009/tatsianka_puffs/libpuffs/flush.c#1 add
.. //depot/projects/soc2009/tatsianka_puffs/libpuffs/framebuf.c#1 add
.. //depot/projects/soc2009/tatsianka_puffs/libpuffs/null.c#1 add
.. //depot/projects/soc2009/tatsianka_puffs/libpuffs/opdump.c#1 add
.. //depot/projects/soc2009/tatsianka_puffs/libpuffs/paths.c#1 add
.. //depot/projects/soc2009/tatsianka_puffs/libpuffs/pnode.c#1 add
.. //depot/projects/soc2009/tatsianka_puffs/libpuffs/puffs.3#1 add
.. //depot/projects/soc2009/tatsianka_puffs/libpuffs/puffs.c#1 add
.. //depot/projects/soc2009/tatsianka_puffs/libpuffs/puffs.h#1 add
.. //depot/projects/soc2009/tatsianka_puffs/libpuffs/puffs_cc.3#1 add
.. //depot/projects/soc2009/tatsianka_puffs/libpuffs/puffs_cred.3#1 add
.. //depot/projects/soc2009/tatsianka_puffs/libpuffs/puffs_flush.3#1 add
.. //depot/projects/soc2009/tatsianka_puffs/libpuffs/puffs_framebuf.3#1 add
.. //depot/projects/soc2009/tatsianka_puffs/libpuffs/puffs_node.3#1 add
.. //depot/projects/soc2009/tatsianka_puffs/libpuffs/puffs_ops.3#1 add
.. //depot/projects/soc2009/tatsianka_puffs/libpuffs/puffs_path.3#1 add
.. //depot/projects/soc2009/tatsianka_puffs/libpuffs/puffs_priv.h#1 add
.. //depot/projects/soc2009/tatsianka_puffs/libpuffs/puffs_suspend.3#1 add
.. //depot/projects/soc2009/tatsianka_puffs/libpuffs/puffsdump.h#1 add
.. //depot/projects/soc2009/tatsianka_puffs/libpuffs/requests.c#1 add
.. //depot/projects/soc2009/tatsianka_puffs/libpuffs/subr.c#1 add
.. //depot/projects/soc2009/tatsianka_puffs/libpuffs/suspend.c#1 add
.. //depot/projects/soc2009/tatsianka_puffs/pnullfs/Makefile#1 add
.. //depot/projects/soc2009/tatsianka_puffs/pnullfs/pnullfs.c#1 add
.. //depot/projects/soc2009/tatsianka_puffs/puffs/Makefile#2 edit
.. //depot/projects/soc2009/tatsianka_puffs/puffs/puffs_msgif.c#2 edit
.. //depot/projects/soc2009/tatsianka_puffs/puffs/puffs_msgif.h#2 edit
.. //depot/projects/soc2009/tatsianka_puffs/puffs/puffs_node.c#2 edit
.. //depot/projects/soc2009/tatsianka_puffs/puffs/puffs_subr.c#2 edit
.. //depot/projects/soc2009/tatsianka_puffs/puffs/puffs_sys.h#2 edit
.. //depot/projects/soc2009/tatsianka_puffs/puffs/puffs_vfsops.c#2 edit
.. //depot/projects/soc2009/tatsianka_puffs/puffs/puffs_vnops.c#2 edit
.. //depot/projects/soc2009/tatsianka_puffs/putter/Makefile#2 edit
Differences ...
==== //depot/projects/soc2009/tatsianka_puffs/puffs/Makefile#2 (text+ko) ====
@@ -8,4 +8,4 @@
.include <bsd.kmod.mk>
-CFLAGS+= -I../putter
+CFLAGS+= -I${.CURDIR} -I${.CURDIR}/../putter
==== //depot/projects/soc2009/tatsianka_puffs/puffs/puffs_msgif.c#2 (text+ko) ====
@@ -51,10 +51,6 @@
#include <puffs_msgif.h>
#include <puffs_sys.h>
-#ifdef XXX_TS
-#include <miscfs/syncfs/syncfs.h> /* XXX: for syncer_mutex reference */
-#endif
-
/*
* waitq data structures
*/
@@ -117,7 +113,7 @@
puffs_msgif_init()
{
- parkpc = uma_zcreate("puffprkl", sizeof(struct puffs_msgpark),
+ parkpc = uma_zcreate("puffprkl", sizeof(struct puffs_msgpark),
NULL, NULL, makepark, nukepark, UMA_ALIGN_PTR, UMA_ZONE_ZINIT);
}
@@ -776,12 +772,7 @@
puffsop_flush(struct puffs_mount *pmp, struct puffs_flush *pf)
{
struct vnode *vp;
-#ifdef XXX_TS
- off_t offlo, offhi;
- int rv, flags = 0;
-#else
int rv;
-#endif
if (pf->pf_req.preq_pth.pth_framelen != sizeof(struct puffs_flush)) {
rv = EINVAL;
@@ -939,10 +930,8 @@
* wait for syncer_mutex. Otherwise the mointpoint can be
* wiped out while we wait. XXX Should be done earlier
*/
-#ifdef XXX_TS
- atomic_inc_uint((unsigned int*)&mp->mnt_refcnt);
-#endif
- /* FIXME */
+ /* XXX_TS */
+ vfs_ref(mp);
mtx_lock(&Giant); /* dounmount() */
(void)dounmount(mp, MNT_FORCE, curthread);
mtx_unlock(&Giant); /* dounmount() */
@@ -990,7 +979,7 @@
* on the queue and move on to the next one.
*/
if (park->park_flags & PARKFLAG_WAITERGONE) {
- KASSERT((park->park_flags & PARKFLAG_CALL) == 0,
+ KASSERT((park->park_flags & PARKFLAG_CALL) == 0,
("park_flags & PARKFLAG_CALL == 0"));
KASSERT(park->park_flags & PARKFLAG_WANTREPLY,
("park_flags & PARKFLAG_WANTREPLY"));
==== //depot/projects/soc2009/tatsianka_puffs/puffs/puffs_msgif.h#2 (text+ko) ====
@@ -38,6 +38,7 @@
#include <sys/uio.h>
#include <sys/vnode.h>
#include <sys/ucred.h>
+#include <sys/statvfs.h>
#include <sys/mount.h>
#include <sys/dirent.h>
#include <sys/fcntl.h>
@@ -109,7 +110,7 @@
#define PUFFS_TYPELEN (MFSNAMELEN - (sizeof(PUFFS_TYPEPREFIX)+1))
#define PUFFS_NAMELEN (MNAMELEN-1)
-/*
+/*
* Just a weak typedef for code clarity. Additionally, we have a
* more appropriate vanity type for puffs:
* <uep> it should be croissant, not cookie.
@@ -193,7 +194,7 @@
/*
* Flush operation. This can be used to invalidate:
* 1) name cache for one node
- * 2) name cache for all children
+ * 2) name cache for all children
* 3) name cache for the entire mount
* 4) page cache for a set of ranges in one node
* 5) page cache for one entire node
@@ -577,7 +578,7 @@
struct puffs_req pcache_pr;
int pcache_type;
- size_t pcache_nruns;
+ size_t pcache_nruns;
struct puffs_cacherun pcache_runs[0];
};
#define PCACHE_TYPE_READ 0
==== //depot/projects/soc2009/tatsianka_puffs/puffs/puffs_node.c#2 (text+ko) ====
@@ -53,20 +53,6 @@
#include <puffs_msgif.h>
#include <puffs_sys.h>
-#ifdef XXX_TS
-#include <miscfs/genfs/genfs_node.h>
-#include <miscfs/specfs/specdev.h>
-
-static const struct genfs_ops puffs_genfsops = {
- .gop_size = puffs_gop_size,
- .gop_write = genfs_gop_write,
- .gop_markupdate = puffs_gop_markupdate,
-#if 0
- .gop_alloc, should ask userspace
-#endif
-};
-#endif
-
static __inline struct puffs_node_hashlist
*puffs_cookie2hashlist(struct puffs_mount *, puffs_cookie_t);
static struct puffs_node *puffs_cookie2pnode(struct puffs_mount *,
@@ -161,7 +147,7 @@
break;
default:
panic("puffs_getvnode: invalid vtype %d", type);
- }
+ }
#endif
pnode = uma_zalloc(puffs_pnpool, M_WAITOK);
@@ -327,7 +313,6 @@
return pnode;
}
-#ifdef XXX_TS /* fix vget and locking */
/*
* Make sure root vnode exists and reference it. Does NOT lock.
*/
@@ -347,9 +332,9 @@
mtx_lock(&pmp->pmp_lock);
vp = pmp->pmp_root;
if (vp) {
- mtx_lock(&vp->v_interlock);
+ VI_LOCK(vp);
mtx_unlock(&pmp->pmp_lock);
- if (vget(vp, LK_INTERLOCK) == 0)
+ if (vget(vp, LK_INTERLOCK, curthread) == 0)
return 0;
} else
mtx_unlock(&pmp->pmp_lock);
@@ -371,7 +356,7 @@
mtx_unlock(&pmp->pmp_lock);
puffs_putvnode(vp);
goto retry;
- }
+ }
/* store cache */
vp->v_vflag |= VV_ROOT;
@@ -425,19 +410,18 @@
return PUFFS_NOSUCHCOOKIE;
}
vp = pnode->pn_vp;
- mtx_lock(&vp->v_interlock);
+ VI_LOCK(vp);
mtx_unlock(&pmp->pmp_lock);
vgetflags = LK_INTERLOCK;
if (lock)
vgetflags |= LK_EXCLUSIVE | LK_RETRY;
- if ((rv = vget(vp, vgetflags)))
+ if ((rv = vget(vp, vgetflags, curthread)))
return rv;
*vpp = vp;
return 0;
}
-#endif
void
puffs_updatenode(struct puffs_node *pn, int flags, off_t size)
==== //depot/projects/soc2009/tatsianka_puffs/puffs/puffs_subr.c#2 (text+ko) ====
@@ -120,10 +120,7 @@
}
}
-#ifdef XXX_TS
- /* XXX should be bio ??? */
- biodone(bp);
-#endif
+ bdone(bp);
}
void
@@ -146,10 +143,7 @@
}
}
-#ifdef XXX_TS
- /* XXX should be bio ??? */
- biodone(bp);
-#endif
+ bdone(bp);
}
/* XXX: userspace can leak kernel resources */
@@ -193,30 +187,6 @@
}
void
-puffs_gop_size(struct vnode *vp, off_t size, off_t *eobp,
- int flags)
-{
-
- *eobp = size;
-}
-
-void
-puffs_gop_markupdate(struct vnode *vp, int flags)
-{
- int uflags = 0;
-
-#ifdef XXX_TS
- /* different beast in freebsd */
- if (flags & GOP_UPDATE_ACCESSED)
- uflags |= PUFFS_UPDATEATIME;
- if (flags & GOP_UPDATE_MODIFIED)
- uflags |= PUFFS_UPDATEMTIME;
-#endif
-
- puffs_updatenode(VPTOPP(vp), uflags, 0);
-}
-
-void
puffs_senderr(struct puffs_mount *pmp, int type, int error,
const char *str, puffs_cookie_t ck)
{
==== //depot/projects/soc2009/tatsianka_puffs/puffs/puffs_sys.h#2 (text+ko) ====
@@ -225,9 +225,6 @@
void puffs_mp_reference(struct puffs_mount *);
void puffs_mp_release(struct puffs_mount *);
-void puffs_gop_size(struct vnode *, off_t, off_t *, int);
-void puffs_gop_markupdate(struct vnode *, int);
-
void puffs_senderr(struct puffs_mount *, int, int, const char *,
puffs_cookie_t);
==== //depot/projects/soc2009/tatsianka_puffs/puffs/puffs_vfsops.c#2 (text+ko) ====
@@ -526,4 +526,5 @@
};
VFS_SET(puffs_vfsops, puffs, VFCF_NETWORK);
+MODULE_DEPEND(puffs, putter, 1, 1, 1);
==== //depot/projects/soc2009/tatsianka_puffs/puffs/puffs_vnops.c#2 (text+ko) ====
@@ -108,7 +108,6 @@
* don't want to think of the consequences for the time being.
*/
-/* XXX_TS TEST TEST TEST */
static int
puffs_vnop_vptofh(struct vop_vptofh_args *ap)
{
@@ -162,7 +161,7 @@
static int
puffs_vnop_lookup(struct vop_cachedlookup_args *ap)
{
-
+
PUFFS_MSG_VARS(vn, lookup);
struct puffs_mount *pmp;
struct componentname *cnp;
@@ -728,10 +727,10 @@
* => resid + cookiesize/minsize * resid = maxreq
* => (cookiesize/minsize + 1) * resid = maxreq
* => resid = maxreq / (cookiesize/minsize + 1)
- *
+ *
* Since cookiesize <= minsize and we're not very big on floats,
* we approximate that to be 1. Therefore:
- *
+ *
* resid = maxreq / 2;
*
* Well, at least we didn't have to use differential equations
@@ -836,7 +835,7 @@
/* flush out information from our metacache, see vop_setattr */
if (pn->pn_stat & PNODE_METACACHE_MASK) {
vattr_null(&va);
- error = VOP_SETATTR(vp, &va, FSCRED);
+ error = VOP_SETATTR(vp, &va, FSCRED);
if (error)
return error;
}
@@ -1538,7 +1537,7 @@
NULL, error);
PUFFS_MSG_RELEASE(print);
}
-
+
return 0;
}
@@ -1745,7 +1744,7 @@
*/
if (dofaf && error == 0)
moved = tomove;
- else
+ else
moved = tomove - rw_msg->pvnr_resid;
bp->b_resid = bp->b_bcount - moved;
@@ -1808,7 +1807,7 @@
int puffs_vnop_mmap(void *);
#endif
-struct vop_vector tmpfs_vnodeop_entries = {
+struct vop_vector puffs_vnodeops = {
.vop_default = &default_vnodeops,
.vop_lookup = vfs_cache_lookup,
.vop_cachedlookup = puffs_vnop_lookup,
==== //depot/projects/soc2009/tatsianka_puffs/putter/Makefile#2 (text+ko) ====
@@ -1,8 +1,8 @@
# $FreeBSD$
-.PATH: ${.CURDIR}/../../dev/putter
-
KMOD= putter
SRCS= putter.c putter.h putter_sys.h
+CFLAGS+= -I${.CURDIR}
+
.include <bsd.kmod.mk>
More information about the p4-projects
mailing list