summaryrefslogtreecommitdiffstats
path: root/sys/fs
diff options
context:
space:
mode:
authorrmacklem <rmacklem@FreeBSD.org>2011-05-22 01:07:54 +0000
committerrmacklem <rmacklem@FreeBSD.org>2011-05-22 01:07:54 +0000
commitfbb8a5e8ec5608b837e3fd521703f5642de04e13 (patch)
treed4de50d8fbaaca75e31ae95cbc9c63c287ea95d9 /sys/fs
parent3dd8ae4222dacd974bc67c89db57fbe97d36ed79 (diff)
downloadFreeBSD-src-fbb8a5e8ec5608b837e3fd521703f5642de04e13.zip
FreeBSD-src-fbb8a5e8ec5608b837e3fd521703f5642de04e13.tar.gz
Add a lock flags argument to the VFS_FHTOVP() file system
method, so that callers can indicate the minimum vnode locking requirement. This will allow some file systems to choose to return a LK_SHARED locked vnode when LK_SHARED is specified for the flags argument. This patch only adds the flag. It does not change any file system to use it and all callers specify LK_EXCLUSIVE, so file system semantics are not changed. Reviewed by: kib
Diffstat (limited to 'sys/fs')
-rw-r--r--sys/fs/cd9660/cd9660_vfsops.c3
-rw-r--r--sys/fs/ext2fs/ext2_vfsops.c2
-rw-r--r--sys/fs/hpfs/hpfs_vfsops.c1
-rw-r--r--sys/fs/msdosfs/msdosfs_vfsops.c2
-rw-r--r--sys/fs/nfsserver/nfs_nfsdport.c4
-rw-r--r--sys/fs/ntfs/ntfs_vfsops.c1
-rw-r--r--sys/fs/nullfs/null_vfsops.c6
-rw-r--r--sys/fs/tmpfs/tmpfs_vfsops.c6
-rw-r--r--sys/fs/udf/udf_vfsops.c2
-rw-r--r--sys/fs/unionfs/union_vfsops.c3
10 files changed, 19 insertions, 11 deletions
diff --git a/sys/fs/cd9660/cd9660_vfsops.c b/sys/fs/cd9660/cd9660_vfsops.c
index 77757f2..0ad57ec 100644
--- a/sys/fs/cd9660/cd9660_vfsops.c
+++ b/sys/fs/cd9660/cd9660_vfsops.c
@@ -586,9 +586,10 @@ cd9660_statfs(mp, sbp)
/* ARGSUSED */
static int
-cd9660_fhtovp(mp, fhp, vpp)
+cd9660_fhtovp(mp, fhp, flags, vpp)
struct mount *mp;
struct fid *fhp;
+ int flags;
struct vnode **vpp;
{
struct ifid ifh;
diff --git a/sys/fs/ext2fs/ext2_vfsops.c b/sys/fs/ext2fs/ext2_vfsops.c
index 5c807dc..1b47e91 100644
--- a/sys/fs/ext2fs/ext2_vfsops.c
+++ b/sys/fs/ext2fs/ext2_vfsops.c
@@ -973,7 +973,7 @@ ext2_vget(struct mount *mp, ino_t ino, int flags, struct vnode **vpp)
* those rights via. exflagsp and credanonp
*/
static int
-ext2_fhtovp(struct mount *mp, struct fid *fhp, struct vnode **vpp)
+ext2_fhtovp(struct mount *mp, struct fid *fhp, int flags, struct vnode **vpp)
{
struct inode *ip;
struct ufid *ufhp;
diff --git a/sys/fs/hpfs/hpfs_vfsops.c b/sys/fs/hpfs/hpfs_vfsops.c
index 676b5c7..866004e 100644
--- a/sys/fs/hpfs/hpfs_vfsops.c
+++ b/sys/fs/hpfs/hpfs_vfsops.c
@@ -417,6 +417,7 @@ static int
hpfs_fhtovp(
struct mount *mp,
struct fid *fhp,
+ int flags,
struct vnode **vpp)
{
struct vnode *nvp;
diff --git a/sys/fs/msdosfs/msdosfs_vfsops.c b/sys/fs/msdosfs/msdosfs_vfsops.c
index e04ef9c..e347640 100644
--- a/sys/fs/msdosfs/msdosfs_vfsops.c
+++ b/sys/fs/msdosfs/msdosfs_vfsops.c
@@ -963,7 +963,7 @@ loop:
}
static int
-msdosfs_fhtovp(struct mount *mp, struct fid *fhp, struct vnode **vpp)
+msdosfs_fhtovp(struct mount *mp, struct fid *fhp, int flags, struct vnode **vpp)
{
struct msdosfsmount *pmp = VFSTOMSDOSFS(mp);
struct defid *defhp = (struct defid *) fhp;
diff --git a/sys/fs/nfsserver/nfs_nfsdport.c b/sys/fs/nfsserver/nfs_nfsdport.c
index 11c287f..d62be99 100644
--- a/sys/fs/nfsserver/nfs_nfsdport.c
+++ b/sys/fs/nfsserver/nfs_nfsdport.c
@@ -2551,7 +2551,7 @@ nfsvno_fhtovp(struct mount *mp, fhandle_t *fhp, struct sockaddr *nam,
if (VFS_NEEDSGIANT(mp))
error = ESTALE;
else
- error = VFS_FHTOVP(mp, &fhp->fh_fid, vpp);
+ error = VFS_FHTOVP(mp, &fhp->fh_fid, LK_EXCLUSIVE, vpp);
if (error != 0)
/* Make sure the server replies ESTALE to the client. */
error = ESTALE;
@@ -2834,7 +2834,7 @@ nfsvno_getvp(fhandle_t *fhp)
mp = vfs_busyfs(&fhp->fh_fsid);
if (mp == NULL)
return (NULL);
- error = VFS_FHTOVP(mp, &fhp->fh_fid, &vp);
+ error = VFS_FHTOVP(mp, &fhp->fh_fid, LK_EXCLUSIVE, &vp);
vfs_unbusy(mp);
if (error)
return (NULL);
diff --git a/sys/fs/ntfs/ntfs_vfsops.c b/sys/fs/ntfs/ntfs_vfsops.c
index b5e024b..d3468af 100644
--- a/sys/fs/ntfs/ntfs_vfsops.c
+++ b/sys/fs/ntfs/ntfs_vfsops.c
@@ -616,6 +616,7 @@ static int
ntfs_fhtovp(
struct mount *mp,
struct fid *fhp,
+ int flags,
struct vnode **vpp)
{
struct vnode *nvp;
diff --git a/sys/fs/nullfs/null_vfsops.c b/sys/fs/nullfs/null_vfsops.c
index 7bd4ab7..e39dd8f 100644
--- a/sys/fs/nullfs/null_vfsops.c
+++ b/sys/fs/nullfs/null_vfsops.c
@@ -321,13 +321,15 @@ nullfs_vget(mp, ino, flags, vpp)
}
static int
-nullfs_fhtovp(mp, fidp, vpp)
+nullfs_fhtovp(mp, fidp, flags, vpp)
struct mount *mp;
struct fid *fidp;
+ int flags;
struct vnode **vpp;
{
int error;
- error = VFS_FHTOVP(MOUNTTONULLMOUNT(mp)->nullm_vfs, fidp, vpp);
+ error = VFS_FHTOVP(MOUNTTONULLMOUNT(mp)->nullm_vfs, fidp, LK_EXCLUSIVE,
+ vpp);
if (error)
return (error);
diff --git a/sys/fs/tmpfs/tmpfs_vfsops.c b/sys/fs/tmpfs/tmpfs_vfsops.c
index 356be5e..9d23bd2 100644
--- a/sys/fs/tmpfs/tmpfs_vfsops.c
+++ b/sys/fs/tmpfs/tmpfs_vfsops.c
@@ -71,7 +71,8 @@ MALLOC_DEFINE(M_TMPFSNAME, "tmpfs name", "tmpfs file names");
static int tmpfs_mount(struct mount *);
static int tmpfs_unmount(struct mount *, int);
static int tmpfs_root(struct mount *, int flags, struct vnode **);
-static int tmpfs_fhtovp(struct mount *, struct fid *, struct vnode **);
+static int tmpfs_fhtovp(struct mount *, struct fid *, int,
+ struct vnode **);
static int tmpfs_statfs(struct mount *, struct statfs *);
/* --------------------------------------------------------------------- */
@@ -341,7 +342,8 @@ tmpfs_root(struct mount *mp, int flags, struct vnode **vpp)
/* --------------------------------------------------------------------- */
static int
-tmpfs_fhtovp(struct mount *mp, struct fid *fhp, struct vnode **vpp)
+tmpfs_fhtovp(struct mount *mp, struct fid *fhp, int flags,
+ struct vnode **vpp)
{
boolean_t found;
struct tmpfs_fid *tfhp;
diff --git a/sys/fs/udf/udf_vfsops.c b/sys/fs/udf/udf_vfsops.c
index 7be5384..bb2c09d 100644
--- a/sys/fs/udf/udf_vfsops.c
+++ b/sys/fs/udf/udf_vfsops.c
@@ -722,7 +722,7 @@ udf_vget(struct mount *mp, ino_t ino, int flags, struct vnode **vpp)
}
static int
-udf_fhtovp(struct mount *mp, struct fid *fhp, struct vnode **vpp)
+udf_fhtovp(struct mount *mp, struct fid *fhp, int flags, struct vnode **vpp)
{
struct ifid *ifhp;
struct vnode *nvp;
diff --git a/sys/fs/unionfs/union_vfsops.c b/sys/fs/unionfs/union_vfsops.c
index e11219c..96258fb 100644
--- a/sys/fs/unionfs/union_vfsops.c
+++ b/sys/fs/unionfs/union_vfsops.c
@@ -454,7 +454,8 @@ unionfs_vget(struct mount *mp, ino_t ino, int flags, struct vnode **vpp)
}
static int
-unionfs_fhtovp(struct mount *mp, struct fid *fidp, struct vnode **vpp)
+unionfs_fhtovp(struct mount *mp, struct fid *fidp, int flags,
+ struct vnode **vpp)
{
return (EOPNOTSUPP);
}
OpenPOWER on IntegriCloud