diff options
author | rmacklem <rmacklem@FreeBSD.org> | 2011-05-22 01:07:54 +0000 |
---|---|---|
committer | rmacklem <rmacklem@FreeBSD.org> | 2011-05-22 01:07:54 +0000 |
commit | fbb8a5e8ec5608b837e3fd521703f5642de04e13 (patch) | |
tree | d4de50d8fbaaca75e31ae95cbc9c63c287ea95d9 /sys/kern | |
parent | 3dd8ae4222dacd974bc67c89db57fbe97d36ed79 (diff) | |
download | FreeBSD-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/kern')
-rw-r--r-- | sys/kern/vfs_default.c | 3 | ||||
-rw-r--r-- | sys/kern/vfs_syscalls.c | 6 |
2 files changed, 5 insertions, 4 deletions
diff --git a/sys/kern/vfs_default.c b/sys/kern/vfs_default.c index e5f1254..b89d990 100644 --- a/sys/kern/vfs_default.c +++ b/sys/kern/vfs_default.c @@ -1081,9 +1081,10 @@ vfs_stdvget (mp, ino, flags, vpp) } int -vfs_stdfhtovp (mp, fhp, vpp) +vfs_stdfhtovp (mp, fhp, flags, vpp) struct mount *mp; struct fid *fhp; + int flags; struct vnode **vpp; { diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c index 33f7c5b..b48c6e7 100644 --- a/sys/kern/vfs_syscalls.c +++ b/sys/kern/vfs_syscalls.c @@ -4405,7 +4405,7 @@ fhopen(td, uap) return (ESTALE); vfslocked = VFS_LOCK_GIANT(mp); /* now give me my vnode, it gets returned to me locked */ - error = VFS_FHTOVP(mp, &fhp.fh_fid, &vp); + error = VFS_FHTOVP(mp, &fhp.fh_fid, LK_EXCLUSIVE, &vp); vfs_unbusy(mp); if (error) goto out; @@ -4581,7 +4581,7 @@ fhstat(td, uap) if ((mp = vfs_busyfs(&fh.fh_fsid)) == NULL) return (ESTALE); vfslocked = VFS_LOCK_GIANT(mp); - error = VFS_FHTOVP(mp, &fh.fh_fid, &vp); + error = VFS_FHTOVP(mp, &fh.fh_fid, LK_EXCLUSIVE, &vp); vfs_unbusy(mp); if (error) { VFS_UNLOCK_GIANT(vfslocked); @@ -4641,7 +4641,7 @@ kern_fhstatfs(struct thread *td, fhandle_t fh, struct statfs *buf) if ((mp = vfs_busyfs(&fh.fh_fsid)) == NULL) return (ESTALE); vfslocked = VFS_LOCK_GIANT(mp); - error = VFS_FHTOVP(mp, &fh.fh_fid, &vp); + error = VFS_FHTOVP(mp, &fh.fh_fid, LK_EXCLUSIVE, &vp); if (error) { vfs_unbusy(mp); VFS_UNLOCK_GIANT(vfslocked); |