vfs_syscalls.c (220846) | vfs_syscalls.c (222167) |
---|---|
1/*- 2 * Copyright (c) 1989, 1993 3 * The Regents of the University of California. All rights reserved. 4 * (c) UNIX System Laboratories, Inc. 5 * All or some portions of this file are derived from material licensed 6 * to the University of California by American Telephone and Telegraph 7 * Co. or Unix System Laboratories, Inc. and are reproduced herein with 8 * the permission of UNIX System Laboratories, Inc. --- 21 unchanged lines hidden (view full) --- 30 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 31 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 32 * SUCH DAMAGE. 33 * 34 * @(#)vfs_syscalls.c 8.13 (Berkeley) 4/15/94 35 */ 36 37#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 1989, 1993 3 * The Regents of the University of California. All rights reserved. 4 * (c) UNIX System Laboratories, Inc. 5 * All or some portions of this file are derived from material licensed 6 * to the University of California by American Telephone and Telegraph 7 * Co. or Unix System Laboratories, Inc. and are reproduced herein with 8 * the permission of UNIX System Laboratories, Inc. --- 21 unchanged lines hidden (view full) --- 30 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 31 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 32 * SUCH DAMAGE. 33 * 34 * @(#)vfs_syscalls.c 8.13 (Berkeley) 4/15/94 35 */ 36 37#include <sys/cdefs.h> |
38__FBSDID("$FreeBSD: head/sys/kern/vfs_syscalls.c 220846 2011-04-19 16:36:24Z mdf $"); | 38__FBSDID("$FreeBSD: head/sys/kern/vfs_syscalls.c 222167 2011-05-22 01:07:54Z rmacklem $"); |
39 40#include "opt_compat.h" 41#include "opt_kdtrace.h" 42#include "opt_ktrace.h" 43 44#include <sys/param.h> 45#include <sys/systm.h> 46#include <sys/bio.h> --- 4353 unchanged lines hidden (view full) --- 4400 if (error) 4401 return(error); 4402 /* find the mount point */ 4403 mp = vfs_busyfs(&fhp.fh_fsid); 4404 if (mp == NULL) 4405 return (ESTALE); 4406 vfslocked = VFS_LOCK_GIANT(mp); 4407 /* now give me my vnode, it gets returned to me locked */ | 39 40#include "opt_compat.h" 41#include "opt_kdtrace.h" 42#include "opt_ktrace.h" 43 44#include <sys/param.h> 45#include <sys/systm.h> 46#include <sys/bio.h> --- 4353 unchanged lines hidden (view full) --- 4400 if (error) 4401 return(error); 4402 /* find the mount point */ 4403 mp = vfs_busyfs(&fhp.fh_fsid); 4404 if (mp == NULL) 4405 return (ESTALE); 4406 vfslocked = VFS_LOCK_GIANT(mp); 4407 /* now give me my vnode, it gets returned to me locked */ |
4408 error = VFS_FHTOVP(mp, &fhp.fh_fid, &vp); | 4408 error = VFS_FHTOVP(mp, &fhp.fh_fid, LK_EXCLUSIVE, &vp); |
4409 vfs_unbusy(mp); 4410 if (error) 4411 goto out; 4412 /* 4413 * from now on we have to make sure not 4414 * to forget about the vnode 4415 * any error that causes an abort must vput(vp) 4416 * just set error = err and 'goto bad;'. --- 159 unchanged lines hidden (view full) --- 4576 if (error) 4577 return (error); 4578 error = copyin(uap->u_fhp, &fh, sizeof(fhandle_t)); 4579 if (error) 4580 return (error); 4581 if ((mp = vfs_busyfs(&fh.fh_fsid)) == NULL) 4582 return (ESTALE); 4583 vfslocked = VFS_LOCK_GIANT(mp); | 4409 vfs_unbusy(mp); 4410 if (error) 4411 goto out; 4412 /* 4413 * from now on we have to make sure not 4414 * to forget about the vnode 4415 * any error that causes an abort must vput(vp) 4416 * just set error = err and 'goto bad;'. --- 159 unchanged lines hidden (view full) --- 4576 if (error) 4577 return (error); 4578 error = copyin(uap->u_fhp, &fh, sizeof(fhandle_t)); 4579 if (error) 4580 return (error); 4581 if ((mp = vfs_busyfs(&fh.fh_fsid)) == NULL) 4582 return (ESTALE); 4583 vfslocked = VFS_LOCK_GIANT(mp); |
4584 error = VFS_FHTOVP(mp, &fh.fh_fid, &vp); | 4584 error = VFS_FHTOVP(mp, &fh.fh_fid, LK_EXCLUSIVE, &vp); |
4585 vfs_unbusy(mp); 4586 if (error) { 4587 VFS_UNLOCK_GIANT(vfslocked); 4588 return (error); 4589 } 4590 error = vn_stat(vp, &sb, td->td_ucred, NOCRED, td); 4591 vput(vp); 4592 VFS_UNLOCK_GIANT(vfslocked); --- 43 unchanged lines hidden (view full) --- 4636 int error; 4637 4638 error = priv_check(td, PRIV_VFS_FHSTATFS); 4639 if (error) 4640 return (error); 4641 if ((mp = vfs_busyfs(&fh.fh_fsid)) == NULL) 4642 return (ESTALE); 4643 vfslocked = VFS_LOCK_GIANT(mp); | 4585 vfs_unbusy(mp); 4586 if (error) { 4587 VFS_UNLOCK_GIANT(vfslocked); 4588 return (error); 4589 } 4590 error = vn_stat(vp, &sb, td->td_ucred, NOCRED, td); 4591 vput(vp); 4592 VFS_UNLOCK_GIANT(vfslocked); --- 43 unchanged lines hidden (view full) --- 4636 int error; 4637 4638 error = priv_check(td, PRIV_VFS_FHSTATFS); 4639 if (error) 4640 return (error); 4641 if ((mp = vfs_busyfs(&fh.fh_fsid)) == NULL) 4642 return (ESTALE); 4643 vfslocked = VFS_LOCK_GIANT(mp); |
4644 error = VFS_FHTOVP(mp, &fh.fh_fid, &vp); | 4644 error = VFS_FHTOVP(mp, &fh.fh_fid, LK_EXCLUSIVE, &vp); |
4645 if (error) { 4646 vfs_unbusy(mp); 4647 VFS_UNLOCK_GIANT(vfslocked); 4648 return (error); 4649 } 4650 vput(vp); 4651 error = prison_canseemount(td->td_ucred, mp); 4652 if (error) --- 116 unchanged lines hidden --- | 4645 if (error) { 4646 vfs_unbusy(mp); 4647 VFS_UNLOCK_GIANT(vfslocked); 4648 return (error); 4649 } 4650 vput(vp); 4651 error = prison_canseemount(td->td_ucred, mp); 4652 if (error) --- 116 unchanged lines hidden --- |