aboutsummaryrefslogtreecommitdiff
path: root/sys/sys/extattr.h
diff options
context:
space:
mode:
authorKirk McKusick <mckusick@FreeBSD.org>2007-03-06 08:13:21 +0000
committerKirk McKusick <mckusick@FreeBSD.org>2007-03-06 08:13:21 +0000
commita9093e846d7be8771b7ed509c37bb39cec26c565 (patch)
tree7cb99a7cb1fbd1e92be219f0b948c30b7689d734 /sys/sys/extattr.h
parentb77ad8fc3b67b9954e7f5bc0bda66600ee718d25 (diff)
downloadsrc-a9093e846d7be8771b7ed509c37bb39cec26c565.tar.gz
src-a9093e846d7be8771b7ed509c37bb39cec26c565.zip
Move macros describing extended attributes in UFS from
<sys/extattr.h> to <ufs/ufs/extattr.h>. Move description of extended attributes in UFS from man9/extattr.9 to man5/fs.5. Note that restore will not compile until <sys/extattr.h> and <ufs/ufs/extattr.h> have been updated. Suggested by: Robert Watson
Notes
Notes: svn path=/head/; revision=167259
Diffstat (limited to 'sys/sys/extattr.h')
-rw-r--r--sys/sys/extattr.h47
1 files changed, 0 insertions, 47 deletions
diff --git a/sys/sys/extattr.h b/sys/sys/extattr.h
index ece538582b40..678c0cf99ad0 100644
--- a/sys/sys/extattr.h
+++ b/sys/sys/extattr.h
@@ -56,48 +56,6 @@
EXTATTR_NAMESPACE_USER_STRING, \
EXTATTR_NAMESPACE_SYSTEM_STRING }
-/*
- * This structure defines the required fields of an extended-attribute header.
- */
-struct extattr {
- int32_t ea_length; /* length of this attribute */
- int8_t ea_namespace; /* name space of this attribute */
- int8_t ea_contentpadlen; /* bytes of padding at end of attribute */
- int8_t ea_namelength; /* length of attribute name */
- char ea_name[1]; /* null-terminated attribute name */
- /* extended attribute content follows */
-};
-
-/*
- * These macros are used to access and manipulate an extended attribute:
- *
- * EXTATTR_NEXT(eap) returns a pointer to the next extended attribute
- * following eap.
- * EXTATTR_CONTENT(eap) returns a pointer to the extended attribute
- * content referenced by eap.
- * EXTATTR_CONTENT_SIZE(eap) returns the size of the extended attribute
- * content referenced by eap.
- * EXTATTR_SET_LENGTHS(eap, contentsize) called after initializing the
- * attribute name to calculate and set the ea_length, ea_namelength,
- * and ea_contentpadlen fields of the extended attribute structure.
- */
-#define EXTATTR_NEXT(eap) \
- ((struct extattr *)(((void *)(eap)) + (eap)->ea_length))
-#define EXTATTR_CONTENT(eap) (((void *)(eap)) + EXTATTR_BASE_LENGTH(eap))
-#define EXTATTR_CONTENT_SIZE(eap) \
- ((eap)->ea_length - EXTATTR_BASE_LENGTH(eap) - (eap)->ea_contentpadlen)
-#define EXTATTR_BASE_LENGTH(eap) \
- ((sizeof(struct extattr) + (eap)->ea_namelength + 7) & ~7)
-#define EXTATTR_SET_LENGTHS(eap, contentsize) do { \
- KASSERT(((eap)->ea_name[0] != 0), \
- ("Must initialize name before setting lengths")); \
- (eap)->ea_namelength = strlen((eap)->ea_name); \
- (eap)->ea_contentpadlen = ((contentsize) % 8) ? \
- 8 - ((contentsize) % 8) : 0; \
- (eap)->ea_length = EXTATTR_BASE_LENGTH(eap) + \
- (contentsize) + (eap)->ea_contentpadlen; \
-} while (0)
-
#ifdef _KERNEL
#define EXTATTR_MAXNAMELEN NAME_MAX
@@ -110,11 +68,6 @@ int extattr_check_cred(struct vnode *vp, int attrnamespace,
#else
#include <sys/cdefs.h>
-/* User-level definition of KASSERT for macros above */
-#define KASSERT(cond, str) do { \
- if (!(cond)) { printf("panic: "); printf(str); printf("\n"); exit(1); }\
-} while (0)
-
struct iovec;
__BEGIN_DECLS