History log of /freebsd-9.3-release/share/man/man9/extattr.9
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
# 267654 19-Jun-2014 gjb

Copy stable/9 to releng/9.3 as part of the 9.3-RELEASE cycle.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation

# 225736 22-Sep-2011 kensmith

Copy head to stable/9 as part of 9.0-RELEASE release cycle.

Approved by: re (implicit)


# 206622 14-Apr-2010 uqs

mdoc: order prologue macros consistently by Dd/Dt/Os

Although groff_mdoc(7) gives another impression, this is the ordering
most widely used and also required by mdocml/mandoc.

Reviewed by: ru
Approved by: philip, ed (mentors)


# 167259 06-Mar-2007 mckusick

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


# 167010 26-Feb-2007 mckusick

Declare a `struct extattr' that defines the format of an extended
attribute. Also define some macros to manipulate one of these
structures. Explain their use in the extattr.9 manual page.

The next step will be to make a sweep through the kernel replacing
the old pointer manipulation code. To get an idea of how they would
be used, the ffs_findextattr() function in ufs/ffs/ffs_vnops.c is
currently written as follows:

/*
* Vnode operating to retrieve a named extended attribute.
*
* Locate a particular EA (nspace:name) in the area (ptr:length), and return
* the length of the EA, and possibly the pointer to the entry and to the data.
*/
static int
ffs_findextattr(u_char *ptr, u_int length, int nspace, const char *name,
u_char **eap, u_char **eac)
{
u_char *p, *pe, *pn, *p0;
int eapad1, eapad2, ealength, ealen, nlen;
uint32_t ul;

pe = ptr + length;
nlen = strlen(name);

for (p = ptr; p < pe; p = pn) {
p0 = p;
bcopy(p, &ul, sizeof(ul));
pn = p + ul;
/* make sure this entry is complete */
if (pn > pe)
break;
p += sizeof(uint32_t);
if (*p != nspace)
continue;
p++;
eapad2 = *p++;
if (*p != nlen)
continue;
p++;
if (bcmp(p, name, nlen))
continue;
ealength = sizeof(uint32_t) + 3 + nlen;
eapad1 = 8 - (ealength % 8);
if (eapad1 == 8)
eapad1 = 0;
ealength += eapad1;
ealen = ul - ealength - eapad2;
p += nlen + eapad1;
if (eap != NULL)
*eap = p0;
if (eac != NULL)
*eac = p;
return (ealen);
}
return(-1);
}

After applying the structure and macros, it would look like this:

/*
* Vnode operating to retrieve a named extended attribute.
*
* Locate a particular EA (nspace:name) in the area (ptr:length), and return
* the length of the EA, and possibly the pointer to the entry and to the data.
*/
static int
ffs_findextattr(u_char *ptr, u_int length, int nspace, const char *name,
u_char **eapp, u_char **eac)
{
struct extattr *eap, *eaend;

eaend = (struct extattr *)(ptr + length);
for (eap = (struct extattr *)ptr; eap < eaend; eap = EXTATTR_NEXT(eap)){
/* make sure this entry is complete */
if (EXTATTR_NEXT(eap) > eaend)
break;
if (eap->ea_namespace != nspace ||
eap->ea_namelength != length ||
bcmp(eap->ea_name, name, length))
continue;
if (eapp != NULL)
*eapp = eap;
if (eac != NULL)
*eac = EXTATTR_CONTENT(eap);
return (EXTATTR_CONTENT_SIZE(eap));
}
return(-1);
}

Not only is it considerably shorter, but it hopefully more readable :-)


# 147647 28-Jun-2005 hmp

Use 'manual page' instead of 'man page' for consistency.

Approved by: re (hrs)


# 121385 23-Oct-2003 hmp

Mdoc Janitor:

* Fix hard sentence breaks.


# 115876 05-Jun-2003 rwatson

Document VOP_LISTEXTATTR(9).

Obtained from: TrustedBSD Project
Sponsored by: DARPA, Network Associates Laboratories


# 115803 04-Jun-2003 rwatson

The vnode operations for extended attributes no longer suffer from
the features (bugs) in the BUGS section related to querying the
required buffer size, or telling if an overflow occured.


# 107788 12-Dec-2002 ru

Uniformly refer to a file system as "file system".

Approved by: re


# 96711 16-May-2002 trhodes

More file system > filesystem


# 84306 01-Oct-2001 ru

mdoc(7) police: Use the new .In macro for #include statements.


# 79727 14-Jul-2001 schweikh

Removed whitespace at end-of-line; no content changes. I simply did
cd src/share; find man[1-9] -type f|xargs perl -pi -e 's/[ \t]+$//'

BTW, what editors are the culprits? I'm using vim and it shows
me whitespace at EOL in troff files with a thick blue block...

Reviewed by: Silence from cvs diff -b
MFC after: 7 days


# 78686 23-Jun-2001 dd

Remove duplicate words.


# 74355 16-Mar-2001 rwatson

o The revenge of the mdoc(7) police:

- These pages abused Ar macro (they should have used Fa).
- NULL and other numeric constants should be marked with Dv.
- VOP_* in the ERRORS section for the EOPNOTSUPP entry should be marked
with Fn.

Submitted by: ru


# 74349 16-Mar-2001 ru

mdoc(7) police: empty lines outside displays cause warnings in -mdocNG.


# 74277 15-Mar-2001 rwatson

o Update some of the kernel man pages associated with extended attributes
to reflect EA API change to explicit namespacing.

Obtained from: TrustedBSD Project


# 70466 29-Dec-2000 ru

Prepare for mdoc(7)NG.


# 68753 15-Nov-2000 ben

remove fullstops from the end of .Xr lines in SEE ALSO sections.


# 55430 05-Jan-2000 rwatson

Man pages for the VFS extended attribute and access control list vnops.

Reviewed by: eivind