Deleted Added
full compact
vfs_extattr.c (74273) vfs_extattr.c (74437)
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 74273 2001-03-15 02:54:29Z rwatson $
39 * $FreeBSD: head/sys/kern/vfs_extattr.c 74437 2001-03-19 05:44:15Z rwatson $
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>

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

3721 if (error) {
3722 if (filename_vp)
3723 vrele(filename_vp);
3724 return (error);
3725 }
3726
3727 if (SCARG(uap, attrname) != NULL) {
3728 error = VFS_EXTATTRCTL(mp, SCARG(uap, cmd), filename_vp,
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>

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

3721 if (error) {
3722 if (filename_vp)
3723 vrele(filename_vp);
3724 return (error);
3725 }
3726
3727 if (SCARG(uap, attrname) != NULL) {
3728 error = VFS_EXTATTRCTL(mp, SCARG(uap, cmd), filename_vp,
3729 SCARG(uap, namespace), attrname, p);
3729 SCARG(uap, attrnamespace), attrname, p);
3730 } else {
3731 error = VFS_EXTATTRCTL(mp, SCARG(uap, cmd), filename_vp,
3730 } else {
3731 error = VFS_EXTATTRCTL(mp, SCARG(uap, cmd), filename_vp,
3732 SCARG(uap, namespace), NULL, p);
3732 SCARG(uap, attrnamespace), NULL, p);
3733 }
3734
3735 vn_finished_write(mp);
3736 /*
3737 * VFS_EXTATTRCTL will have unlocked, but not de-ref'd,
3738 * filename_vp, so vrele it if it is defined.
3739 */
3740 if (filename_vp != NULL)

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

3796 if (iov->iov_len > INT_MAX - auio.uio_resid) {
3797 error = EINVAL;
3798 goto done;
3799 }
3800 auio.uio_resid += iov->iov_len;
3801 iov++;
3802 }
3803 cnt = auio.uio_resid;
3733 }
3734
3735 vn_finished_write(mp);
3736 /*
3737 * VFS_EXTATTRCTL will have unlocked, but not de-ref'd,
3738 * filename_vp, so vrele it if it is defined.
3739 */
3740 if (filename_vp != NULL)

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

3796 if (iov->iov_len > INT_MAX - auio.uio_resid) {
3797 error = EINVAL;
3798 goto done;
3799 }
3800 auio.uio_resid += iov->iov_len;
3801 iov++;
3802 }
3803 cnt = auio.uio_resid;
3804 error = VOP_SETEXTATTR(nd.ni_vp, SCARG(uap, namespace), attrname,
3804 error = VOP_SETEXTATTR(nd.ni_vp, SCARG(uap, attrnamespace), attrname,
3805 &auio, p->p_cred->pc_ucred, p);
3806 cnt -= auio.uio_resid;
3807 p->p_retval[0] = cnt;
3808done:
3809 if (needfree)
3810 FREE(needfree, M_IOV);
3811 NDFREE(&nd, 0);
3812 vn_finished_write(mp);

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

3863 if (iov->iov_len > INT_MAX - auio.uio_resid) {
3864 error = EINVAL;
3865 goto done;
3866 }
3867 auio.uio_resid += iov->iov_len;
3868 iov++;
3869 }
3870 cnt = auio.uio_resid;
3805 &auio, p->p_cred->pc_ucred, p);
3806 cnt -= auio.uio_resid;
3807 p->p_retval[0] = cnt;
3808done:
3809 if (needfree)
3810 FREE(needfree, M_IOV);
3811 NDFREE(&nd, 0);
3812 vn_finished_write(mp);

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

3863 if (iov->iov_len > INT_MAX - auio.uio_resid) {
3864 error = EINVAL;
3865 goto done;
3866 }
3867 auio.uio_resid += iov->iov_len;
3868 iov++;
3869 }
3870 cnt = auio.uio_resid;
3871 error = VOP_GETEXTATTR(nd.ni_vp, SCARG(uap, namespace), attrname,
3871 error = VOP_GETEXTATTR(nd.ni_vp, SCARG(uap, attrnamespace), attrname,
3872 &auio, p->p_cred->pc_ucred, p);
3873 cnt -= auio.uio_resid;
3874 p->p_retval[0] = cnt;
3875done:
3876 if (needfree)
3877 FREE(needfree, M_IOV);
3878 NDFREE(&nd, 0);
3879 return(error);

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

3899 NDINIT(&nd, LOOKUP, FOLLOW | LOCKLEAF, UIO_USERSPACE,
3900 SCARG(uap, path), p);
3901 if ((error = namei(&nd)) != 0)
3902 return(error);
3903 if ((error = vn_start_write(nd.ni_vp, &mp, V_WAIT | PCATCH)) != 0) {
3904 NDFREE(&nd, 0);
3905 return (error);
3906 }
3872 &auio, p->p_cred->pc_ucred, p);
3873 cnt -= auio.uio_resid;
3874 p->p_retval[0] = cnt;
3875done:
3876 if (needfree)
3877 FREE(needfree, M_IOV);
3878 NDFREE(&nd, 0);
3879 return(error);

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

3899 NDINIT(&nd, LOOKUP, FOLLOW | LOCKLEAF, UIO_USERSPACE,
3900 SCARG(uap, path), p);
3901 if ((error = namei(&nd)) != 0)
3902 return(error);
3903 if ((error = vn_start_write(nd.ni_vp, &mp, V_WAIT | PCATCH)) != 0) {
3904 NDFREE(&nd, 0);
3905 return (error);
3906 }
3907 error = VOP_SETEXTATTR(nd.ni_vp, SCARG(uap, namespace), attrname,
3907 error = VOP_SETEXTATTR(nd.ni_vp, SCARG(uap, attrnamespace), attrname,
3908 NULL, p->p_cred->pc_ucred, p);
3909 NDFREE(&nd, 0);
3910 vn_finished_write(mp);
3911 return(error);
3912}
3908 NULL, p->p_cred->pc_ucred, p);
3909 NDFREE(&nd, 0);
3910 vn_finished_write(mp);
3911 return(error);
3912}