Add new errno ``ENOATTR''.
This commit is contained in:
parent
1acac5eba8
commit
9d9737ecb2
@ -29,6 +29,8 @@
|
|||||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
* 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
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
* SUCH DAMAGE.
|
* SUCH DAMAGE.
|
||||||
|
*
|
||||||
|
* $FreeBSD$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#if defined(LIBC_SCCS) && !defined(lint)
|
#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 */
|
"Value too large to be stored in data type", /* 84 - EOVERFLOW */
|
||||||
"Operation canceled", /* 85 - ECANCELED */
|
"Operation canceled", /* 85 - ECANCELED */
|
||||||
"Illegal byte sequence", /* 86 - EILSEQ */
|
"Illegal byte sequence", /* 86 - EILSEQ */
|
||||||
|
"Attribute not found", /* 87 - ENOATTR */
|
||||||
};
|
};
|
||||||
int errno;
|
int errno;
|
||||||
const int sys_nerr = sizeof(sys_errlist) / sizeof(sys_errlist[0]);
|
const int sys_nerr = sizeof(sys_errlist) / sizeof(sys_errlist[0]);
|
||||||
|
@ -451,6 +451,8 @@ The scheduled operation was canceled.
|
|||||||
While decoding a multibyte character the function came along an
|
While decoding a multibyte character the function came along an
|
||||||
invalid or an incomplete sequence of bytes or the given wide
|
invalid or an incomplete sequence of bytes or the given wide
|
||||||
character is invalid.
|
character is invalid.
|
||||||
|
.It Er 87 ENOATTR Em "Attribute not found"
|
||||||
|
The specified extended attribute does not exist.
|
||||||
.El
|
.El
|
||||||
.Sh DEFINITIONS
|
.Sh DEFINITIONS
|
||||||
.Bl -tag -width Ds
|
.Bl -tag -width Ds
|
||||||
|
@ -167,7 +167,8 @@ __END_DECLS
|
|||||||
#define EOVERFLOW 84 /* Value too large to be stored in data type */
|
#define EOVERFLOW 84 /* Value too large to be stored in data type */
|
||||||
#define ECANCELED 85 /* Operation canceled */
|
#define ECANCELED 85 /* Operation canceled */
|
||||||
#define EILSEQ 86 /* Illegal byte sequence */
|
#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 */
|
#endif /* _POSIX_SOURCE */
|
||||||
|
|
||||||
|
@ -242,10 +242,9 @@ ufs_getacl(ap)
|
|||||||
POSIX1E_ACL_ACCESS_EXTATTR_NAME, &len, (char *) ap->a_aclp,
|
POSIX1E_ACL_ACCESS_EXTATTR_NAME, &len, (char *) ap->a_aclp,
|
||||||
ap->a_td);
|
ap->a_td);
|
||||||
switch (error) {
|
switch (error) {
|
||||||
/* XXX: Will be ENOATTR. */
|
|
||||||
/* XXX: If ufs_getacl() should work on file systems without
|
/* XXX: If ufs_getacl() should work on file systems without
|
||||||
* the EA configured, add case EOPNOTSUPP here. */
|
* the EA configured, add case EOPNOTSUPP here. */
|
||||||
case ENOENT:
|
case ENOATTR:
|
||||||
/*
|
/*
|
||||||
* Legitimately no ACL set on object, purely
|
* Legitimately no ACL set on object, purely
|
||||||
* emulate it through the inode. These fields will
|
* emulate it through the inode. These fields will
|
||||||
@ -302,10 +301,9 @@ ufs_getacl(ap)
|
|||||||
* and an empty ACL, as required by POSIX.1e.
|
* and an empty ACL, as required by POSIX.1e.
|
||||||
*/
|
*/
|
||||||
switch (error) {
|
switch (error) {
|
||||||
/* XXX: Will be ENOATTR. */
|
|
||||||
/* XXX: If ufs_getacl() should work on file systems without
|
/* XXX: If ufs_getacl() should work on file systems without
|
||||||
* the EA configured, add case EOPNOTSUPP here. */
|
* the EA configured, add case EOPNOTSUPP here. */
|
||||||
case ENOENT:
|
case ENOATTR:
|
||||||
bzero(ap->a_aclp, sizeof(*ap->a_aclp));
|
bzero(ap->a_aclp, sizeof(*ap->a_aclp));
|
||||||
ap->a_aclp->acl_cnt = 0;
|
ap->a_aclp->acl_cnt = 0;
|
||||||
error = 0;
|
error = 0;
|
||||||
@ -420,10 +418,9 @@ ufs_setacl(ap)
|
|||||||
* XXX: Note that since we can't distinguish
|
* XXX: Note that since we can't distinguish
|
||||||
* "that EA is not supported" from "that EA is not
|
* "that EA is not supported" from "that EA is not
|
||||||
* defined", the success case here overlaps the
|
* 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 == ENOATTR)
|
||||||
if (error == ENOENT)
|
|
||||||
error = 0;
|
error = 0;
|
||||||
} else
|
} else
|
||||||
error = vn_extattr_set(ap->a_vp, IO_NODELOCKED,
|
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
|
* Map lack of attribute definition in UFS_EXTATTR into lack of
|
||||||
* support for ACLs on the file system.
|
* support for ACLs on the file system.
|
||||||
*/
|
*/
|
||||||
/* XXX: ENOENT here will eventually be ENOATTR. */
|
if (error == ENOATTR)
|
||||||
if (error == ENOENT)
|
|
||||||
return (EOPNOTSUPP);
|
return (EOPNOTSUPP);
|
||||||
if (error != 0)
|
if (error != 0)
|
||||||
return (error);
|
return (error);
|
||||||
|
@ -685,8 +685,7 @@ ufs_extattr_disable(struct ufsmount *ump, int attrnamespace,
|
|||||||
|
|
||||||
uele = ufs_extattr_find_attr(ump, attrnamespace, attrname);
|
uele = ufs_extattr_find_attr(ump, attrnamespace, attrname);
|
||||||
if (!uele)
|
if (!uele)
|
||||||
/* XXX: ENOENT here will eventually be ENOATTR. */
|
return (ENOATTR);
|
||||||
return (ENOENT);
|
|
||||||
|
|
||||||
LIST_REMOVE(uele, uele_entries);
|
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);
|
attribute = ufs_extattr_find_attr(ump, attrnamespace, name);
|
||||||
if (!attribute)
|
if (!attribute)
|
||||||
/* XXX: ENOENT here will eventually be ENOATTR. */
|
return (ENOATTR);
|
||||||
return (ENOENT);
|
|
||||||
|
|
||||||
if ((error = ufs_extattr_credcheck(vp, attribute, cred, td, IREAD)))
|
if ((error = ufs_extattr_credcheck(vp, attribute, cred, td, IREAD)))
|
||||||
return (error);
|
return (error);
|
||||||
@ -937,8 +935,7 @@ ufs_extattr_get(struct vnode *vp, int attrnamespace, const char *name,
|
|||||||
|
|
||||||
/* Defined? */
|
/* Defined? */
|
||||||
if ((ueh.ueh_flags & UFS_EXTATTR_ATTR_FLAG_INUSE) == 0) {
|
if ((ueh.ueh_flags & UFS_EXTATTR_ATTR_FLAG_INUSE) == 0) {
|
||||||
/* XXX: ENOENT here will eventually be ENOATTR. */
|
error = ENOATTR;
|
||||||
error = ENOENT;
|
|
||||||
goto vopunlock_exit;
|
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
|
* is to coerce this to undefined, and let it get cleaned
|
||||||
* up by the next write or extattrctl clean.
|
* up by the next write or extattrctl clean.
|
||||||
*/
|
*/
|
||||||
printf("ufs_extattr_get: inode number inconsistency (%d, %d)\n",
|
printf("ufs_extattr_get (%s): inode number inconsistency (%d, %d)\n",
|
||||||
ueh.ueh_i_gen, ip->i_gen);
|
mp->mnt_stat.f_mntonname, ueh.ueh_i_gen, ip->i_gen);
|
||||||
/* XXX: ENOENT here will eventually be ENOATTR. */
|
error = ENOATTR;
|
||||||
error = ENOENT;
|
|
||||||
goto vopunlock_exit;
|
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);
|
attribute = ufs_extattr_find_attr(ump, attrnamespace, name);
|
||||||
if (!attribute)
|
if (!attribute)
|
||||||
/* XXX: ENOENT here will eventually be ENOATTR. */
|
return (ENOATTR);
|
||||||
return (ENOENT);
|
|
||||||
|
|
||||||
if ((error = ufs_extattr_credcheck(vp, attribute, cred, td, IWRITE)))
|
if ((error = ufs_extattr_credcheck(vp, attribute, cred, td, IWRITE)))
|
||||||
return (error);
|
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);
|
attribute = ufs_extattr_find_attr(ump, attrnamespace, name);
|
||||||
if (!attribute)
|
if (!attribute)
|
||||||
/* XXX: ENOENT here will eventually be ENOATTR. */
|
return (ENOATTR);
|
||||||
return (ENOENT);
|
|
||||||
|
|
||||||
if ((error = ufs_extattr_credcheck(vp, attribute, cred, td, IWRITE)))
|
if ((error = ufs_extattr_credcheck(vp, attribute, cred, td, IWRITE)))
|
||||||
return (error);
|
return (error);
|
||||||
@ -1220,8 +1214,7 @@ ufs_extattr_rm(struct vnode *vp, int attrnamespace, const char *name,
|
|||||||
|
|
||||||
/* Defined? */
|
/* Defined? */
|
||||||
if ((ueh.ueh_flags & UFS_EXTATTR_ATTR_FLAG_INUSE) == 0) {
|
if ((ueh.ueh_flags & UFS_EXTATTR_ATTR_FLAG_INUSE) == 0) {
|
||||||
/* XXX: ENOENT here will eventually be ENOATTR. */
|
error = ENOATTR;
|
||||||
error = ENOENT;
|
|
||||||
goto vopunlock_exit;
|
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
|
* coerce this to undefined, and let it get cleaned up by
|
||||||
* the next write or extattrctl clean.
|
* the next write or extattrctl clean.
|
||||||
*/
|
*/
|
||||||
printf("ufs_extattr_rm: inode number inconsistency (%d, %d)\n",
|
printf("ufs_extattr_rm (%s): inode number inconsistency (%d, %d)\n",
|
||||||
ueh.ueh_i_gen, ip->i_gen);
|
mp->mnt_stat.f_mntonname, ueh.ueh_i_gen, ip->i_gen);
|
||||||
/* XXX: ENOENT here will eventually be ENOATTR. */
|
error = ENOATTR;
|
||||||
error = ENOENT;
|
|
||||||
goto vopunlock_exit;
|
goto vopunlock_exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user