summaryrefslogtreecommitdiffstats
path: root/sys/fs/coda
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>2004-07-30 22:08:52 +0000
committerphk <phk@FreeBSD.org>2004-07-30 22:08:52 +0000
commit2d868d02cfcc9af8da398c52add2f28fe1c493bc (patch)
treeaf2a6b4c3e63a13443b647b947b57d5b31690b5a /sys/fs/coda
parent941a15ae99cc0252acd241ea5e407eb00a540858 (diff)
downloadFreeBSD-src-2d868d02cfcc9af8da398c52add2f28fe1c493bc.zip
FreeBSD-src-2d868d02cfcc9af8da398c52add2f28fe1c493bc.tar.gz
Put a version element in the VFS filesystem configuration structure
and refuse initializing filesystems with a wrong version. This will aid maintenance activites on the 5-stable branch. s/vfs_mount/vfs_omount/ s/vfs_nmount/vfs_mount/ Name our filesystems mount function consistently. Eliminate the namiedata argument to both vfs_mount and vfs_omount. It was originally there to save stack space. A few places abused it to get hold of some credentials to pass around. Effectively it is unused. Reorganize the root filesystem selection code.
Diffstat (limited to 'sys/fs/coda')
-rw-r--r--sys/fs/coda/coda_vfsops.c27
1 files changed, 14 insertions, 13 deletions
diff --git a/sys/fs/coda/coda_vfsops.c b/sys/fs/coda/coda_vfsops.c
index de84eb0..189ee92 100644
--- a/sys/fs/coda/coda_vfsops.c
+++ b/sys/fs/coda/coda_vfsops.c
@@ -83,6 +83,8 @@ struct coda_op_stats coda_vfsopstats[CODA_VFSOPS_SIZE];
extern int coda_nc_initialized; /* Set if cache has been initialized */
extern int vc_nb_open(struct cdev *, int, int, struct thread *);
+static vfs_omount_t coda_omount;
+
int
coda_vfsopstats_init(void)
{
@@ -105,11 +107,10 @@ coda_vfsopstats_init(void)
*/
/*ARGSUSED*/
int
-coda_mount(vfsp, path, data, ndp, td)
+coda_omount(vfsp, path, data, td)
struct mount *vfsp; /* Allocated and initialized by mount(2) */
char *path; /* path covered: ignored by the fs-layer */
caddr_t data; /* Need to define a data type for this in netbsd? */
- struct nameidata *ndp; /* Clobber this to lookup the device name */
struct thread *td;
{
struct vnode *dvp;
@@ -120,7 +121,7 @@ coda_mount(vfsp, path, data, ndp, td)
CodaFid rootfid = INVAL_FID;
CodaFid ctlfid = CTL_FID;
int error;
-
+ struct nameidata ndp;
ENTRY;
coda_vfsopstats_init();
@@ -133,9 +134,9 @@ coda_mount(vfsp, path, data, ndp, td)
}
/* Validate mount device. Similar to getmdev(). */
- NDINIT(ndp, LOOKUP, FOLLOW, UIO_USERSPACE, data, td);
- error = namei(ndp);
- dvp = ndp->ni_vp;
+ NDINIT(&ndp, LOOKUP, FOLLOW, UIO_USERSPACE, data, td);
+ error = namei(&ndp);
+ dvp = ndp.ni_vp;
if (error) {
MARK_INT_FAIL(CODA_MOUNT_STATS);
@@ -144,12 +145,12 @@ coda_mount(vfsp, path, data, ndp, td)
if (dvp->v_type != VCHR) {
MARK_INT_FAIL(CODA_MOUNT_STATS);
vrele(dvp);
- NDFREE(ndp, NDF_ONLY_PNBUF);
+ NDFREE(&ndp, NDF_ONLY_PNBUF);
return(ENXIO);
}
dev = dvp->v_rdev;
vrele(dvp);
- NDFREE(ndp, NDF_ONLY_PNBUF);
+ NDFREE(&ndp, NDF_ONLY_PNBUF);
/*
* See if the device table matches our expectations.
@@ -216,7 +217,7 @@ coda_mount(vfsp, path, data, ndp, td)
/* error is currently guaranteed to be zero, but in case some
code changes... */
CODADEBUG(1,
- myprintf(("coda_mount returned %d\n",error)););
+ myprintf(("coda_omount returned %d\n",error)););
if (error)
MARK_INT_FAIL(CODA_MOUNT_STATS);
else
@@ -300,10 +301,10 @@ coda_root(vfsp, vpp, td)
/*
* Cache the root across calls. We only need to pass the request
* on to Venus if the root vnode is the dummy we installed in
- * coda_mount() with all c_fid members zeroed.
+ * coda_omount() with all c_fid members zeroed.
*
- * XXX In addition, if we are called between coda_mount() and
- * coda_start(), we assume that the request is from vfs_mount()
+ * XXX In addition, if we are called between coda_omount() and
+ * coda_start(), we assume that the request is from vfs_omount()
* (before the call to checkdirs()) and return the dummy root
* node to avoid a deadlock. This bug is fixed in the Coda CVS
* repository but not in any released versions as of 6 Mar 2003.
@@ -543,7 +544,7 @@ struct mount *devtomp(dev)
}
struct vfsops coda_vfsops = {
- .vfs_mount = coda_mount,
+ .vfs_omount = coda_omount,
.vfs_root = coda_root,
.vfs_start = coda_start,
.vfs_statfs = coda_nb_statfs,
OpenPOWER on IntegriCloud