SCCS-vsn: sys/ufs/ffs/ffs_vfsops.c 7.61
SCCS-vsn: sys/ufs/ffs/ffs_extern.h 7.4
*
* %sccs.include.redist.c%
*
*
* %sccs.include.redist.c%
*
- * @(#)ffs_extern.h 7.3 (Berkeley) %G%
+ * @(#)ffs_extern.h 7.4 (Berkeley) %G%
daddr_t ffs_blkpref __P((struct inode *, daddr_t, int, daddr_t *));
int ffs_bmap __P((struct vnode *, daddr_t, struct vnode **, daddr_t *));
void ffs_clrblock __P((struct fs *, u_char *, daddr_t));
daddr_t ffs_blkpref __P((struct inode *, daddr_t, int, daddr_t *));
int ffs_bmap __P((struct vnode *, daddr_t, struct vnode **, daddr_t *));
void ffs_clrblock __P((struct fs *, u_char *, daddr_t));
-int ffs_fhtovp __P((struct mount *, struct fid *, struct vnode **));
+int ffs_fhtovp __P((struct mount *, struct fid *, int, struct vnode **));
void ffs_fragacct __P((struct fs *, int, long [], int));
int ffs_fsync
__P((struct vnode *, int, struct ucred *, int, struct proc *));
void ffs_fragacct __P((struct fs *, int, long [], int));
int ffs_fsync
__P((struct vnode *, int, struct ucred *, int, struct proc *));
*
* %sccs.include.redist.c%
*
*
* %sccs.include.redist.c%
*
- * @(#)ffs_vfsops.c 7.60 (Berkeley) %G%
+ * @(#)ffs_vfsops.c 7.61 (Berkeley) %G%
*/
#include <sys/param.h>
*/
#include <sys/param.h>
M_MOUNT, M_WAITOK);
mp->mnt_op = &ufs_vfsops;
mp->mnt_flag = MNT_RDONLY;
M_MOUNT, M_WAITOK);
mp->mnt_op = &ufs_vfsops;
mp->mnt_flag = MNT_RDONLY;
mp->mnt_mounth = NULLVP;
if (error = ffs_mountfs(rootvp, mp, p)) {
free(mp, M_MOUNT);
mp->mnt_mounth = NULLVP;
if (error = ffs_mountfs(rootvp, mp, p)) {
free(mp, M_MOUNT);
if (error = copyin(data, (caddr_t)&args, sizeof (struct ufs_args)))
return (error);
if (error = copyin(data, (caddr_t)&args, sizeof (struct ufs_args)))
return (error);
- /*
- * Process export requests.
- */
- if ((args.exflags & MNT_EXPORTED) || (mp->mnt_flag & MNT_EXPORTED)) {
- if (args.exflags & MNT_EXPORTED)
- mp->mnt_flag |= MNT_EXPORTED;
- else
- mp->mnt_flag &= ~MNT_EXPORTED;
- if (args.exflags & MNT_EXRDONLY)
- mp->mnt_flag |= MNT_EXRDONLY;
- else
- mp->mnt_flag &= ~MNT_EXRDONLY;
- mp->mnt_exroot = args.exroot;
- }
/*
* If updating, check whether changing from read-only to
* read/write; if there is no device name, that's all we do.
/*
* If updating, check whether changing from read-only to
* read/write; if there is no device name, that's all we do.
fs = ump->um_fs;
if (fs->fs_ronly && (mp->mnt_flag & MNT_RDONLY) == 0)
fs->fs_ronly = 0;
fs = ump->um_fs;
if (fs->fs_ronly && (mp->mnt_flag & MNT_RDONLY) == 0)
fs->fs_ronly = 0;
+ if (args.fspec == 0) {
+ /*
+ * Process export requests.
+ */
+ if (args.exflags & MNT_EXPORTED) {
+ if (error = hang_addrlist(mp, &args))
+ return (error);
+ mp->mnt_flag |= MNT_EXPORTED;
+ }
+ if (args.exflags & MNT_DELEXPORT) {
+ free_addrlist(ump);
+ mp->mnt_flag &=
+ ~(MNT_EXPORTED | MNT_DEFEXPORTED);
+ }
}
/*
* Not an update, or updating the name: look up the name
}
/*
* Not an update, or updating the name: look up the name
* - check that the inode number is valid
* - call ffs_vget() to get the locked inode
* - check for an unallocated inode (i_mode == 0)
* - check that the inode number is valid
* - call ffs_vget() to get the locked inode
* - check for an unallocated inode (i_mode == 0)
- * - check that the generation number matches
+ * - check that the generation number matches unless setgen true
-ffs_fhtovp(mp, fhp, vpp)
+ffs_fhtovp(mp, fhp, setgen, vpp)
register struct mount *mp;
struct fid *fhp;
register struct mount *mp;
struct fid *fhp;
struct vnode **vpp;
{
register struct inode *ip;
struct vnode **vpp;
{
register struct inode *ip;
return (EINVAL);
}
if (ip->i_gen != ufhp->ufid_gen) {
return (EINVAL);
}
if (ip->i_gen != ufhp->ufid_gen) {
- ufs_iput(ip);
- *vpp = NULLVP;
- return (EINVAL);
+ if (setgen)
+ ufhp->ufid_gen = ip->i_gen;
+ else {
+ ufs_iput(ip);
+ *vpp = NULLVP;
+ return (EINVAL);
+ }
}
*vpp = nvp;
return (0);
}
*vpp = nvp;
return (0);