diff options
author | mckusick <mckusick@FreeBSD.org> | 2007-03-06 08:13:21 +0000 |
---|---|---|
committer | mckusick <mckusick@FreeBSD.org> | 2007-03-06 08:13:21 +0000 |
commit | e5953785d06c108599cb30d8a2cfe0c8b6419ef0 (patch) | |
tree | 7cb99a7cb1fbd1e92be219f0b948c30b7689d734 /share | |
parent | fe063bb84d1657ff868f2c2ec73a39f9b18590f0 (diff) | |
download | FreeBSD-src-e5953785d06c108599cb30d8a2cfe0c8b6419ef0.zip FreeBSD-src-e5953785d06c108599cb30d8a2cfe0c8b6419ef0.tar.gz |
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
Diffstat (limited to 'share')
-rw-r--r-- | share/man/man5/fs.5 | 59 | ||||
-rw-r--r-- | share/man/man9/extattr.9 | 55 |
2 files changed, 58 insertions, 56 deletions
diff --git a/share/man/man5/fs.5 b/share/man/man5/fs.5 index 559bf65..abb0f47 100644 --- a/share/man/man5/fs.5 +++ b/share/man/man5/fs.5 @@ -45,8 +45,11 @@ .Pp .In sys/types.h .In sys/lock.h +.In sys/extattr.h +.In sys/acl.h .In ufs/ufs/quota.h -.In ufs/ufs/inode.h +.In ufs/ufs/dinode.h +.In ufs/ufs/extattr.h .Sh DESCRIPTION The files .In fs.h @@ -385,6 +388,60 @@ text file, and the root. An inode is `named' by its device/i-number pair. For further information, see the include file .In ufs/ufs/inode.h . +.Pp +The format of an external attribute is defined by the extattr structure: +.Bd -literal +struct extattr { + int32_t ea_length; /* length of this attribute */ + int8_t ea_namespace; /* name space of this attribute */ + int8_t ea_contentpadlen; /* 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 */ +}; +.Ed +.Pp +Several macros are defined to manipulate these structures. +Each macro takes a pointer to an extattr structure. +.Bl -tag -width ".Dv EXTATTR_SET_LENGTHS(eap, size)" +.It Dv EXTATTR_NEXT(eap) +Returns a pointer to the next extended attribute following +.Fa eap . +.It Dv EXTATTR_CONTENT(eap) +Returns a pointer to the extended attribute content referenced by +.Fa eap . +.It Dv EXTATTR_CONTENT_SIZE(eap) +Returns the size of the extended attribute content referenced by +.Fa eap . +.It Dv EXTATTR_SET_LENGTHS(eap, size) +Called with the size of the attribute content after initializing +the attribute name to calculate and set the +.Fa ea_length , +.Fa ea_namelength , +and +.Fa ea_contentpadlen +fields of the extended attribute structure. +.El +.Pp +The following code identifies an ACL: +.Bd -literal + if (eap->ea_namespace == EXTATTR_NAMESPACE_SYSTEM && + !strcmp(eap->ea_name, POSIX1E_ACL_ACCESS_EXTATTR_NAME) { + aclp = EXTATTR_CONTENT(eap); + acllen = EXTATTR_CONTENT_SIZE(eap); + ... + } +.Ed +.Pp +The following code creates an extended attribute +containing a copy of a structure +.Fa mygif : +.Bd -literal + eap->ea_namespace = EXTATTR_NAMESPACE_USER; + strcpy(eap->ea_name, "filepic.gif"); + EXTATTR_SET_LENGTHS(eap, sizeof(struct mygif)); + memcpy(EXTATTR_CONTENT(eap), &mygif, sizeof(struct mygif)); +.Ed .Sh HISTORY A super-block structure named filsys appeared in .At v6 . diff --git a/share/man/man9/extattr.9 b/share/man/man9/extattr.9 index 17dc127..9c74a60 100644 --- a/share/man/man9/extattr.9 +++ b/share/man/man9/extattr.9 @@ -78,61 +78,6 @@ Appropriate vnode extended attribute calls are: .Xr VOP_LISTEXTATTR 9 , and .Xr VOP_SETEXTATTR 9 . -.Pp -The format of an external attribute is defined by the extattr structure: -.Bd -literal -struct extattr { - int32_t ea_length; /* length of this attribute */ - int8_t ea_namespace; /* name space of this attribute */ - int8_t ea_contentpadlen; /* 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 */ -}; -.Ed -.Pp -Several macros are defined to manipulate these structures. -Each macro takes a pointer to an extattr structure. -.Bl -tag -width ".Dv EXTATTR_SET_LENGTHS(eap, size)" -.It Dv EXTATTR_NEXT(eap) -Returns a pointer to the next extended attribute following -.Fa eap . -.It Dv EXTATTR_CONTENT(eap) -Returns a pointer to the extended attribute content referenced by -.Fa eap . -.It Dv EXTATTR_CONTENT_SIZE(eap) -Returns the size of the extended attribute content referenced by -.Fa eap . -.It Dv EXTATTR_SET_LENGTHS(eap, size) -Called with the size of the attribute content after initializing -the attribute name to calculate and set the -.Fa ea_length , -.Fa ea_namelength , -and -.Fa ea_contentpadlen -fields of the extended attribute structure. -.El -.Pp -The following code identifies an ACL: -.Bd -literal - if (eap->ea_namespace == EXTATTR_NAMESPACE_SYSTEM && - !strcmp(eap->ea_name, POSIX1E_ACL_ACCESS_EXTATTR_NAME) { - aclp = EXTATTR_CONTENT(eap); - acllen = EXTATTR_CONTENT_SIZE(eap); - ... - } -.Ed -.Pp -The following code creates an extended attribute -containing a copy of a structure -.Fa mygif : -.Bd -literal - eap->ea_namespace = EXTATTR_NAMESPACE_USER; - strcpy(eap->ea_name, "filepic.gif"); - EXTATTR_SET_LENGTHS(eap, sizeof(struct mygif)); - memcpy(EXTATTR_CONTENT(eap), &mygif, sizeof(struct mygif)); -.Ed -.Pp .Sh SEE ALSO .Xr VFS 9 , .Xr VFS_EXTATTRCTL 9 , |