vfs_extattr.c (92723) | vfs_extattr.c (92751) |
---|---|
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. --- 22 unchanged lines hidden (view full) --- 31 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 32 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 33 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 34 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 35 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 36 * SUCH DAMAGE. 37 * 38 * @(#)vfs_syscalls.c 8.13 (Berkeley) 4/15/94 | 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. --- 22 unchanged lines hidden (view full) --- 31 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 32 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 33 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 34 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 35 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 36 * SUCH DAMAGE. 37 * 38 * @(#)vfs_syscalls.c 8.13 (Berkeley) 4/15/94 |
39 * $FreeBSD: head/sys/kern/vfs_extattr.c 92723 2002-03-19 21:25:46Z alfred $ | 39 * $FreeBSD: head/sys/kern/vfs_extattr.c 92751 2002-03-20 04:09:59Z jeff $ |
40 */ 41 42/* For 4.3 integer FS ID compatibility */ 43#include "opt_compat.h" 44#include "opt_ffs.h" 45 46#include <sys/param.h> 47#include <sys/systm.h> --- 19 unchanged lines hidden (view full) --- 67#include <sys/extattr.h> 68#include <sys/jail.h> 69#include <sys/sysctl.h> 70 71#include <machine/limits.h> 72 73#include <vm/vm.h> 74#include <vm/vm_object.h> | 40 */ 41 42/* For 4.3 integer FS ID compatibility */ 43#include "opt_compat.h" 44#include "opt_ffs.h" 45 46#include <sys/param.h> 47#include <sys/systm.h> --- 19 unchanged lines hidden (view full) --- 67#include <sys/extattr.h> 68#include <sys/jail.h> 69#include <sys/sysctl.h> 70 71#include <machine/limits.h> 72 73#include <vm/vm.h> 74#include <vm/vm_object.h> |
75#include <vm/vm_zone.h> | |
76#include <vm/vm_page.h> | 75#include <vm/vm_page.h> |
76#include <vm/uma.h> |
|
77 78static int change_dir(struct nameidata *ndp, struct thread *td); 79static void checkdirs(struct vnode *olddp, struct vnode *newdp); 80static int chroot_refuse_vdir_fds(struct filedesc *fdp); 81static int getutimes(const struct timeval *, struct timespec *); 82static int setfown(struct thread *td, struct vnode *, uid_t, gid_t); 83static int setfmode(struct thread *td, struct vnode *, int); 84static int setfflags(struct thread *td, struct vnode *, int); --- 1448 unchanged lines hidden (view full) --- 1533 } */ *uap; 1534{ 1535 struct mount *mp; 1536 struct vattr vattr; 1537 char *path; 1538 int error; 1539 struct nameidata nd; 1540 | 77 78static int change_dir(struct nameidata *ndp, struct thread *td); 79static void checkdirs(struct vnode *olddp, struct vnode *newdp); 80static int chroot_refuse_vdir_fds(struct filedesc *fdp); 81static int getutimes(const struct timeval *, struct timespec *); 82static int setfown(struct thread *td, struct vnode *, uid_t, gid_t); 83static int setfmode(struct thread *td, struct vnode *, int); 84static int setfflags(struct thread *td, struct vnode *, int); --- 1448 unchanged lines hidden (view full) --- 1533 } */ *uap; 1534{ 1535 struct mount *mp; 1536 struct vattr vattr; 1537 char *path; 1538 int error; 1539 struct nameidata nd; 1540 |
1541 path = zalloc(namei_zone); | 1541 path = uma_zalloc(namei_zone, M_WAITOK); |
1542 if ((error = copyinstr(SCARG(uap, path), path, MAXPATHLEN, NULL)) != 0) 1543 goto out; 1544restart: 1545 bwillwrite(); 1546 NDINIT(&nd, CREATE, LOCKPARENT|NOOBJ, UIO_USERSPACE, SCARG(uap, link), td); 1547 if ((error = namei(&nd)) != 0) 1548 goto out; 1549 if (nd.ni_vp) { --- 19 unchanged lines hidden (view full) --- 1569 NDFREE(&nd, NDF_ONLY_PNBUF); 1570 if (error == 0) 1571 vput(nd.ni_vp); 1572 vput(nd.ni_dvp); 1573 vn_finished_write(mp); 1574 ASSERT_VOP_UNLOCKED(nd.ni_dvp, "symlink"); 1575 ASSERT_VOP_UNLOCKED(nd.ni_vp, "symlink"); 1576out: | 1542 if ((error = copyinstr(SCARG(uap, path), path, MAXPATHLEN, NULL)) != 0) 1543 goto out; 1544restart: 1545 bwillwrite(); 1546 NDINIT(&nd, CREATE, LOCKPARENT|NOOBJ, UIO_USERSPACE, SCARG(uap, link), td); 1547 if ((error = namei(&nd)) != 0) 1548 goto out; 1549 if (nd.ni_vp) { --- 19 unchanged lines hidden (view full) --- 1569 NDFREE(&nd, NDF_ONLY_PNBUF); 1570 if (error == 0) 1571 vput(nd.ni_vp); 1572 vput(nd.ni_dvp); 1573 vn_finished_write(mp); 1574 ASSERT_VOP_UNLOCKED(nd.ni_dvp, "symlink"); 1575 ASSERT_VOP_UNLOCKED(nd.ni_vp, "symlink"); 1576out: |
1577 zfree(namei_zone, path); | 1577 uma_zfree(namei_zone, path); |
1578 return (error); 1579} 1580 1581/* 1582 * Delete a whiteout from the filesystem. 1583 */ 1584/* ARGSUSED */ 1585int --- 2715 unchanged lines hidden --- | 1578 return (error); 1579} 1580 1581/* 1582 * Delete a whiteout from the filesystem. 1583 */ 1584/* ARGSUSED */ 1585int --- 2715 unchanged lines hidden --- |