diff options
author | phk <phk@FreeBSD.org> | 2004-07-30 22:08:52 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 2004-07-30 22:08:52 +0000 |
commit | 2d868d02cfcc9af8da398c52add2f28fe1c493bc (patch) | |
tree | af2a6b4c3e63a13443b647b947b57d5b31690b5a /sys/fs/hpfs | |
parent | 941a15ae99cc0252acd241ea5e407eb00a540858 (diff) | |
download | FreeBSD-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/hpfs')
-rw-r--r-- | sys/fs/hpfs/hpfs_vfsops.c | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/sys/fs/hpfs/hpfs_vfsops.c b/sys/fs/hpfs/hpfs_vfsops.c index 9ea6cfb..e002feb 100644 --- a/sys/fs/hpfs/hpfs_vfsops.c +++ b/sys/fs/hpfs/hpfs_vfsops.c @@ -62,7 +62,7 @@ static vfs_init_t hpfs_init; static vfs_uninit_t hpfs_uninit; static vfs_fhtovp_t hpfs_fhtovp; static vfs_vget_t hpfs_vget; -static vfs_mount_t hpfs_mount; +static vfs_omount_t hpfs_omount; static vfs_root_t hpfs_root; static vfs_statfs_t hpfs_statfs; static vfs_unmount_t hpfs_unmount; @@ -87,11 +87,10 @@ hpfs_uninit (vfsp) } static int -hpfs_mount ( +hpfs_omount ( struct mount *mp, char *path, caddr_t data, - struct nameidata *ndp, struct thread *td ) { size_t size; @@ -99,8 +98,9 @@ hpfs_mount ( struct vnode *devvp; struct hpfs_args args; struct hpfsmount *hpmp = 0; + struct nameidata ndp; - dprintf(("hpfs_mount():\n")); + dprintf(("hpfs_omount():\n")); /* *** * Mounting non-root filesystem or updating a filesystem @@ -117,7 +117,7 @@ hpfs_mount ( * read/write; if there is no device name, that's all we do. */ if (mp->mnt_flag & MNT_UPDATE) { - dprintf(("hpfs_mount: MNT_UPDATE: ")); + dprintf(("hpfs_omount: MNT_UPDATE: ")); hpmp = VFSTOHPFS(mp); @@ -125,7 +125,7 @@ hpfs_mount ( dprintf(("export 0x%x\n",args.export.ex_flags)); err = vfs_export(mp, &args.export); if (err) { - printf("hpfs_mount: vfs_export failed %d\n", + printf("hpfs_omount: vfs_export failed %d\n", err); } goto success; @@ -141,14 +141,14 @@ hpfs_mount ( * Not an update, or updating the name: look up the name * and verify that it refers to a sensible block device. */ - NDINIT(ndp, LOOKUP, FOLLOW, UIO_USERSPACE, args.fspec, td); - err = namei(ndp); + NDINIT(&ndp, LOOKUP, FOLLOW, UIO_USERSPACE, args.fspec, td); + err = namei(&ndp); if (err) { /* can't get devvp!*/ goto error_1; } - devvp = ndp->ni_vp; + devvp = ndp.ni_vp; if (!vn_isdisk(devvp, &err)) goto error_2; @@ -163,7 +163,7 @@ hpfs_mount ( * Since this is a new mount, we want the names for * the device and the mount point copied in. If an * error occurs, the mountpoint is discarded by the - * upper level code. Note that vfs_mount() handles + * upper level code. Note that vfs_omount() handles * copying the mountpoint f_mntonname for us, so we * don't have to do it here unless we want to set it * to something other than "path" for some rason. @@ -196,6 +196,7 @@ error_2: /* error with devvp held*/ vrele(devvp); error_1: /* no state to back out*/ + /* XXX: Missing NDFREE(&ndp, ...) */ success: return( err); @@ -573,7 +574,7 @@ hpfs_vget( static struct vfsops hpfs_vfsops = { .vfs_fhtovp = hpfs_fhtovp, .vfs_init = hpfs_init, - .vfs_mount = hpfs_mount, + .vfs_omount = hpfs_omount, .vfs_root = hpfs_root, .vfs_statfs = hpfs_statfs, .vfs_uninit = hpfs_uninit, |