diff options
-rw-r--r-- | lib/libc/gen/errlst.c | 3 | ||||
-rw-r--r-- | lib/libc/sys/intro.2 | 2 | ||||
-rw-r--r-- | sys/sys/errno.h | 3 | ||||
-rw-r--r-- | sys/ufs/ufs/ufs_acl.c | 14 | ||||
-rw-r--r-- | sys/ufs/ufs/ufs_extattr.c | 32 |
5 files changed, 24 insertions, 30 deletions
diff --git a/lib/libc/gen/errlst.c b/lib/libc/gen/errlst.c index a643794..4d66fbe 100644 --- a/lib/libc/gen/errlst.c +++ b/lib/libc/gen/errlst.c @@ -29,6 +29,8 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. + * + * $FreeBSD$ */ #if defined(LIBC_SCCS) && !defined(lint) @@ -143,6 +145,7 @@ const char *const sys_errlist[] = { "Value too large to be stored in data type", /* 84 - EOVERFLOW */ "Operation canceled", /* 85 - ECANCELED */ "Illegal byte sequence", /* 86 - EILSEQ */ + "Attribute not found", /* 87 - ENOATTR */ }; int errno; const int sys_nerr = sizeof(sys_errlist) / sizeof(sys_errlist[0]); diff --git a/lib/libc/sys/intro.2 b/lib/libc/sys/intro.2 index 9780339..75ed27b 100644 --- a/lib/libc/sys/intro.2 +++ b/lib/libc/sys/intro.2 @@ -451,6 +451,8 @@ The scheduled operation was canceled. While decoding a multibyte character the function came along an invalid or an incomplete sequence of bytes or the given wide character is invalid. +.It Er 87 ENOATTR Em "Attribute not found" +The specified extended attribute does not exist. .El .Sh DEFINITIONS .Bl -tag -width Ds diff --git a/sys/sys/errno.h b/sys/sys/errno.h index b09c56f..7f274d9 100644 --- a/sys/sys/errno.h +++ b/sys/sys/errno.h @@ -167,7 +167,8 @@ __END_DECLS #define EOVERFLOW 84 /* Value too large to be stored in data type */ #define ECANCELED 85 /* Operation canceled */ #define EILSEQ 86 /* Illegal byte sequence */ -#define ELAST 86 /* Must be equal largest errno */ +#define ENOATTR 87 /* Attribute not found */ +#define ELAST 87 /* Must be equal largest errno */ #endif /* _POSIX_SOURCE */ diff --git a/sys/ufs/ufs/ufs_acl.c b/sys/ufs/ufs/ufs_acl.c index e5f79f1..242691a 100644 --- a/sys/ufs/ufs/ufs_acl.c +++ b/sys/ufs/ufs/ufs_acl.c @@ -242,10 +242,9 @@ ufs_getacl(ap) POSIX1E_ACL_ACCESS_EXTATTR_NAME, &len, (char *) ap->a_aclp, ap->a_td); switch (error) { - /* XXX: Will be ENOATTR. */ /* XXX: If ufs_getacl() should work on file systems without * the EA configured, add case EOPNOTSUPP here. */ - case ENOENT: + case ENOATTR: /* * Legitimately no ACL set on object, purely * emulate it through the inode. These fields will @@ -302,10 +301,9 @@ ufs_getacl(ap) * and an empty ACL, as required by POSIX.1e. */ switch (error) { - /* XXX: Will be ENOATTR. */ /* XXX: If ufs_getacl() should work on file systems without * the EA configured, add case EOPNOTSUPP here. */ - case ENOENT: + case ENOATTR: bzero(ap->a_aclp, sizeof(*ap->a_aclp)); ap->a_aclp->acl_cnt = 0; error = 0; @@ -420,10 +418,9 @@ ufs_setacl(ap) * XXX: Note that since we can't distinguish * "that EA is not supported" from "that EA is not * defined", the success case here overlaps the - * the ENOENT->EOPNOTSUPP case below. + * the ENOATTR->EOPNOTSUPP case below. */ - /* XXX: the ENOENT here will eventually be ENOATTR. */ - if (error == ENOENT) + if (error == ENOATTR) error = 0; } else error = vn_extattr_set(ap->a_vp, IO_NODELOCKED, @@ -439,8 +436,7 @@ ufs_setacl(ap) * Map lack of attribute definition in UFS_EXTATTR into lack of * support for ACLs on the file system. */ - /* XXX: ENOENT here will eventually be ENOATTR. */ - if (error == ENOENT) + if (error == ENOATTR) return (EOPNOTSUPP); if (error != 0) return (error); diff --git a/sys/ufs/ufs/ufs_extattr.c b/sys/ufs/ufs/ufs_extattr.c index 2ab61fb..55f3fa9 100644 --- a/sys/ufs/ufs/ufs_extattr.c +++ b/sys/ufs/ufs/ufs_extattr.c @@ -685,8 +685,7 @@ ufs_extattr_disable(struct ufsmount *ump, int attrnamespace, uele = ufs_extattr_find_attr(ump, attrnamespace, attrname); if (!uele) - /* XXX: ENOENT here will eventually be ENOATTR. */ - return (ENOENT); + return (ENOATTR); LIST_REMOVE(uele, uele_entries); @@ -881,8 +880,7 @@ ufs_extattr_get(struct vnode *vp, int attrnamespace, const char *name, attribute = ufs_extattr_find_attr(ump, attrnamespace, name); if (!attribute) - /* XXX: ENOENT here will eventually be ENOATTR. */ - return (ENOENT); + return (ENOATTR); if ((error = ufs_extattr_credcheck(vp, attribute, cred, td, IREAD))) return (error); @@ -937,8 +935,7 @@ ufs_extattr_get(struct vnode *vp, int attrnamespace, const char *name, /* Defined? */ if ((ueh.ueh_flags & UFS_EXTATTR_ATTR_FLAG_INUSE) == 0) { - /* XXX: ENOENT here will eventually be ENOATTR. */ - error = ENOENT; + error = ENOATTR; goto vopunlock_exit; } @@ -950,10 +947,9 @@ ufs_extattr_get(struct vnode *vp, int attrnamespace, const char *name, * is to coerce this to undefined, and let it get cleaned * up by the next write or extattrctl clean. */ - printf("ufs_extattr_get: inode number inconsistency (%d, %d)\n", - ueh.ueh_i_gen, ip->i_gen); - /* XXX: ENOENT here will eventually be ENOATTR. */ - error = ENOENT; + printf("ufs_extattr_get (%s): inode number inconsistency (%d, %d)\n", + mp->mnt_stat.f_mntonname, ueh.ueh_i_gen, ip->i_gen); + error = ENOATTR; goto vopunlock_exit; } @@ -1062,8 +1058,7 @@ ufs_extattr_set(struct vnode *vp, int attrnamespace, const char *name, attribute = ufs_extattr_find_attr(ump, attrnamespace, name); if (!attribute) - /* XXX: ENOENT here will eventually be ENOATTR. */ - return (ENOENT); + return (ENOATTR); if ((error = ufs_extattr_credcheck(vp, attribute, cred, td, IWRITE))) return (error); @@ -1174,8 +1169,7 @@ ufs_extattr_rm(struct vnode *vp, int attrnamespace, const char *name, attribute = ufs_extattr_find_attr(ump, attrnamespace, name); if (!attribute) - /* XXX: ENOENT here will eventually be ENOATTR. */ - return (ENOENT); + return (ENOATTR); if ((error = ufs_extattr_credcheck(vp, attribute, cred, td, IWRITE))) return (error); @@ -1220,8 +1214,7 @@ ufs_extattr_rm(struct vnode *vp, int attrnamespace, const char *name, /* Defined? */ if ((ueh.ueh_flags & UFS_EXTATTR_ATTR_FLAG_INUSE) == 0) { - /* XXX: ENOENT here will eventually be ENOATTR. */ - error = ENOENT; + error = ENOATTR; goto vopunlock_exit; } @@ -1233,10 +1226,9 @@ ufs_extattr_rm(struct vnode *vp, int attrnamespace, const char *name, * coerce this to undefined, and let it get cleaned up by * the next write or extattrctl clean. */ - printf("ufs_extattr_rm: inode number inconsistency (%d, %d)\n", - ueh.ueh_i_gen, ip->i_gen); - /* XXX: ENOENT here will eventually be ENOATTR. */ - error = ENOENT; + printf("ufs_extattr_rm (%s): inode number inconsistency (%d, %d)\n", + mp->mnt_stat.f_mntonname, ueh.ueh_i_gen, ip->i_gen); + error = ENOATTR; goto vopunlock_exit; } |