summaryrefslogtreecommitdiffstats
path: root/sys/fs
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>2001-04-25 07:07:52 +0000
committerphk <phk@FreeBSD.org>2001-04-25 07:07:52 +0000
commitcdc83afc7f1e444c4646840f48592b7ff524fbea (patch)
tree1d205c2b7e9b1a72323178bdb64ac082cbe816a5 /sys/fs
parent3a77c500a93ed027c8d6959da8f6ecc3c7752441 (diff)
downloadFreeBSD-src-cdc83afc7f1e444c4646840f48592b7ff524fbea.zip
FreeBSD-src-cdc83afc7f1e444c4646840f48592b7ff524fbea.tar.gz
Move the netexport structure from the fs-specific mountstructure
to struct mount. This makes the "struct netexport *" paramter to the vfs_export and vfs_checkexport interface unneeded. Consequently that all non-stacking filesystems can use vfs_stdcheckexp(). At the same time, make it a pointer to a struct netexport in struct mount, so that we can remove the bogus AF_MAX and #include <net/radix.h> from <sys/mount.h>
Diffstat (limited to 'sys/fs')
-rw-r--r--sys/fs/cd9660/cd9660_vfsops.c30
-rw-r--r--sys/fs/cd9660/iso.h1
-rw-r--r--sys/fs/hpfs/hpfs.h2
-rw-r--r--sys/fs/hpfs/hpfs_vfsops.c17
-rw-r--r--sys/fs/msdosfs/msdosfs_vfsops.c24
-rw-r--r--sys/fs/msdosfs/msdosfsmount.h1
-rw-r--r--sys/fs/ntfs/ntfs.h2
-rw-r--r--sys/fs/ntfs/ntfs_vfsops.c18
8 files changed, 22 insertions, 73 deletions
diff --git a/sys/fs/cd9660/cd9660_vfsops.c b/sys/fs/cd9660/cd9660_vfsops.c
index 0228988..276718f 100644
--- a/sys/fs/cd9660/cd9660_vfsops.c
+++ b/sys/fs/cd9660/cd9660_vfsops.c
@@ -73,8 +73,6 @@ static int cd9660_root __P((struct mount *, struct vnode **));
static int cd9660_statfs __P((struct mount *, struct statfs *, struct proc *));
static int cd9660_vget __P((struct mount *, ino_t, struct vnode **));
static int cd9660_fhtovp __P((struct mount *, struct fid *, struct vnode **));
-static int cd9660_checkexp __P((struct mount *, struct sockaddr *,
- int *, struct ucred **));
static int cd9660_vptofh __P((struct vnode *, struct fid *));
static struct vfsops cd9660_vfsops = {
@@ -87,7 +85,7 @@ static struct vfsops cd9660_vfsops = {
vfs_stdsync,
cd9660_vget,
cd9660_fhtovp,
- cd9660_checkexp,
+ vfs_stdcheckexp,
cd9660_vptofh,
cd9660_init,
cd9660_uninit,
@@ -207,7 +205,7 @@ cd9660_mount(mp, path, data, ndp, p)
if (mp->mnt_flag & MNT_UPDATE) {
imp = VFSTOISOFS(mp);
if (args.fspec == 0)
- return (vfs_export(mp, &imp->im_export, &args.export));
+ return (vfs_export(mp, &args.export));
}
/*
* Not an update, or updating the name: look up the name
@@ -653,30 +651,6 @@ cd9660_fhtovp(mp, fhp, vpp)
}
int
-cd9660_checkexp(mp, nam, exflagsp, credanonp)
- struct mount *mp;
- struct sockaddr *nam;
- int *exflagsp;
- struct ucred **credanonp;
-{
- register struct netcred *np;
- register struct iso_mnt *imp;
-
- imp = VFSTOISOFS(mp);
-
- /*
- * Get the export permission structure for this <mp, client> tuple.
- */
- np = vfs_export_lookup(mp, &imp->im_export, nam);
- if (np == NULL)
- return (EACCES);
-
- *exflagsp = np->netc_exflags;
- *credanonp = &np->netc_anon;
- return (0);
-}
-
-int
cd9660_vget(mp, ino, vpp)
struct mount *mp;
ino_t ino;
diff --git a/sys/fs/cd9660/iso.h b/sys/fs/cd9660/iso.h
index 2da3d82..b62c723 100644
--- a/sys/fs/cd9660/iso.h
+++ b/sys/fs/cd9660/iso.h
@@ -235,7 +235,6 @@ struct iso_mnt {
int im_bmask;
int volume_space_size;
- struct netexport im_export;
char root[ISODCL (157, 190)];
int root_extent;
diff --git a/sys/fs/hpfs/hpfs.h b/sys/fs/hpfs/hpfs.h
index 0f07880..f354b6b 100644
--- a/sys/fs/hpfs/hpfs.h
+++ b/sys/fs/hpfs/hpfs.h
@@ -310,7 +310,9 @@ struct cpisec {
struct hpfsmount {
struct sublock hpm_su;
struct spblock hpm_sp;
+#if !defined(__FreeBSD__)
struct netexport hpm_export;
+#endif
struct mount * hpm_mp;
struct vnode * hpm_devvp;
dev_t hpm_dev;
diff --git a/sys/fs/hpfs/hpfs_vfsops.c b/sys/fs/hpfs/hpfs_vfsops.c
index 2d40b2d..ec68f86 100644
--- a/sys/fs/hpfs/hpfs_vfsops.c
+++ b/sys/fs/hpfs/hpfs_vfsops.c
@@ -88,8 +88,6 @@ static int hpfs_mount __P((struct mount *, char *, caddr_t,
struct nameidata *, struct proc *));
static int hpfs_init __P((struct vfsconf *));
static int hpfs_uninit __P((struct vfsconf *));
-static int hpfs_checkexp __P((struct mount *, struct sockaddr *,
- int *, struct ucred **));
#else /* defined(__NetBSD__) */
static int hpfs_mount __P((struct mount *, const char *, void *,
struct nameidata *, struct proc *));
@@ -101,20 +99,14 @@ static int hpfs_checkexp __P((struct mount *, struct mbuf *,
int *, struct ucred **));
#endif
+#if !defined(__FreeBSD__)
/*ARGSUSED*/
static int
hpfs_checkexp(mp, nam, exflagsp, credanonp)
-#if defined(__FreeBSD__)
- register struct mount *mp;
- struct sockaddr *nam;
- int *exflagsp;
- struct ucred **credanonp;
-#else /* defined(__NetBSD__) */
register struct mount *mp;
struct mbuf *nam;
int *exflagsp;
struct ucred **credanonp;
-#endif
{
register struct netcred *np;
register struct hpfsmount *hpm = VFSTOHPFS(mp);
@@ -130,6 +122,7 @@ hpfs_checkexp(mp, nam, exflagsp, credanonp)
*credanonp = &np->netc_anon;
return (0);
}
+#endif
#if !defined(__FreeBSD__)
/*ARGSUSED*/
@@ -222,7 +215,11 @@ hpfs_mount (
if (args.fspec == 0) {
dprintf(("export 0x%x\n",args.export.ex_flags));
+#if defined(__FreeBSD__)
+ err = vfs_export(mp, &args.export);
+#else /* defined(__NetBSD__) */
err = vfs_export(mp, &hpmp->hpm_export, &args.export);
+#endif
if (err) {
printf("hpfs_mount: vfs_export failed %d\n",
err);
@@ -741,7 +738,7 @@ static struct vfsops hpfs_vfsops = {
vfs_stdsync,
hpfs_vget,
hpfs_fhtovp,
- hpfs_checkexp,
+ vfs_stdcheckexp,
hpfs_vptofh,
hpfs_init,
hpfs_uninit,
diff --git a/sys/fs/msdosfs/msdosfs_vfsops.c b/sys/fs/msdosfs/msdosfs_vfsops.c
index 6cda3bd..2f04def 100644
--- a/sys/fs/msdosfs/msdosfs_vfsops.c
+++ b/sys/fs/msdosfs/msdosfs_vfsops.c
@@ -93,8 +93,6 @@ static int mountmsdosfs __P((struct vnode *devvp, struct mount *mp,
struct proc *p, struct msdosfs_args *argp));
static int msdosfs_fhtovp __P((struct mount *, struct fid *,
struct vnode **));
-static int msdosfs_checkexp __P((struct mount *, struct sockaddr *,
- int *, struct ucred **));
static int msdosfs_mount __P((struct mount *, char *, caddr_t,
struct nameidata *, struct proc *));
static int msdosfs_root __P((struct mount *, struct vnode **));
@@ -292,7 +290,7 @@ msdosfs_mount(mp, path, data, ndp, p)
/*
* Process export requests.
*/
- return (vfs_export(mp, &pmp->pm_export, &args.export));
+ return (vfs_export(mp, &args.export));
}
}
/*
@@ -932,24 +930,6 @@ msdosfs_fhtovp(mp, fhp, vpp)
}
static int
-msdosfs_checkexp(mp, nam, exflagsp, credanonp)
- struct mount *mp;
- struct sockaddr *nam;
- int *exflagsp;
- struct ucred **credanonp;
-{
- struct msdosfsmount *pmp = VFSTOMSDOSFS(mp);
- struct netcred *np;
-
- np = vfs_export_lookup(mp, &pmp->pm_export, nam);
- if (np == NULL)
- return (EACCES);
- *exflagsp = np->netc_exflags;
- *credanonp = &np->netc_anon;
- return (0);
-}
-
-static int
msdosfs_vptofh(vp, fhp)
struct vnode *vp;
struct fid *fhp;
@@ -976,7 +956,7 @@ static struct vfsops msdosfs_vfsops = {
msdosfs_sync,
vfs_stdvget,
msdosfs_fhtovp,
- msdosfs_checkexp,
+ vfs_stdcheckexp,
msdosfs_vptofh,
msdosfs_init,
msdosfs_uninit,
diff --git a/sys/fs/msdosfs/msdosfsmount.h b/sys/fs/msdosfs/msdosfsmount.h
index da49190..1c9a890 100644
--- a/sys/fs/msdosfs/msdosfsmount.h
+++ b/sys/fs/msdosfs/msdosfsmount.h
@@ -92,7 +92,6 @@ struct msdosfsmount {
u_int pm_curfat; /* current fat for FAT32 (0 otherwise) */
u_int *pm_inusemap; /* ptr to bitmap of in-use clusters */
u_int pm_flags; /* see below */
- struct netexport pm_export; /* export information */
u_int16_t pm_u2w[128]; /* Local->Unicode table */
u_int8_t pm_ul[128]; /* Local upper->lower table */
u_int8_t pm_lu[128]; /* Local lower->upper table */
diff --git a/sys/fs/ntfs/ntfs.h b/sys/fs/ntfs/ntfs.h
index 9bf7751..d74fe6f 100644
--- a/sys/fs/ntfs/ntfs.h
+++ b/sys/fs/ntfs/ntfs.h
@@ -255,7 +255,9 @@ struct ntfsmount {
cn_t ntm_cfree;
struct ntvattrdef *ntm_ad;
int ntm_adnum;
+#if !defined(__FreeBSD__)
struct netexport ntm_export; /* export information */
+#endif
};
#define ntm_mftcn ntm_bootfile.bf_mftcn
diff --git a/sys/fs/ntfs/ntfs_vfsops.c b/sys/fs/ntfs/ntfs_vfsops.c
index 89a7dd7..b6fde8e 100644
--- a/sys/fs/ntfs/ntfs_vfsops.c
+++ b/sys/fs/ntfs/ntfs_vfsops.c
@@ -99,8 +99,6 @@ struct sockaddr;
static int ntfs_mount __P((struct mount *, char *, caddr_t,
struct nameidata *, struct proc *));
static int ntfs_init __P((struct vfsconf *));
-static int ntfs_checkexp __P((struct mount *, struct sockaddr *,
- int *, struct ucred **));
#elif defined(__NetBSD__)
static int ntfs_mount __P((struct mount *, const char *, void *,
struct nameidata *, struct proc *));
@@ -116,19 +114,13 @@ static int ntfs_checkexp __P((struct mount *, struct mbuf *,
* Verify a remote client has export rights and return these rights via.
* exflagsp and credanonp.
*/
+#if !defined(__FreeBSD__)
static int
ntfs_checkexp(mp, nam, exflagsp, credanonp)
-#if defined(__FreeBSD__)
- register struct mount *mp;
- struct sockaddr *nam;
- int *exflagsp;
- struct ucred **credanonp;
-#else /* defined(__NetBSD__) */
register struct mount *mp;
struct mbuf *nam;
int *exflagsp;
struct ucred **credanonp;
-#endif
{
register struct netcred *np;
register struct ntfsmount *ntm = VFSTONTFS(mp);
@@ -139,11 +131,11 @@ ntfs_checkexp(mp, nam, exflagsp, credanonp)
np = vfs_export_lookup(mp, &ntm->ntm_export, nam);
if (np == NULL)
return (EACCES);
-
*exflagsp = np->netc_exflags;
*credanonp = &np->netc_anon;
return (0);
}
+#endif
#if defined(__NetBSD__)
/*ARGSUSED*/
@@ -306,8 +298,12 @@ ntfs_mount (
* Process export requests. Jumping to "success"
* will return the vfs_export() error code.
*/
+#if defined(__FreeBSD__)
+ err = vfs_export(mp, &args.export);
+#else /* defined(__NetBSD__) */
struct ntfsmount *ntm = VFSTONTFS(mp);
err = vfs_export(mp, &ntm->ntm_export, &args.export);
+#endif
goto success;
}
@@ -1007,7 +1003,7 @@ static struct vfsops ntfs_vfsops = {
vfs_stdsync,
ntfs_vget,
ntfs_fhtovp,
- ntfs_checkexp,
+ vfs_stdcheckexp,
ntfs_vptofh,
ntfs_init,
ntfs_uninit,
OpenPOWER on IntegriCloud