vfs_syscalls.c (93e0523499fecb2ce1ca434c8ab96b58559771f3) vfs_syscalls.c (2b68eb8e1dbbdaf6a0df1c83b26f5403ca52d4c3)
1/*-
2 * SPDX-License-Identifier: BSD-3-Clause
3 *
4 * Copyright (c) 1989, 1993
5 * The Regents of the University of California. All rights reserved.
6 * (c) UNIX System Laboratories, Inc.
7 * All or some portions of this file are derived from material licensed
8 * to the University of California by American Telephone and Telegraph

--- 1910 unchanged lines hidden (view full) ---

1919 if (error == EINVAL)
1920 error = EPERM;
1921 goto fdout;
1922 }
1923 vp = nd.ni_vp;
1924 if (vp->v_type == VDIR && oldinum == 0) {
1925 error = EPERM; /* POSIX */
1926 } else if (oldinum != 0 &&
1/*-
2 * SPDX-License-Identifier: BSD-3-Clause
3 *
4 * Copyright (c) 1989, 1993
5 * The Regents of the University of California. All rights reserved.
6 * (c) UNIX System Laboratories, Inc.
7 * All or some portions of this file are derived from material licensed
8 * to the University of California by American Telephone and Telegraph

--- 1910 unchanged lines hidden (view full) ---

1919 if (error == EINVAL)
1920 error = EPERM;
1921 goto fdout;
1922 }
1923 vp = nd.ni_vp;
1924 if (vp->v_type == VDIR && oldinum == 0) {
1925 error = EPERM; /* POSIX */
1926 } else if (oldinum != 0 &&
1927 ((error = VOP_STAT(vp, &sb, td->td_ucred, NOCRED, td)) == 0) &&
1927 ((error = VOP_STAT(vp, &sb, td->td_ucred, NOCRED)) == 0) &&
1928 sb.st_ino != oldinum) {
1929 error = EIDRM; /* Identifier removed */
1930 } else if (fp != NULL && fp->f_vnode != vp) {
1931 if (VN_IS_DOOMED(fp->f_vnode))
1932 error = EBADF;
1933 else
1934 error = EDEADLK;
1935 } else {

--- 503 unchanged lines hidden (view full) ---

2439 AUDITVNODE1, pathseg, path, fd, &cap_fstat_rights, td);
2440
2441 if ((error = namei(&nd)) != 0) {
2442 if (error == ENOTDIR &&
2443 (nd.ni_resflags & NIRES_EMPTYPATH) != 0)
2444 error = kern_fstat(td, fd, sbp);
2445 return (error);
2446 }
1928 sb.st_ino != oldinum) {
1929 error = EIDRM; /* Identifier removed */
1930 } else if (fp != NULL && fp->f_vnode != vp) {
1931 if (VN_IS_DOOMED(fp->f_vnode))
1932 error = EBADF;
1933 else
1934 error = EDEADLK;
1935 } else {

--- 503 unchanged lines hidden (view full) ---

2439 AUDITVNODE1, pathseg, path, fd, &cap_fstat_rights, td);
2440
2441 if ((error = namei(&nd)) != 0) {
2442 if (error == ENOTDIR &&
2443 (nd.ni_resflags & NIRES_EMPTYPATH) != 0)
2444 error = kern_fstat(td, fd, sbp);
2445 return (error);
2446 }
2447 error = VOP_STAT(nd.ni_vp, sbp, td->td_ucred, NOCRED, td);
2447 error = VOP_STAT(nd.ni_vp, sbp, td->td_ucred, NOCRED);
2448 if (error == 0) {
2449 if (__predict_false(hook != NULL))
2450 hook(nd.ni_vp, sbp);
2451 }
2452 NDFREE_NOTHING(&nd);
2453 vput(nd.ni_vp);
2454#ifdef __STAT_TIME_T_EXT
2455 sbp->st_atim_ext = 0;

--- 2202 unchanged lines hidden (view full) ---

4658 if (error != 0)
4659 return (error);
4660 if ((mp = vfs_busyfs(&fh.fh_fsid)) == NULL)
4661 return (ESTALE);
4662 error = VFS_FHTOVP(mp, &fh.fh_fid, LK_EXCLUSIVE, &vp);
4663 vfs_unbusy(mp);
4664 if (error != 0)
4665 return (error);
2448 if (error == 0) {
2449 if (__predict_false(hook != NULL))
2450 hook(nd.ni_vp, sbp);
2451 }
2452 NDFREE_NOTHING(&nd);
2453 vput(nd.ni_vp);
2454#ifdef __STAT_TIME_T_EXT
2455 sbp->st_atim_ext = 0;

--- 2202 unchanged lines hidden (view full) ---

4658 if (error != 0)
4659 return (error);
4660 if ((mp = vfs_busyfs(&fh.fh_fsid)) == NULL)
4661 return (ESTALE);
4662 error = VFS_FHTOVP(mp, &fh.fh_fid, LK_EXCLUSIVE, &vp);
4663 vfs_unbusy(mp);
4664 if (error != 0)
4665 return (error);
4666 error = VOP_STAT(vp, sb, td->td_ucred, NOCRED, td);
4666 error = VOP_STAT(vp, sb, td->td_ucred, NOCRED);
4667 vput(vp);
4668 return (error);
4669}
4670
4671/*
4672 * Implement fstatfs() for (NFS) file handles.
4673 */
4674#ifndef _SYS_SYSPROTO_H_

--- 338 unchanged lines hidden ---
4667 vput(vp);
4668 return (error);
4669}
4670
4671/*
4672 * Implement fstatfs() for (NFS) file handles.
4673 */
4674#ifndef _SYS_SYSPROTO_H_

--- 338 unchanged lines hidden ---