vfs_extattr.c (210225) | vfs_extattr.c (210226) |
---|---|
1/*- 2 * Copyright (c) 1999-2001 Robert N. M. Watson 3 * All rights reserved. 4 * 5 * This software was developed by Robert Watson for the TrustedBSD Project. 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions --- 13 unchanged lines hidden (view full) --- 22 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 23 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 24 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 26 * SUCH DAMAGE. 27 */ 28 29#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 1999-2001 Robert N. M. Watson 3 * All rights reserved. 4 * 5 * This software was developed by Robert Watson for the TrustedBSD Project. 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions --- 13 unchanged lines hidden (view full) --- 22 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 23 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 24 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 26 * SUCH DAMAGE. 27 */ 28 29#include <sys/cdefs.h> |
30__FBSDID("$FreeBSD: head/sys/kern/vfs_extattr.c 210225 2010-07-18 20:23:10Z trasz $"); | 30__FBSDID("$FreeBSD: head/sys/kern/vfs_extattr.c 210226 2010-07-18 20:57:53Z trasz $"); |
31 32#include <sys/param.h> 33#include <sys/systm.h> 34#include <sys/lock.h> 35#include <sys/mount.h> 36#include <sys/mutex.h> 37#include <sys/sysproto.h> 38#include <sys/fcntl.h> --- 105 unchanged lines hidden (view full) --- 144 */ 145 if (filename_vp != NULL) 146 vrele(filename_vp); 147 VFS_UNLOCK_GIANT(fnvfslocked); 148 VFS_UNLOCK_GIANT(vfslocked); 149 return (error); 150} 151 | 31 32#include <sys/param.h> 33#include <sys/systm.h> 34#include <sys/lock.h> 35#include <sys/mount.h> 36#include <sys/mutex.h> 37#include <sys/sysproto.h> 38#include <sys/fcntl.h> --- 105 unchanged lines hidden (view full) --- 144 */ 145 if (filename_vp != NULL) 146 vrele(filename_vp); 147 VFS_UNLOCK_GIANT(fnvfslocked); 148 VFS_UNLOCK_GIANT(vfslocked); 149 return (error); 150} 151 |
152/* | 152/*- |
153 * Set a named extended attribute on a file or directory 154 * 155 * Arguments: unlocked vnode "vp", attribute namespace "attrnamespace", 156 * kernelspace string pointer "attrname", userspace buffer 157 * pointer "data", buffer length "nbytes", thread "td". 158 * Returns: 0 on success, an error number otherwise 159 * Locks: none 160 * References: vp must be a valid reference for the duration of the call --- 151 unchanged lines hidden (view full) --- 312 error = extattr_set_vp(nd.ni_vp, uap->attrnamespace, attrname, 313 uap->data, uap->nbytes, td); 314 315 vrele(nd.ni_vp); 316 VFS_UNLOCK_GIANT(vfslocked); 317 return (error); 318} 319 | 153 * Set a named extended attribute on a file or directory 154 * 155 * Arguments: unlocked vnode "vp", attribute namespace "attrnamespace", 156 * kernelspace string pointer "attrname", userspace buffer 157 * pointer "data", buffer length "nbytes", thread "td". 158 * Returns: 0 on success, an error number otherwise 159 * Locks: none 160 * References: vp must be a valid reference for the duration of the call --- 151 unchanged lines hidden (view full) --- 312 error = extattr_set_vp(nd.ni_vp, uap->attrnamespace, attrname, 313 uap->data, uap->nbytes, td); 314 315 vrele(nd.ni_vp); 316 VFS_UNLOCK_GIANT(vfslocked); 317 return (error); 318} 319 |
320/* | 320/*- |
321 * Get a named extended attribute on a file or directory 322 * 323 * Arguments: unlocked vnode "vp", attribute namespace "attrnamespace", 324 * kernelspace string pointer "attrname", userspace buffer 325 * pointer "data", buffer length "nbytes", thread "td". 326 * Returns: 0 on success, an error number otherwise 327 * Locks: none 328 * References: vp must be a valid reference for the duration of the call --- 304 unchanged lines hidden (view full) --- 633 634 vfslocked = NDHASGIANT(&nd); 635 error = extattr_delete_vp(nd.ni_vp, uap->attrnamespace, attrname, td); 636 vrele(nd.ni_vp); 637 VFS_UNLOCK_GIANT(vfslocked); 638 return(error); 639} 640 | 321 * Get a named extended attribute on a file or directory 322 * 323 * Arguments: unlocked vnode "vp", attribute namespace "attrnamespace", 324 * kernelspace string pointer "attrname", userspace buffer 325 * pointer "data", buffer length "nbytes", thread "td". 326 * Returns: 0 on success, an error number otherwise 327 * Locks: none 328 * References: vp must be a valid reference for the duration of the call --- 304 unchanged lines hidden (view full) --- 633 634 vfslocked = NDHASGIANT(&nd); 635 error = extattr_delete_vp(nd.ni_vp, uap->attrnamespace, attrname, td); 636 vrele(nd.ni_vp); 637 VFS_UNLOCK_GIANT(vfslocked); 638 return(error); 639} 640 |
641/* | 641/*- |
642 * Retrieve a list of extended attributes on a file or directory. 643 * 644 * Arguments: unlocked vnode "vp", attribute namespace 'attrnamespace", 645 * userspace buffer pointer "data", buffer length "nbytes", 646 * thread "td". 647 * Returns: 0 on success, an error number otherwise 648 * Locks: none 649 * References: vp must be a valid reference for the duration of the call --- 144 unchanged lines hidden --- | 642 * Retrieve a list of extended attributes on a file or directory. 643 * 644 * Arguments: unlocked vnode "vp", attribute namespace 'attrnamespace", 645 * userspace buffer pointer "data", buffer length "nbytes", 646 * thread "td". 647 * Returns: 0 on success, an error number otherwise 648 * Locks: none 649 * References: vp must be a valid reference for the duration of the call --- 144 unchanged lines hidden --- |