diff options
| author | jmmv <jmmv@NetBSD.org> | 2005-09-23 12:10:31 +0000 |
|---|---|---|
| committer | jmmv <jmmv@NetBSD.org> | 2005-09-23 12:10:31 +0000 |
| commit | 2a3e5eeb7c33daf98dff2ff04f324a4d0dac3f8f (patch) | |
| tree | 342a37e6145db64e2c8df120aeb2f5fc5c387f69 /sys/fs | |
| parent | 992367dcfc1c1310e9196564c7569c5263f01004 (diff) | |
Apply the NFS exports list rototill patch:
- Remove all NFS related stuff from file system specific code.
- Drop the vfs_checkexp hook and generalize it in the new nfs_check_export
function, thus removing redundancy from all file systems.
- Move all NFS export-related stuff from kern/vfs_subr.c to the new
file sys/nfs/nfs_export.c. The former was becoming large and its code
is always compiled, regardless of the build options. Using the latter,
the code is only compiled in when NFSSERVER is enabled. While doing this,
also make some functions in nfs_subs.c conditional to NFSSERVER.
- Add a new command in nfssvc(2), called NFSSVC_SETEXPORTSLIST, that takes a
path and a set of export entries. At the moment it can only clear the
exports list or append entries, one by one, but it is done in a way that
allows setting the whole set of entries atomically in the future (see the
comment in mountd_set_exports_list or in doc/TODO).
- Change mountd(8) to use the nfssvc(2) system call instead of mount(2) so
that it becomes file system agnostic. In fact, all this whole thing was
done to remove a 'XXX' block from this utility!
- Change the mount*, newfs and fsck* userland utilities to not deal with NFS
exports initialization; done internally by the kernel when initializing
the NFS support for each file system.
- Implement an interface for VFS (called VFS hooks) so that several kernel
subsystems can run arbitrary code upon receipt of specific VFS events.
At the moment, this only provides support for unmount and is used to
destroy NFS exports lists from the file systems being unmounted, though it
has room for extension.
Thanks go to yamt@, chs@, thorpej@, wrstuden@ and others for their comments
and advice in the development of this patch.
Diffstat (limited to 'sys/fs')
| -rw-r--r-- | sys/fs/adosfs/adosfs.h | 5 | ||||
| -rw-r--r-- | sys/fs/adosfs/advfsops.c | 51 | ||||
| -rw-r--r-- | sys/fs/cd9660/cd9660_extern.h | 5 | ||||
| -rw-r--r-- | sys/fs/cd9660/cd9660_mount.h | 4 | ||||
| -rw-r--r-- | sys/fs/cd9660/cd9660_vfsops.c | 47 | ||||
| -rw-r--r-- | sys/fs/filecorefs/filecore_extern.h | 3 | ||||
| -rw-r--r-- | sys/fs/filecorefs/filecore_mount.h | 4 | ||||
| -rw-r--r-- | sys/fs/filecorefs/filecore_vfsops.c | 42 | ||||
| -rw-r--r-- | sys/fs/msdosfs/msdosfs_vfsops.c | 43 | ||||
| -rw-r--r-- | sys/fs/msdosfs/msdosfsmount.h | 5 | ||||
| -rw-r--r-- | sys/fs/ntfs/ntfs.h | 3 | ||||
| -rw-r--r-- | sys/fs/ntfs/ntfs_vfsops.c | 44 | ||||
| -rw-r--r-- | sys/fs/ntfs/ntfsmount.h | 4 | ||||
| -rw-r--r-- | sys/fs/ptyfs/ptyfs_vfsops.c | 34 | ||||
| -rw-r--r-- | sys/fs/smbfs/smbfs.h | 3 | ||||
| -rw-r--r-- | sys/fs/smbfs/smbfs_vfsops.c | 34 | ||||
| -rw-r--r-- | sys/fs/tmpfs/tmpfs.h | 11 | ||||
| -rw-r--r-- | sys/fs/tmpfs/tmpfs_vfsops.c | 41 | ||||
| -rw-r--r-- | sys/fs/union/union_vfsops.c | 47 |
19 files changed, 51 insertions, 379 deletions
diff --git a/sys/fs/adosfs/adosfs.h b/sys/fs/adosfs/adosfs.h index 4c15c6a0f37..9ce1d17856b 100644 --- a/sys/fs/adosfs/adosfs.h +++ b/sys/fs/adosfs/adosfs.h @@ -1,4 +1,4 @@ -/* $NetBSD: adosfs.h,v 1.5 2005/02/26 22:58:54 perry Exp $ */ +/* $NetBSD: adosfs.h,v 1.6 2005/09/23 12:10:32 jmmv Exp $ */ /* * Copyright (c) 1994 Christian E. Hopps @@ -36,7 +36,7 @@ */ struct adosfs_args { char *fspec; /* blocks special holding the fs to mount */ - struct export_args export; /* network export information */ + struct compat_export_args _pad1; /* compat with old userland tools */ uid_t uid; /* uid that owns adosfs files */ gid_t gid; /* gid that owns adosfs files */ mode_t mask; /* mask to be applied for adosfs perms */ @@ -123,7 +123,6 @@ struct adosfsmount { u_long mask; /* mode mask */ struct vnode *devvp; /* blk device mounted on */ struct vnode *rootvp; /* out root vnode */ - struct netexport export; u_long *bitmap; /* allocation bitmap */ u_long numblks; /* number of usable blocks */ u_long freeblks; /* number of free blocks */ diff --git a/sys/fs/adosfs/advfsops.c b/sys/fs/adosfs/advfsops.c index 4685102ea9c..b0fec819bcc 100644 --- a/sys/fs/adosfs/advfsops.c +++ b/sys/fs/adosfs/advfsops.c @@ -1,4 +1,4 @@ -/* $NetBSD: advfsops.c,v 1.24 2005/08/19 04:15:02 christos Exp $ */ +/* $NetBSD: advfsops.c,v 1.25 2005/09/23 12:10:32 jmmv Exp $ */ /* * Copyright (c) 1994 Christian E. Hopps @@ -32,7 +32,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: advfsops.c,v 1.24 2005/08/19 04:15:02 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: advfsops.c,v 1.25 2005/09/23 12:10:32 jmmv Exp $"); #if defined(_KERNEL_OPT) #include "opt_compat_netbsd.h" @@ -70,8 +70,6 @@ int adosfs_statvfs __P((struct mount *, struct statvfs *, struct proc *)); int adosfs_sync __P((struct mount *, int, struct ucred *, struct proc *)); int adosfs_vget __P((struct mount *, ino_t, struct vnode **)); int adosfs_fhtovp __P((struct mount *, struct fid *, struct vnode **)); -int adosfs_checkexp __P((struct mount *, struct mbuf *, int *, - struct ucred **)); int adosfs_vptofh __P((struct vnode *, struct fid *)); int adosfs_mountfs __P((struct vnode *, struct mount *, struct proc *)); @@ -114,7 +112,6 @@ adosfs_mount(mp, path, data, ndp, p) args.gid = amp->gid; args.mask = amp->mask; args.fspec = NULL; - vfs_showexport(mp, &args.export, &->export); return copyout(&args, data, sizeof(args)); } error = copyin(data, &args, sizeof(struct adosfs_args)); @@ -123,15 +120,10 @@ adosfs_mount(mp, path, data, ndp, p) if ((mp->mnt_flag & MNT_RDONLY) == 0) return (EROFS); - /* - * If updating, check whether changing from read-only to - * read/write; if there is no device name, that's all we do. - */ - if (mp->mnt_flag & MNT_UPDATE) { - amp = VFSTOADOSFS(mp); - if (args.fspec == 0) - return (vfs_export(mp, &->export, &args.export)); - } + + if ((mp->mnt_flag & MNT_UPDATE) && args.fspec == NULL) + return EOPNOTSUPP; + /* * Not an update, or updating the name: look up the name * and verify that it refers to a sensible block device. @@ -740,35 +732,6 @@ adosfs_fhtovp(mp, fhp, vpp) } int -adosfs_checkexp(mp, nam, exflagsp, credanonp) - struct mount *mp; - struct mbuf *nam; - int *exflagsp; - struct ucred **credanonp; -{ - struct adosfsmount *amp = VFSTOADOSFS(mp); -#if 0 - struct anode *ap; -#endif - struct netcred *np; - -#ifdef ADOSFS_DIAGNOSTIC - printf("adcheckexp(%x, %x, %x)\n", mp, nam, exflagsp); -#endif - - /* - * Get the export permission structure for this <mp, client> tuple. - */ - np = vfs_export_lookup(mp, &->export, nam); - if (np == NULL) - return (EACCES); - - *exflagsp = np->netc_exflags; - *credanonp = &np->netc_anon; - return(0); -} - -int adosfs_vptofh(vp, fhp) struct vnode *vp; struct fid *fhp; @@ -883,9 +846,7 @@ struct vfsops adosfs_vfsops = { adosfs_init, NULL, adosfs_done, - NULL, NULL, /* vfs_mountroot */ - adosfs_checkexp, (int (*)(struct mount *, struct vnode *, struct timespec *)) eopnotsupp, vfs_stdextattrctl, adosfs_vnodeopv_descs, diff --git a/sys/fs/cd9660/cd9660_extern.h b/sys/fs/cd9660/cd9660_extern.h index eedfa3a9183..7dbd601eff5 100644 --- a/sys/fs/cd9660/cd9660_extern.h +++ b/sys/fs/cd9660/cd9660_extern.h @@ -1,4 +1,4 @@ -/* $NetBSD: cd9660_extern.h,v 1.14 2005/08/30 18:47:19 xtraeme Exp $ */ +/* $NetBSD: cd9660_extern.h,v 1.15 2005/09/23 12:10:32 jmmv Exp $ */ /*- * Copyright (c) 1994 @@ -74,7 +74,6 @@ struct iso_mnt { int im_bmask; int volume_space_size; - struct netexport im_export; char root[ISODCL (157, 190)]; int root_extent; @@ -105,8 +104,6 @@ int cd9660_statvfs(struct mount *, struct statvfs *, struct proc *); int cd9660_sync(struct mount *, int, struct ucred *, struct proc *); int cd9660_vget(struct mount *, ino_t, struct vnode **); int cd9660_fhtovp(struct mount *, struct fid *, struct vnode **); -int cd9660_check_export(struct mount *, struct mbuf *, int *, - struct ucred **); int cd9660_vptofh(struct vnode *, struct fid *); void cd9660_init(void); void cd9660_reinit(void); diff --git a/sys/fs/cd9660/cd9660_mount.h b/sys/fs/cd9660/cd9660_mount.h index 5b0c62ca022..8e71ebb0848 100644 --- a/sys/fs/cd9660/cd9660_mount.h +++ b/sys/fs/cd9660/cd9660_mount.h @@ -1,4 +1,4 @@ -/* $NetBSD: cd9660_mount.h,v 1.3 2003/10/03 16:34:31 yamt Exp $ */ +/* $NetBSD: cd9660_mount.h,v 1.4 2005/09/23 12:10:32 jmmv Exp $ */ /* * Copyright (c) 1995 * The Regents of the University of California. All rights reserved. @@ -40,7 +40,7 @@ */ struct iso_args { const char *fspec; /* block special device to mount */ - struct export_args export; /* network export info */ + struct compat_export_args _pad1; /* compat with old userland tools */ int flags; /* mounting flags, see below */ }; #define ISOFSMNT_NORRIP 0x00000001 /* disable Rock Ridge Ext.*/ diff --git a/sys/fs/cd9660/cd9660_vfsops.c b/sys/fs/cd9660/cd9660_vfsops.c index 7170ced5bc1..1c22001c355 100644 --- a/sys/fs/cd9660/cd9660_vfsops.c +++ b/sys/fs/cd9660/cd9660_vfsops.c @@ -1,4 +1,4 @@ -/* $NetBSD: cd9660_vfsops.c,v 1.26 2005/08/30 18:47:19 xtraeme Exp $ */ +/* $NetBSD: cd9660_vfsops.c,v 1.27 2005/09/23 12:10:32 jmmv Exp $ */ /*- * Copyright (c) 1994 @@ -37,7 +37,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: cd9660_vfsops.c,v 1.26 2005/08/30 18:47:19 xtraeme Exp $"); +__KERNEL_RCSID(0, "$NetBSD: cd9660_vfsops.c,v 1.27 2005/09/23 12:10:32 jmmv Exp $"); #if defined(_KERNEL_OPT) #include "opt_compat_netbsd.h" @@ -99,9 +99,7 @@ struct vfsops cd9660_vfsops = { cd9660_init, cd9660_reinit, cd9660_done, - NULL, cd9660_mountroot, - cd9660_check_export, (int (*)(struct mount *, struct vnode *, struct timespec *)) eopnotsupp, vfs_stdextattrctl, cd9660_vnodeopv_descs, @@ -179,7 +177,6 @@ cd9660_mount(mp, path, data, ndp, p) return EIO; args.fspec = NULL; args.flags = imp->im_flags; - vfs_showexport(mp, &args.export, &imp->im_export); return copyout(&args, data, sizeof(args)); } error = copyin(data, &args, sizeof (struct iso_args)); @@ -189,15 +186,9 @@ cd9660_mount(mp, path, data, ndp, p) if ((mp->mnt_flag & MNT_RDONLY) == 0) return (EROFS); - /* - * If updating, check whether changing from read-only to - * read/write; if there is no device name, that's all we do. - */ - if (mp->mnt_flag & MNT_UPDATE) { - imp = VFSTOISOFS(mp); - if (args.fspec == 0) - return (vfs_export(mp, &imp->im_export, &args.export)); - } + if ((mp->mnt_flag & MNT_UPDATE) && args.fspec == NULL) + return EINVAL; + /* * Not an update, or updating the name: look up the name * and verify that it refers to a sensible block device. @@ -697,34 +688,6 @@ cd9660_fhtovp(mp, fhp, vpp) return (0); } -/* ARGSUSED */ -int -cd9660_check_export(mp, nam, exflagsp, credanonp) - struct mount *mp; - struct mbuf *nam; - int *exflagsp; - struct ucred **credanonp; -{ - struct netcred *np; - struct iso_mnt *imp = VFSTOISOFS(mp); - -#ifdef ISOFS_DBG - printf("check_export: ino %d, start %ld\n", - ifhp->ifid_ino, ifhp->ifid_start); -#endif - - /* - * 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; diff --git a/sys/fs/filecorefs/filecore_extern.h b/sys/fs/filecorefs/filecore_extern.h index 182e813ffae..e09dfe211ac 100644 --- a/sys/fs/filecorefs/filecore_extern.h +++ b/sys/fs/filecorefs/filecore_extern.h @@ -1,4 +1,4 @@ -/* $NetBSD: filecore_extern.h,v 1.9 2004/05/20 06:34:26 atatat Exp $ */ +/* $NetBSD: filecore_extern.h,v 1.10 2005/09/23 12:10:32 jmmv Exp $ */ /*- * Copyright (c) 1994 The Regents of the University of California. @@ -92,7 +92,6 @@ struct filecore_mnt { uid_t fc_uid; /* uid to set as owner of the files */ gid_t fc_gid; /* gid to set as owner of the files */ int fc_mntflags; - struct netexport fc_export; struct filecore_disc_record drec; }; diff --git a/sys/fs/filecorefs/filecore_mount.h b/sys/fs/filecorefs/filecore_mount.h index fc49932c889..1639ed0b242 100644 --- a/sys/fs/filecorefs/filecore_mount.h +++ b/sys/fs/filecorefs/filecore_mount.h @@ -1,4 +1,4 @@ -/* $NetBSD: filecore_mount.h,v 1.3 2003/10/03 16:34:31 yamt Exp $ */ +/* $NetBSD: filecore_mount.h,v 1.4 2005/09/23 12:10:32 jmmv Exp $ */ /* * Copyright (c) 1995 The Regents of the University of California. @@ -70,7 +70,7 @@ */ struct filecore_args { char *fspec; /* block special device to mount */ - struct export_args export; /* network export info */ + struct compat_export_args _pad1; /* compat with old userland tools */ uid_t uid; /* uid that owns filecore files */ gid_t gid; /* gid that owns filecore files */ int flags; /* mounting flags, see below */ diff --git a/sys/fs/filecorefs/filecore_vfsops.c b/sys/fs/filecorefs/filecore_vfsops.c index 16dcf1c6c7d..e92758c0179 100644 --- a/sys/fs/filecorefs/filecore_vfsops.c +++ b/sys/fs/filecorefs/filecore_vfsops.c @@ -1,4 +1,4 @@ -/* $NetBSD: filecore_vfsops.c,v 1.20 2005/06/28 09:30:37 yamt Exp $ */ +/* $NetBSD: filecore_vfsops.c,v 1.21 2005/09/23 12:10:32 jmmv Exp $ */ /*- * Copyright (c) 1994 The Regents of the University of California. @@ -66,7 +66,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: filecore_vfsops.c,v 1.20 2005/06/28 09:30:37 yamt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: filecore_vfsops.c,v 1.21 2005/09/23 12:10:32 jmmv Exp $"); #if defined(_KERNEL_OPT) #include "opt_compat_netbsd.h" @@ -117,9 +117,7 @@ struct vfsops filecore_vfsops = { filecore_init, filecore_reinit, filecore_done, - NULL, NULL, /* filecore_mountroot */ - filecore_checkexp, (int (*)(struct mount *, struct vnode *, struct timespec *)) eopnotsupp, vfs_stdextattrctl, filecore_vnodeopv_descs, @@ -203,7 +201,6 @@ filecore_mount(mp, path, data, ndp, p) args.uid = fcmp->fc_uid; args.gid = fcmp->fc_gid; args.fspec = NULL; - vfs_showexport(mp, &args.export, &fcmp->fc_export); return copyout(&args, data, sizeof(args)); } error = copyin(data, &args, sizeof (struct filecore_args)); @@ -213,15 +210,9 @@ filecore_mount(mp, path, data, ndp, p) if ((mp->mnt_flag & MNT_RDONLY) == 0) return (EROFS); - /* - * If updating, check whether changing from read-only to - * read/write; if there is no device name, that's all we do. - */ - if (mp->mnt_flag & MNT_UPDATE) { - fcmp = VFSTOFILECORE(mp); - if (args.fspec == 0) - return (vfs_export(mp, &fcmp->fc_export, &args.export)); - } + if ((mp->mnt_flag & MNT_UPDATE) && args.fspec == NULL) + return EINVAL; + /* * Not an update, or updating the name: look up the name * and verify that it refers to a sensible block device. @@ -569,29 +560,6 @@ filecore_fhtovp(mp, fhp, vpp) return (0); } -/* ARGSUSED */ -int -filecore_checkexp(mp, nam, exflagsp, credanonp) - struct mount *mp; - struct mbuf *nam; - int *exflagsp; - struct ucred **credanonp; -{ - struct filecore_mnt *fcmp = VFSTOFILECORE(mp); - struct netcred *np; - - /* - * Get the export permission structure for this <mp, client> tuple. - */ - np = vfs_export_lookup(mp, &fcmp->fc_export, nam); - if (np == NULL) - return (EACCES); - - *exflagsp = np->netc_exflags; - *credanonp = &np->netc_anon; - return (0); -} - /* This looks complicated. Look at other vgets as well as the iso9660 one. * * The filecore inode number is made up of 1 byte directory entry index and diff --git a/sys/fs/msdosfs/msdosfs_vfsops.c b/sys/fs/msdosfs/msdosfs_vfsops.c index cb034d94e5b..d37996f1155 100644 --- a/sys/fs/msdosfs/msdosfs_vfsops.c +++ b/sys/fs/msdosfs/msdosfs_vfsops.c @@ -1,4 +1,4 @@ -/* $NetBSD: msdosfs_vfsops.c,v 1.27 2005/09/10 17:33:45 christos Exp $ */ +/* $NetBSD: msdosfs_vfsops.c,v 1.28 2005/09/23 12:10:32 jmmv Exp $ */ /*- * Copyright (C) 1994, 1995, 1997 Wolfgang Solfrank. @@ -48,7 +48,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: msdosfs_vfsops.c,v 1.27 2005/09/10 17:33:45 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: msdosfs_vfsops.c,v 1.28 2005/09/23 12:10:32 jmmv Exp $"); #if defined(_KERNEL_OPT) #include "opt_quota.h" @@ -95,8 +95,6 @@ int msdosfs_statvfs(struct mount *, struct statvfs *, struct proc *); int msdosfs_sync(struct mount *, int, struct ucred *, struct proc *); int msdosfs_vget(struct mount *, ino_t, struct vnode **); int msdosfs_fhtovp(struct mount *, struct fid *, struct vnode **); -int msdosfs_checkexp(struct mount *, struct mbuf *, int *, - struct ucred **); int msdosfs_vptofh(struct vnode *, struct fid *); int msdosfs_mountfs(struct vnode *, struct mount *, struct proc *, @@ -131,9 +129,7 @@ struct vfsops msdosfs_vfsops = { msdosfs_init, msdosfs_reinit, msdosfs_done, - NULL, msdosfs_mountroot, - msdosfs_checkexp, (int (*)(struct mount *, struct vnode *, struct timespec *)) eopnotsupp, vfs_stdextattrctl, msdosfs_vnodeopv_descs, @@ -265,7 +261,6 @@ msdosfs_mount(mp, path, data, ndp, p) args.version = MSDOSFSMNT_VERSION; args.dirmask = pmp->pm_dirmask; args.gmtoff = pmp->pm_gmtoff; - vfs_showexport(mp, &args.export, &pmp->pm_export); return copyout(&args, data, sizeof(args)); } error = copyin(data, &args, sizeof(struct msdosfs_args)); @@ -321,20 +316,8 @@ msdosfs_mount(mp, path, data, ndp, p) } pmp->pm_flags &= ~MSDOSFSMNT_RONLY; } - if (args.fspec == 0) { -#ifdef __notyet__ /* doesn't work correctly with current mountd XXX */ - if (args.flags & MSDOSFSMNT_MNTOPT) { - pmp->pm_flags &= ~MSDOSFSMNT_MNTOPT; - pmp->pm_flags |= args.flags & MSDOSFSMNT_MNTOPT; - if (pmp->pm_flags & MSDOSFSMNT_NOWIN95) - pmp->pm_flags |= MSDOSFSMNT_SHORTNAME; - } -#endif - /* - * Process export requests. - */ - return (vfs_export(mp, &pmp->pm_export, &args.export)); - } + if (args.fspec == NULL) + return EINVAL; } /* * Not an update, or updating the name: look up the name @@ -993,24 +976,6 @@ msdosfs_fhtovp(mp, fhp, vpp) } int -msdosfs_checkexp(mp, nam, exflagsp, credanonp) - struct mount *mp; - struct mbuf *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); -} - -int msdosfs_vptofh(vp, fhp) struct vnode *vp; struct fid *fhp; diff --git a/sys/fs/msdosfs/msdosfsmount.h b/sys/fs/msdosfs/msdosfsmount.h index e32719c0560..4a3d2e3147f 100644 --- a/sys/fs/msdosfs/msdosfsmount.h +++ b/sys/fs/msdosfs/msdosfsmount.h @@ -1,4 +1,4 @@ -/* $NetBSD: msdosfsmount.h,v 1.8 2005/08/30 18:49:19 xtraeme Exp $ */ +/* $NetBSD: msdosfsmount.h,v 1.9 2005/09/23 12:10:32 jmmv Exp $ */ /*- * Copyright (C) 1994, 1995, 1997 Wolfgang Solfrank. @@ -52,7 +52,7 @@ */ struct msdosfs_args { char *fspec; /* blocks special holding the fs to mount */ - struct export_args export; /* network export information */ + struct compat_export_args _pad1; /* compat with old userland tools */ uid_t uid; /* uid that owns msdosfs files */ gid_t gid; /* gid that owns msdosfs files */ mode_t mask; /* mask to be applied for msdosfs perms */ @@ -130,7 +130,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 */ }; /* Byte offset in FAT on filesystem pmp, cluster cn */ #define FATOFS(pmp, cn) ((cn) * (pmp)->pm_fatmult / (pmp)->pm_fatdiv) diff --git a/sys/fs/ntfs/ntfs.h b/sys/fs/ntfs/ntfs.h index 49087f54207..48839f44661 100644 --- a/sys/fs/ntfs/ntfs.h +++ b/sys/fs/ntfs/ntfs.h @@ -1,4 +1,4 @@ -/* $NetBSD: ntfs.h,v 1.9 2005/08/30 19:01:29 xtraeme Exp $ */ +/* $NetBSD: ntfs.h,v 1.10 2005/09/23 12:10:32 jmmv Exp $ */ /*- * Copyright (c) 1998, 1999 Semen Ustimenko @@ -261,7 +261,6 @@ struct ntfsmount { cn_t ntm_cfree; struct ntvattrdef *ntm_ad; int ntm_adnum; - struct netexport ntm_export; /* export information */ ntfs_wget_func_t *ntm_wget; /* decode string to Unicode string */ ntfs_wput_func_t *ntm_wput; /* encode Unicode string to string */ ntfs_wcmp_func_t *ntm_wcmp; /* compare to wide characters */ diff --git a/sys/fs/ntfs/ntfs_vfsops.c b/sys/fs/ntfs/ntfs_vfsops.c index c014a57a42d..3af99d661ea 100644 --- a/sys/fs/ntfs/ntfs_vfsops.c +++ b/sys/fs/ntfs/ntfs_vfsops.c @@ -1,4 +1,4 @@ -/* $NetBSD: ntfs_vfsops.c,v 1.33 2005/08/30 19:01:30 xtraeme Exp $ */ +/* $NetBSD: ntfs_vfsops.c,v 1.34 2005/09/23 12:10:32 jmmv Exp $ */ /*- * Copyright (c) 1998, 1999 Semen Ustimenko @@ -29,7 +29,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: ntfs_vfsops.c,v 1.33 2005/08/30 19:01:30 xtraeme Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ntfs_vfsops.c,v 1.34 2005/09/23 12:10:32 jmmv Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -99,8 +99,6 @@ static void ntfs_reinit(void); static void ntfs_done(void); static int ntfs_fhtovp(struct mount *, struct fid *, struct vnode **); -static int ntfs_checkexp(struct mount *, struct mbuf *, - int *, struct ucred **); static int ntfs_mountroot(void); #else static int ntfs_init(void); @@ -114,31 +112,6 @@ static const struct genfs_ops ntfs_genfsops = { }; #ifdef __NetBSD__ -/* - * Verify a remote client has export rights and return these rights via. - * exflagsp and credanonp. - */ -static int -ntfs_checkexp(mp, nam, exflagsp, credanonp) - struct mount *mp; - struct mbuf *nam; - int *exflagsp; - struct ucred **credanonp; -{ - struct netcred *np; - struct ntfsmount *ntm = VFSTONTFS(mp); - - /* - * Get the export permission structure for this <mp, client> tuple. - */ - np = vfs_export_lookup(mp, &ntm->ntm_export, nam); - if (np == NULL) - return (EACCES); - - *exflagsp = np->netc_exflags; - *credanonp = &np->netc_anon; - return (0); -} SYSCTL_SETUP(sysctl_vfs_ntfs_setup, "sysctl vfs.ntfs subtree setup") { @@ -277,7 +250,6 @@ ntfs_mount ( args.gid = ntmp->ntm_gid; args.mode = ntmp->ntm_mode; args.flag = ntmp->ntm_flag; - vfs_showexport(mp, &args.export, &ntmp->ntm_export); return copyout(&args, data, sizeof(args)); } /* @@ -296,16 +268,6 @@ ntfs_mount ( * read/write; if there is no device name, that's all we do. */ if (mp->mnt_flag & MNT_UPDATE) { - /* if not updating name...*/ - if (args.fspec == 0) { - /* - * Process export requests. Jumping to "success" - * will return the vfs_export() error code. - */ - struct ntfsmount *ntm = VFSTONTFS(mp); - return (vfs_export(mp, &ntm->ntm_export, &args.export)); - } - printf("ntfs_mount(): MNT_UPDATE not supported\n"); return (EINVAL); } @@ -1027,9 +989,7 @@ struct vfsops ntfs_vfsops = { ntfs_init, ntfs_reinit, ntfs_done, - NULL, ntfs_mountroot, - ntfs_checkexp, (int (*)(struct mount *, struct vnode *, struct timespec *)) eopnotsupp, vfs_stdextattrctl, ntfs_vnodeopv_descs, diff --git a/sys/fs/ntfs/ntfsmount.h b/sys/fs/ntfs/ntfsmount.h index 7a81aa7eb1f..477b8022f36 100644 --- a/sys/fs/ntfs/ntfsmount.h +++ b/sys/fs/ntfs/ntfsmount.h @@ -1,4 +1,4 @@ -/* $NetBSD: ntfsmount.h,v 1.2 2003/10/03 16:34:31 yamt Exp $ */ +/* $NetBSD: ntfsmount.h,v 1.3 2005/09/23 12:10:32 jmmv Exp $ */ /*- * Copyright (c) 1998, 1999 Semen Ustimenko @@ -33,7 +33,7 @@ struct ntfs_args { char *fspec; /* block special device to mount */ - struct export_args export; /* network export information */ + struct compat_export_args _pad1; /* compat with old userland tools */ uid_t uid; /* uid that owns ntfs files */ gid_t gid; /* gid that owns ntfs files */ mode_t mode; /* mask to be applied for ntfs perms */ diff --git a/sys/fs/ptyfs/ptyfs_vfsops.c b/sys/fs/ptyfs/ptyfs_vfsops.c index c384d4abed7..1696bdc9ecd 100644 --- a/sys/fs/ptyfs/ptyfs_vfsops.c +++ b/sys/fs/ptyfs/ptyfs_vfsops.c @@ -1,4 +1,4 @@ -/* $NetBSD: ptyfs_vfsops.c,v 1.8 2005/05/29 21:00:29 christos Exp $ */ +/* $NetBSD: ptyfs_vfsops.c,v 1.9 2005/09/23 12:10:32 jmmv Exp $ */ /* * Copyright (c) 1992, 1993, 1995 @@ -38,7 +38,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: ptyfs_vfsops.c,v 1.8 2005/05/29 21:00:29 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ptyfs_vfsops.c,v 1.9 2005/09/23 12:10:32 jmmv Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -72,9 +72,6 @@ int ptyfs_statvfs(struct mount *, struct statvfs *, struct proc *); int ptyfs_quotactl(struct mount *, int, uid_t, void *, struct proc *); int ptyfs_sync(struct mount *, int, struct ucred *, struct proc *); int ptyfs_vget(struct mount *, ino_t, struct vnode **); -int ptyfs_fhtovp(struct mount *, struct fid *, struct vnode **); -int ptyfs_checkexp(struct mount *, struct mbuf *, int *, struct ucred **); -int ptyfs_vptofh(struct vnode *, struct fid *); static int ptyfs__allocvp(struct ptm_pty *, struct proc *, struct vnode **, dev_t, char); @@ -328,20 +325,6 @@ ptyfs_vget(struct mount *mp, ino_t ino, struct vnode **vpp) return EOPNOTSUPP; } -/*ARGSUSED*/ -int -ptyfs_fhtovp(struct mount *mp, struct fid *fhp, struct vnode **vpp) -{ - return EOPNOTSUPP; -} - -/*ARGSUSED*/ -int -ptyfs_checkexp(struct mount *mp, struct mbuf *mb, int *wh, struct ucred **anon) -{ - return EOPNOTSUPP; -} - SYSCTL_SETUP(sysctl_vfs_ptyfs_setup, "sysctl vfs.ptyfs subtree setup") { @@ -364,13 +347,6 @@ SYSCTL_SETUP(sysctl_vfs_ptyfs_setup, "sysctl vfs.ptyfs subtree setup") } -/*ARGSUSED*/ -int -ptyfs_vptofh(struct vnode *vp, struct fid *fhp) -{ - return EOPNOTSUPP; -} - extern const struct vnodeopv_desc ptyfs_vnodeop_opv_desc; const struct vnodeopv_desc * const ptyfs_vnodeopv_descs[] = { @@ -388,14 +364,12 @@ struct vfsops ptyfs_vfsops = { ptyfs_statvfs, ptyfs_sync, ptyfs_vget, - ptyfs_fhtovp, - ptyfs_vptofh, + NULL, /* vfs_fhtovp */ + NULL, /* vfs_vptofp */ ptyfs_init, ptyfs_reinit, ptyfs_done, - NULL, NULL, /* vfs_mountroot */ - ptyfs_checkexp, (int (*)(struct mount *, struct vnode *, struct timespec *))eopnotsupp, (int (*)(struct mount *, int, struct vnode *, int, const char *, struct proc *))eopnotsupp, diff --git a/sys/fs/smbfs/smbfs.h b/sys/fs/smbfs/smbfs.h index f8bccaec48c..88216f92446 100644 --- a/sys/fs/smbfs/smbfs.h +++ b/sys/fs/smbfs/smbfs.h @@ -1,4 +1,4 @@ -/* $NetBSD: smbfs.h,v 1.10 2005/02/26 22:58:55 perry Exp $ */ +/* $NetBSD: smbfs.h,v 1.11 2005/09/23 12:10:32 jmmv Exp $ */ /* * Copyright (c) 2000-2001, Boris Popov @@ -61,7 +61,6 @@ struct smbfs_args { mode_t file_mode; mode_t dir_mode; int caseopt; - struct export_args export; /* network export information */ }; #ifdef _KERNEL diff --git a/sys/fs/smbfs/smbfs_vfsops.c b/sys/fs/smbfs/smbfs_vfsops.c index 69f7ab48e5f..e1ea51e43b6 100644 --- a/sys/fs/smbfs/smbfs_vfsops.c +++ b/sys/fs/smbfs/smbfs_vfsops.c @@ -1,4 +1,4 @@ -/* $NetBSD: smbfs_vfsops.c,v 1.49 2005/06/20 02:49:19 atatat Exp $ */ +/* $NetBSD: smbfs_vfsops.c,v 1.50 2005/09/23 12:10:32 jmmv Exp $ */ /* * Copyright (c) 2000-2001, Boris Popov @@ -35,7 +35,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: smbfs_vfsops.c,v 1.49 2005/06/20 02:49:19 atatat Exp $"); +__KERNEL_RCSID(0, "$NetBSD: smbfs_vfsops.c,v 1.50 2005/09/23 12:10:32 jmmv Exp $"); #ifdef _KERNEL_OPT #include "opt_quota.h" @@ -109,8 +109,6 @@ void smbfs_reinit(void); void smbfs_done(void); int smbfs_vget(struct mount *mp, ino_t ino, struct vnode **vpp); -int smbfs_fhtovp(struct mount *, struct fid *, struct vnode **); -int smbfs_vptofh(struct vnode *, struct fid *); POOL_INIT(smbfs_node_pool, sizeof(struct smbnode), 0, 0, 0, "smbfsnopl", &pool_allocator_nointr); @@ -131,15 +129,12 @@ struct vfsops smbfs_vfsops = { smbfs_statvfs, smbfs_sync, smbfs_vget, - smbfs_fhtovp, - smbfs_vptofh, + NULL, /* vfs_fhtovp */ + NULL, /* vfs_vptofh */ smbfs_init, smbfs_reinit, smbfs_done, - NULL, (int (*) (void)) eopnotsupp, /* mountroot */ - (int (*) (struct mount *, struct mbuf *, int *, - struct ucred **)) eopnotsupp, /* checkexp */ (int (*)(struct mount *, struct vnode *, struct timespec *)) eopnotsupp, vfs_stdextattrctl, smbfs_vnodeopv_descs, @@ -492,25 +487,4 @@ int smbfs_vget(mp, ino, vpp) return (EOPNOTSUPP); } -/* ARGSUSED */ -int smbfs_fhtovp(mp, fhp, vpp) - struct mount *mp; - struct fid *fhp; - struct vnode **vpp; -{ - return (EINVAL); -} - -/* - * Vnode pointer to File handle, should never happen either - */ -/* ARGSUSED */ -int -smbfs_vptofh(vp, fhp) - struct vnode *vp; - struct fid *fhp; -{ - return (EINVAL); -} - #endif /* __FreeBSD_version < 400009 */ diff --git a/sys/fs/tmpfs/tmpfs.h b/sys/fs/tmpfs/tmpfs.h index 4f98f11e12e..0aaa22e3637 100644 --- a/sys/fs/tmpfs/tmpfs.h +++ b/sys/fs/tmpfs/tmpfs.h @@ -1,4 +1,4 @@ -/* $NetBSD: tmpfs.h,v 1.4 2005/09/15 12:34:35 yamt Exp $ */ +/* $NetBSD: tmpfs.h,v 1.5 2005/09/23 12:10:32 jmmv Exp $ */ /* * Copyright (c) 2005 The NetBSD Foundation, Inc. @@ -149,7 +149,6 @@ struct tmpfs_mount { size_t tm_pages_used; struct tmpfs_node * tm_root; - struct netexport tm_export; ino_t tm_nodes_max; ino_t tm_nodes_last; @@ -344,12 +343,4 @@ struct tmpfs_args { uid_t ta_root_uid; gid_t ta_root_gid; mode_t ta_root_mode; - - /* Used to update NFS export properties. Due to the way these - * fields are used by mountd(8), they must come first, but as - * I would like to remove this restriction, I'm placing them - * here (there is no problem in doing so because, ATM, mountd(8) - * does not recognize tmpfs). XXX */ - const char * ta_fspec; - struct export_args ta_export; }; diff --git a/sys/fs/tmpfs/tmpfs_vfsops.c b/sys/fs/tmpfs/tmpfs_vfsops.c index 568161227d5..10aea3df5b3 100644 --- a/sys/fs/tmpfs/tmpfs_vfsops.c +++ b/sys/fs/tmpfs/tmpfs_vfsops.c @@ -1,4 +1,4 @@ -/* $NetBSD: tmpfs_vfsops.c,v 1.3 2005/09/13 21:30:52 jmmv Exp $ */ +/* $NetBSD: tmpfs_vfsops.c,v 1.4 2005/09/23 12:10:32 jmmv Exp $ */ /* * Copyright (c) 2005 The NetBSD Foundation, Inc. @@ -41,7 +41,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: tmpfs_vfsops.c,v 1.3 2005/09/13 21:30:52 jmmv Exp $"); +__KERNEL_RCSID(0, "$NetBSD: tmpfs_vfsops.c,v 1.4 2005/09/23 12:10:32 jmmv Exp $"); #include <sys/param.h> #include <sys/types.h> @@ -70,8 +70,6 @@ static int tmpfs_statvfs(struct mount *, struct statvfs *, struct proc *); static int tmpfs_sync(struct mount *, int, struct ucred *, struct proc *); static void tmpfs_init(void); static void tmpfs_done(void); -static int tmpfs_checkexp(struct mount *, struct mbuf *, int *, - struct ucred **); static int tmpfs_snapshot(struct mount *, struct vnode *, struct timespec *); @@ -95,7 +93,6 @@ tmpfs_mount(struct mount *mp, const char *path, void *data, tmp = VFS_TO_TMPFS(mp); args.ta_version = TMPFS_ARGS_VERSION; - args.ta_fspec = NULL; args.ta_nodes_max = tmp->tm_nodes_max; args.ta_size_max = tmp->tm_pages_max * PAGE_SIZE; @@ -104,8 +101,6 @@ tmpfs_mount(struct mount *mp, const char *path, void *data, args.ta_root_gid = root->tn_gid; args.ta_root_mode = root->tn_mode; - vfs_showexport(mp, &args, &tmp->tm_export); - return copyout(&args, data, sizeof(args)); } @@ -119,15 +114,6 @@ tmpfs_mount(struct mount *mp, const char *path, void *data, return error; if (mp->mnt_flag & MNT_UPDATE) { - if (mp->mnt_data == NULL) - return EIO; - tmp = VFS_TO_TMPFS(mp); - - if (args.ta_fspec == NULL) { - /* Update NFS export information. */ - return vfs_export(mp, &tmp->tm_export, &args.ta_export); - } - /* XXX: There is no support yet to update file system * settings. Should be added. */ @@ -174,7 +160,6 @@ tmpfs_mount(struct mount *mp, const char *path, void *data, tmpfs_pool_init(&tmp->tm_node_pool, sizeof(struct tmpfs_node), "node", tmp); tmpfs_str_pool_init(&tmp->tm_str_pool, tmp); - bzero(&tmp->tm_export, sizeof(struct netexport)); /* Allocate the root node. */ error = tmpfs_alloc_node(tmp, VDIR, args.ta_root_uid, @@ -423,26 +408,6 @@ tmpfs_done(void) /* --------------------------------------------------------------------- */ static int -tmpfs_checkexp(struct mount *mp, struct mbuf *mb, int *wh, - struct ucred **anon) -{ - struct netcred *np; - struct tmpfs_mount *tmp; - - tmp = VFS_TO_TMPFS(mp); - - np = vfs_export_lookup(mp, &tmp->tm_export, mb); - if (np != NULL) { - *wh = np->netc_exflags; - *anon = &np->netc_anon; - } - - return np == NULL ? EACCES : 0; -} - -/* --------------------------------------------------------------------- */ - -static int tmpfs_snapshot(struct mount *mp, struct vnode *vp, struct timespec *ctime) { @@ -481,9 +446,7 @@ struct vfsops tmpfs_vfsops = { tmpfs_init, /* vfs_init */ NULL, /* vfs_reinit */ tmpfs_done, /* vfs_done */ - NULL, /* vfs_wassysctl: deprecated */ NULL, /* vfs_mountroot */ - tmpfs_checkexp, /* vfs_checkexp */ tmpfs_snapshot, /* vfs_snapshot */ vfs_stdextattrctl, /* vfs_extattrctl */ tmpfs_vnodeopv_descs, diff --git a/sys/fs/union/union_vfsops.c b/sys/fs/union/union_vfsops.c index b8370c48185..a439227a30c 100644 --- a/sys/fs/union/union_vfsops.c +++ b/sys/fs/union/union_vfsops.c @@ -1,4 +1,4 @@ -/* $NetBSD: union_vfsops.c,v 1.29 2005/08/30 19:11:43 xtraeme Exp $ */ +/* $NetBSD: union_vfsops.c,v 1.30 2005/09/23 12:10:33 jmmv Exp $ */ /* * Copyright (c) 1994 The Regents of the University of California. @@ -77,7 +77,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: union_vfsops.c,v 1.29 2005/08/30 19:11:43 xtraeme Exp $"); +__KERNEL_RCSID(0, "$NetBSD: union_vfsops.c,v 1.30 2005/09/23 12:10:33 jmmv Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -103,10 +103,6 @@ int union_quotactl(struct mount *, int, uid_t, void *, struct proc *); int union_statvfs(struct mount *, struct statvfs *, struct proc *); int union_sync(struct mount *, int, struct ucred *, struct proc *); int union_vget(struct mount *, ino_t, struct vnode **); -int union_fhtovp(struct mount *, struct fid *, struct vnode **); -int union_checkexp(struct mount *, struct mbuf *, int *, - struct ucred **); -int union_vptofh(struct vnode *, struct fid *); /* * Mount union filesystem @@ -561,39 +557,6 @@ union_vget(mp, ino, vpp) return (EOPNOTSUPP); } -/*ARGSUSED*/ -int -union_fhtovp(mp, fidp, vpp) - struct mount *mp; - struct fid *fidp; - struct vnode **vpp; -{ - - return (EOPNOTSUPP); -} - -/*ARGSUSED*/ -int -union_checkexp(mp, nam, exflagsp, credanonp) - struct mount *mp; - struct mbuf *nam; - int *exflagsp; - struct ucred **credanonp; -{ - - return (EOPNOTSUPP); -} - -/*ARGSUSED*/ -int -union_vptofh(vp, fhp) - struct vnode *vp; - struct fid *fhp; -{ - - return (EOPNOTSUPP); -} - SYSCTL_SETUP(sysctl_vfs_union_setup, "sysctl vfs.union subtree setup") { @@ -632,14 +595,12 @@ struct vfsops union_vfsops = { union_statvfs, union_sync, union_vget, - union_fhtovp, - union_vptofh, + NULL, /* vfs_fhtovp */ + NULL, /* vfs_vptofh */ union_init, NULL, /* vfs_reinit */ union_done, - NULL, NULL, /* vfs_mountroot */ - union_checkexp, (int (*)(struct mount *, struct vnode *, struct timespec *)) eopnotsupp, vfs_stdextattrctl, union_vnodeopv_descs, |
