xfs: convert attr to use unsigned names
To be consistent with the directory code, the attr code should use unsigned names. Convert the names from the vfs at the highest level to unsigned, and ænsure they are consistenly used as unsigned down to disk. Signed-off-by: Dave Chinner <david@fromorbit.com> Reviewed-by: Christoph Hellwig <hch@lst.de>
This commit is contained in:
Родитель
b9c4864957
Коммит
a9273ca5c6
|
@ -106,7 +106,7 @@ xfs_get_acl(struct inode *inode, int type)
|
||||||
struct posix_acl *acl;
|
struct posix_acl *acl;
|
||||||
struct xfs_acl *xfs_acl;
|
struct xfs_acl *xfs_acl;
|
||||||
int len = sizeof(struct xfs_acl);
|
int len = sizeof(struct xfs_acl);
|
||||||
char *ea_name;
|
unsigned char *ea_name;
|
||||||
int error;
|
int error;
|
||||||
|
|
||||||
acl = get_cached_acl(inode, type);
|
acl = get_cached_acl(inode, type);
|
||||||
|
@ -133,7 +133,8 @@ xfs_get_acl(struct inode *inode, int type)
|
||||||
if (!xfs_acl)
|
if (!xfs_acl)
|
||||||
return ERR_PTR(-ENOMEM);
|
return ERR_PTR(-ENOMEM);
|
||||||
|
|
||||||
error = -xfs_attr_get(ip, ea_name, (char *)xfs_acl, &len, ATTR_ROOT);
|
error = -xfs_attr_get(ip, ea_name, (unsigned char *)xfs_acl,
|
||||||
|
&len, ATTR_ROOT);
|
||||||
if (error) {
|
if (error) {
|
||||||
/*
|
/*
|
||||||
* If the attribute doesn't exist make sure we have a negative
|
* If the attribute doesn't exist make sure we have a negative
|
||||||
|
@ -162,7 +163,7 @@ STATIC int
|
||||||
xfs_set_acl(struct inode *inode, int type, struct posix_acl *acl)
|
xfs_set_acl(struct inode *inode, int type, struct posix_acl *acl)
|
||||||
{
|
{
|
||||||
struct xfs_inode *ip = XFS_I(inode);
|
struct xfs_inode *ip = XFS_I(inode);
|
||||||
char *ea_name;
|
unsigned char *ea_name;
|
||||||
int error;
|
int error;
|
||||||
|
|
||||||
if (S_ISLNK(inode->i_mode))
|
if (S_ISLNK(inode->i_mode))
|
||||||
|
@ -194,7 +195,7 @@ xfs_set_acl(struct inode *inode, int type, struct posix_acl *acl)
|
||||||
(sizeof(struct xfs_acl_entry) *
|
(sizeof(struct xfs_acl_entry) *
|
||||||
(XFS_ACL_MAX_ENTRIES - acl->a_count));
|
(XFS_ACL_MAX_ENTRIES - acl->a_count));
|
||||||
|
|
||||||
error = -xfs_attr_set(ip, ea_name, (char *)xfs_acl,
|
error = -xfs_attr_set(ip, ea_name, (unsigned char *)xfs_acl,
|
||||||
len, ATTR_ROOT);
|
len, ATTR_ROOT);
|
||||||
|
|
||||||
kfree(xfs_acl);
|
kfree(xfs_acl);
|
||||||
|
@ -262,7 +263,7 @@ xfs_set_mode(struct inode *inode, mode_t mode)
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
xfs_acl_exists(struct inode *inode, char *name)
|
xfs_acl_exists(struct inode *inode, unsigned char *name)
|
||||||
{
|
{
|
||||||
int len = sizeof(struct xfs_acl);
|
int len = sizeof(struct xfs_acl);
|
||||||
|
|
||||||
|
|
|
@ -447,12 +447,12 @@ xfs_attrlist_by_handle(
|
||||||
int
|
int
|
||||||
xfs_attrmulti_attr_get(
|
xfs_attrmulti_attr_get(
|
||||||
struct inode *inode,
|
struct inode *inode,
|
||||||
char *name,
|
unsigned char *name,
|
||||||
char __user *ubuf,
|
unsigned char __user *ubuf,
|
||||||
__uint32_t *len,
|
__uint32_t *len,
|
||||||
__uint32_t flags)
|
__uint32_t flags)
|
||||||
{
|
{
|
||||||
char *kbuf;
|
unsigned char *kbuf;
|
||||||
int error = EFAULT;
|
int error = EFAULT;
|
||||||
|
|
||||||
if (*len > XATTR_SIZE_MAX)
|
if (*len > XATTR_SIZE_MAX)
|
||||||
|
@ -476,12 +476,12 @@ xfs_attrmulti_attr_get(
|
||||||
int
|
int
|
||||||
xfs_attrmulti_attr_set(
|
xfs_attrmulti_attr_set(
|
||||||
struct inode *inode,
|
struct inode *inode,
|
||||||
char *name,
|
unsigned char *name,
|
||||||
const char __user *ubuf,
|
const unsigned char __user *ubuf,
|
||||||
__uint32_t len,
|
__uint32_t len,
|
||||||
__uint32_t flags)
|
__uint32_t flags)
|
||||||
{
|
{
|
||||||
char *kbuf;
|
unsigned char *kbuf;
|
||||||
int error = EFAULT;
|
int error = EFAULT;
|
||||||
|
|
||||||
if (IS_IMMUTABLE(inode) || IS_APPEND(inode))
|
if (IS_IMMUTABLE(inode) || IS_APPEND(inode))
|
||||||
|
@ -501,7 +501,7 @@ xfs_attrmulti_attr_set(
|
||||||
int
|
int
|
||||||
xfs_attrmulti_attr_remove(
|
xfs_attrmulti_attr_remove(
|
||||||
struct inode *inode,
|
struct inode *inode,
|
||||||
char *name,
|
unsigned char *name,
|
||||||
__uint32_t flags)
|
__uint32_t flags)
|
||||||
{
|
{
|
||||||
if (IS_IMMUTABLE(inode) || IS_APPEND(inode))
|
if (IS_IMMUTABLE(inode) || IS_APPEND(inode))
|
||||||
|
@ -519,7 +519,7 @@ xfs_attrmulti_by_handle(
|
||||||
xfs_fsop_attrmulti_handlereq_t am_hreq;
|
xfs_fsop_attrmulti_handlereq_t am_hreq;
|
||||||
struct dentry *dentry;
|
struct dentry *dentry;
|
||||||
unsigned int i, size;
|
unsigned int i, size;
|
||||||
char *attr_name;
|
unsigned char *attr_name;
|
||||||
|
|
||||||
if (!capable(CAP_SYS_ADMIN))
|
if (!capable(CAP_SYS_ADMIN))
|
||||||
return -XFS_ERROR(EPERM);
|
return -XFS_ERROR(EPERM);
|
||||||
|
@ -547,7 +547,7 @@ xfs_attrmulti_by_handle(
|
||||||
|
|
||||||
error = 0;
|
error = 0;
|
||||||
for (i = 0; i < am_hreq.opcount; i++) {
|
for (i = 0; i < am_hreq.opcount; i++) {
|
||||||
ops[i].am_error = strncpy_from_user(attr_name,
|
ops[i].am_error = strncpy_from_user((char *)attr_name,
|
||||||
ops[i].am_attrname, MAXNAMELEN);
|
ops[i].am_attrname, MAXNAMELEN);
|
||||||
if (ops[i].am_error == 0 || ops[i].am_error == MAXNAMELEN)
|
if (ops[i].am_error == 0 || ops[i].am_error == MAXNAMELEN)
|
||||||
error = -ERANGE;
|
error = -ERANGE;
|
||||||
|
|
|
@ -45,23 +45,23 @@ xfs_readlink_by_handle(
|
||||||
extern int
|
extern int
|
||||||
xfs_attrmulti_attr_get(
|
xfs_attrmulti_attr_get(
|
||||||
struct inode *inode,
|
struct inode *inode,
|
||||||
char *name,
|
unsigned char *name,
|
||||||
char __user *ubuf,
|
unsigned char __user *ubuf,
|
||||||
__uint32_t *len,
|
__uint32_t *len,
|
||||||
__uint32_t flags);
|
__uint32_t flags);
|
||||||
|
|
||||||
extern int
|
extern int
|
||||||
xfs_attrmulti_attr_set(
|
xfs_attrmulti_attr_set(
|
||||||
struct inode *inode,
|
struct inode *inode,
|
||||||
char *name,
|
unsigned char *name,
|
||||||
const char __user *ubuf,
|
const unsigned char __user *ubuf,
|
||||||
__uint32_t len,
|
__uint32_t len,
|
||||||
__uint32_t flags);
|
__uint32_t flags);
|
||||||
|
|
||||||
extern int
|
extern int
|
||||||
xfs_attrmulti_attr_remove(
|
xfs_attrmulti_attr_remove(
|
||||||
struct inode *inode,
|
struct inode *inode,
|
||||||
char *name,
|
unsigned char *name,
|
||||||
__uint32_t flags);
|
__uint32_t flags);
|
||||||
|
|
||||||
extern struct dentry *
|
extern struct dentry *
|
||||||
|
|
|
@ -411,7 +411,7 @@ xfs_compat_attrmulti_by_handle(
|
||||||
compat_xfs_fsop_attrmulti_handlereq_t am_hreq;
|
compat_xfs_fsop_attrmulti_handlereq_t am_hreq;
|
||||||
struct dentry *dentry;
|
struct dentry *dentry;
|
||||||
unsigned int i, size;
|
unsigned int i, size;
|
||||||
char *attr_name;
|
unsigned char *attr_name;
|
||||||
|
|
||||||
if (!capable(CAP_SYS_ADMIN))
|
if (!capable(CAP_SYS_ADMIN))
|
||||||
return -XFS_ERROR(EPERM);
|
return -XFS_ERROR(EPERM);
|
||||||
|
@ -440,7 +440,7 @@ xfs_compat_attrmulti_by_handle(
|
||||||
|
|
||||||
error = 0;
|
error = 0;
|
||||||
for (i = 0; i < am_hreq.opcount; i++) {
|
for (i = 0; i < am_hreq.opcount; i++) {
|
||||||
ops[i].am_error = strncpy_from_user(attr_name,
|
ops[i].am_error = strncpy_from_user((char *)attr_name,
|
||||||
compat_ptr(ops[i].am_attrname),
|
compat_ptr(ops[i].am_attrname),
|
||||||
MAXNAMELEN);
|
MAXNAMELEN);
|
||||||
if (ops[i].am_error == 0 || ops[i].am_error == MAXNAMELEN)
|
if (ops[i].am_error == 0 || ops[i].am_error == MAXNAMELEN)
|
||||||
|
|
|
@ -140,10 +140,10 @@ xfs_init_security(
|
||||||
struct xfs_inode *ip = XFS_I(inode);
|
struct xfs_inode *ip = XFS_I(inode);
|
||||||
size_t length;
|
size_t length;
|
||||||
void *value;
|
void *value;
|
||||||
char *name;
|
unsigned char *name;
|
||||||
int error;
|
int error;
|
||||||
|
|
||||||
error = security_inode_init_security(inode, dir, &name,
|
error = security_inode_init_security(inode, dir, (char **)&name,
|
||||||
&value, &length);
|
&value, &length);
|
||||||
if (error) {
|
if (error) {
|
||||||
if (error == -EOPNOTSUPP)
|
if (error == -EOPNOTSUPP)
|
||||||
|
|
|
@ -45,7 +45,7 @@ xfs_xattr_get(struct dentry *dentry, const char *name,
|
||||||
value = NULL;
|
value = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
error = -xfs_attr_get(ip, name, value, &asize, xflags);
|
error = -xfs_attr_get(ip, (unsigned char *)name, value, &asize, xflags);
|
||||||
if (error)
|
if (error)
|
||||||
return error;
|
return error;
|
||||||
return asize;
|
return asize;
|
||||||
|
@ -67,8 +67,9 @@ xfs_xattr_set(struct dentry *dentry, const char *name, const void *value,
|
||||||
xflags |= ATTR_REPLACE;
|
xflags |= ATTR_REPLACE;
|
||||||
|
|
||||||
if (!value)
|
if (!value)
|
||||||
return -xfs_attr_remove(ip, name, xflags);
|
return -xfs_attr_remove(ip, (unsigned char *)name, xflags);
|
||||||
return -xfs_attr_set(ip, name, (void *)value, size, xflags);
|
return -xfs_attr_set(ip, (unsigned char *)name,
|
||||||
|
(void *)value, size, xflags);
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct xattr_handler xfs_xattr_user_handler = {
|
static struct xattr_handler xfs_xattr_user_handler = {
|
||||||
|
@ -124,8 +125,13 @@ static const char *xfs_xattr_prefix(int flags)
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
xfs_xattr_put_listent(struct xfs_attr_list_context *context, int flags,
|
xfs_xattr_put_listent(
|
||||||
char *name, int namelen, int valuelen, char *value)
|
struct xfs_attr_list_context *context,
|
||||||
|
int flags,
|
||||||
|
unsigned char *name,
|
||||||
|
int namelen,
|
||||||
|
int valuelen,
|
||||||
|
unsigned char *value)
|
||||||
{
|
{
|
||||||
unsigned int prefix_len = xfs_xattr_prefix_len(flags);
|
unsigned int prefix_len = xfs_xattr_prefix_len(flags);
|
||||||
char *offset;
|
char *offset;
|
||||||
|
@ -148,7 +154,7 @@ xfs_xattr_put_listent(struct xfs_attr_list_context *context, int flags,
|
||||||
offset = (char *)context->alist + context->count;
|
offset = (char *)context->alist + context->count;
|
||||||
strncpy(offset, xfs_xattr_prefix(flags), prefix_len);
|
strncpy(offset, xfs_xattr_prefix(flags), prefix_len);
|
||||||
offset += prefix_len;
|
offset += prefix_len;
|
||||||
strncpy(offset, name, namelen); /* real name */
|
strncpy(offset, (char *)name, namelen); /* real name */
|
||||||
offset += namelen;
|
offset += namelen;
|
||||||
*offset = '\0';
|
*offset = '\0';
|
||||||
context->count += prefix_len + namelen + 1;
|
context->count += prefix_len + namelen + 1;
|
||||||
|
@ -156,8 +162,13 @@ xfs_xattr_put_listent(struct xfs_attr_list_context *context, int flags,
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
xfs_xattr_put_listent_sizes(struct xfs_attr_list_context *context, int flags,
|
xfs_xattr_put_listent_sizes(
|
||||||
char *name, int namelen, int valuelen, char *value)
|
struct xfs_attr_list_context *context,
|
||||||
|
int flags,
|
||||||
|
unsigned char *name,
|
||||||
|
int namelen,
|
||||||
|
int valuelen,
|
||||||
|
unsigned char *value)
|
||||||
{
|
{
|
||||||
context->count += xfs_xattr_prefix_len(flags) + namelen + 1;
|
context->count += xfs_xattr_prefix_len(flags) + namelen + 1;
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -36,8 +36,8 @@ struct xfs_acl {
|
||||||
};
|
};
|
||||||
|
|
||||||
/* On-disk XFS extended attribute names */
|
/* On-disk XFS extended attribute names */
|
||||||
#define SGI_ACL_FILE "SGI_ACL_FILE"
|
#define SGI_ACL_FILE (unsigned char *)"SGI_ACL_FILE"
|
||||||
#define SGI_ACL_DEFAULT "SGI_ACL_DEFAULT"
|
#define SGI_ACL_DEFAULT (unsigned char *)"SGI_ACL_DEFAULT"
|
||||||
#define SGI_ACL_FILE_SIZE (sizeof(SGI_ACL_FILE)-1)
|
#define SGI_ACL_FILE_SIZE (sizeof(SGI_ACL_FILE)-1)
|
||||||
#define SGI_ACL_DEFAULT_SIZE (sizeof(SGI_ACL_DEFAULT)-1)
|
#define SGI_ACL_DEFAULT_SIZE (sizeof(SGI_ACL_DEFAULT)-1)
|
||||||
|
|
||||||
|
|
|
@ -93,12 +93,12 @@ STATIC int xfs_attr_rmtval_remove(xfs_da_args_t *args);
|
||||||
STATIC int
|
STATIC int
|
||||||
xfs_attr_name_to_xname(
|
xfs_attr_name_to_xname(
|
||||||
struct xfs_name *xname,
|
struct xfs_name *xname,
|
||||||
const char *aname)
|
const unsigned char *aname)
|
||||||
{
|
{
|
||||||
if (!aname)
|
if (!aname)
|
||||||
return EINVAL;
|
return EINVAL;
|
||||||
xname->name = aname;
|
xname->name = aname;
|
||||||
xname->len = strlen(aname);
|
xname->len = strlen((char *)aname);
|
||||||
if (xname->len >= MAXNAMELEN)
|
if (xname->len >= MAXNAMELEN)
|
||||||
return EFAULT; /* match IRIX behaviour */
|
return EFAULT; /* match IRIX behaviour */
|
||||||
|
|
||||||
|
@ -124,7 +124,7 @@ STATIC int
|
||||||
xfs_attr_get_int(
|
xfs_attr_get_int(
|
||||||
struct xfs_inode *ip,
|
struct xfs_inode *ip,
|
||||||
struct xfs_name *name,
|
struct xfs_name *name,
|
||||||
char *value,
|
unsigned char *value,
|
||||||
int *valuelenp,
|
int *valuelenp,
|
||||||
int flags)
|
int flags)
|
||||||
{
|
{
|
||||||
|
@ -171,8 +171,8 @@ xfs_attr_get_int(
|
||||||
int
|
int
|
||||||
xfs_attr_get(
|
xfs_attr_get(
|
||||||
xfs_inode_t *ip,
|
xfs_inode_t *ip,
|
||||||
const char *name,
|
const unsigned char *name,
|
||||||
char *value,
|
unsigned char *value,
|
||||||
int *valuelenp,
|
int *valuelenp,
|
||||||
int flags)
|
int flags)
|
||||||
{
|
{
|
||||||
|
@ -235,8 +235,12 @@ xfs_attr_calc_size(
|
||||||
}
|
}
|
||||||
|
|
||||||
STATIC int
|
STATIC int
|
||||||
xfs_attr_set_int(xfs_inode_t *dp, struct xfs_name *name,
|
xfs_attr_set_int(
|
||||||
char *value, int valuelen, int flags)
|
struct xfs_inode *dp,
|
||||||
|
struct xfs_name *name,
|
||||||
|
unsigned char *value,
|
||||||
|
int valuelen,
|
||||||
|
int flags)
|
||||||
{
|
{
|
||||||
xfs_da_args_t args;
|
xfs_da_args_t args;
|
||||||
xfs_fsblock_t firstblock;
|
xfs_fsblock_t firstblock;
|
||||||
|
@ -452,8 +456,8 @@ out:
|
||||||
int
|
int
|
||||||
xfs_attr_set(
|
xfs_attr_set(
|
||||||
xfs_inode_t *dp,
|
xfs_inode_t *dp,
|
||||||
const char *name,
|
const unsigned char *name,
|
||||||
char *value,
|
unsigned char *value,
|
||||||
int valuelen,
|
int valuelen,
|
||||||
int flags)
|
int flags)
|
||||||
{
|
{
|
||||||
|
@ -600,7 +604,7 @@ out:
|
||||||
int
|
int
|
||||||
xfs_attr_remove(
|
xfs_attr_remove(
|
||||||
xfs_inode_t *dp,
|
xfs_inode_t *dp,
|
||||||
const char *name,
|
const unsigned char *name,
|
||||||
int flags)
|
int flags)
|
||||||
{
|
{
|
||||||
int error;
|
int error;
|
||||||
|
@ -669,9 +673,13 @@ xfs_attr_list_int(xfs_attr_list_context_t *context)
|
||||||
*/
|
*/
|
||||||
/*ARGSUSED*/
|
/*ARGSUSED*/
|
||||||
STATIC int
|
STATIC int
|
||||||
xfs_attr_put_listent(xfs_attr_list_context_t *context, int flags,
|
xfs_attr_put_listent(
|
||||||
char *name, int namelen,
|
xfs_attr_list_context_t *context,
|
||||||
int valuelen, char *value)
|
int flags,
|
||||||
|
unsigned char *name,
|
||||||
|
int namelen,
|
||||||
|
int valuelen,
|
||||||
|
unsigned char *value)
|
||||||
{
|
{
|
||||||
struct attrlist *alist = (struct attrlist *)context->alist;
|
struct attrlist *alist = (struct attrlist *)context->alist;
|
||||||
attrlist_ent_t *aep;
|
attrlist_ent_t *aep;
|
||||||
|
@ -1980,7 +1988,7 @@ xfs_attr_rmtval_get(xfs_da_args_t *args)
|
||||||
xfs_bmbt_irec_t map[ATTR_RMTVALUE_MAPSIZE];
|
xfs_bmbt_irec_t map[ATTR_RMTVALUE_MAPSIZE];
|
||||||
xfs_mount_t *mp;
|
xfs_mount_t *mp;
|
||||||
xfs_daddr_t dblkno;
|
xfs_daddr_t dblkno;
|
||||||
xfs_caddr_t dst;
|
void *dst;
|
||||||
xfs_buf_t *bp;
|
xfs_buf_t *bp;
|
||||||
int nmap, error, tmp, valuelen, blkcnt, i;
|
int nmap, error, tmp, valuelen, blkcnt, i;
|
||||||
xfs_dablk_t lblkno;
|
xfs_dablk_t lblkno;
|
||||||
|
@ -2039,7 +2047,7 @@ xfs_attr_rmtval_set(xfs_da_args_t *args)
|
||||||
xfs_inode_t *dp;
|
xfs_inode_t *dp;
|
||||||
xfs_bmbt_irec_t map;
|
xfs_bmbt_irec_t map;
|
||||||
xfs_daddr_t dblkno;
|
xfs_daddr_t dblkno;
|
||||||
xfs_caddr_t src;
|
void *src;
|
||||||
xfs_buf_t *bp;
|
xfs_buf_t *bp;
|
||||||
xfs_dablk_t lblkno;
|
xfs_dablk_t lblkno;
|
||||||
int blkcnt, valuelen, nmap, error, tmp, committed;
|
int blkcnt, valuelen, nmap, error, tmp, committed;
|
||||||
|
|
|
@ -113,7 +113,7 @@ typedef struct attrlist_cursor_kern {
|
||||||
|
|
||||||
|
|
||||||
typedef int (*put_listent_func_t)(struct xfs_attr_list_context *, int,
|
typedef int (*put_listent_func_t)(struct xfs_attr_list_context *, int,
|
||||||
char *, int, int, char *);
|
unsigned char *, int, int, unsigned char *);
|
||||||
|
|
||||||
typedef struct xfs_attr_list_context {
|
typedef struct xfs_attr_list_context {
|
||||||
struct xfs_inode *dp; /* inode */
|
struct xfs_inode *dp; /* inode */
|
||||||
|
|
|
@ -521,11 +521,11 @@ xfs_attr_shortform_to_leaf(xfs_da_args_t *args)
|
||||||
|
|
||||||
sfe = &sf->list[0];
|
sfe = &sf->list[0];
|
||||||
for (i = 0; i < sf->hdr.count; i++) {
|
for (i = 0; i < sf->hdr.count; i++) {
|
||||||
nargs.name = (char *)sfe->nameval;
|
nargs.name = sfe->nameval;
|
||||||
nargs.namelen = sfe->namelen;
|
nargs.namelen = sfe->namelen;
|
||||||
nargs.value = (char *)&sfe->nameval[nargs.namelen];
|
nargs.value = &sfe->nameval[nargs.namelen];
|
||||||
nargs.valuelen = sfe->valuelen;
|
nargs.valuelen = sfe->valuelen;
|
||||||
nargs.hashval = xfs_da_hashname((char *)sfe->nameval,
|
nargs.hashval = xfs_da_hashname(sfe->nameval,
|
||||||
sfe->namelen);
|
sfe->namelen);
|
||||||
nargs.flags = XFS_ATTR_NSP_ONDISK_TO_ARGS(sfe->flags);
|
nargs.flags = XFS_ATTR_NSP_ONDISK_TO_ARGS(sfe->flags);
|
||||||
error = xfs_attr_leaf_lookup_int(bp, &nargs); /* set a->index */
|
error = xfs_attr_leaf_lookup_int(bp, &nargs); /* set a->index */
|
||||||
|
@ -612,10 +612,10 @@ xfs_attr_shortform_list(xfs_attr_list_context_t *context)
|
||||||
for (i = 0, sfe = &sf->list[0]; i < sf->hdr.count; i++) {
|
for (i = 0, sfe = &sf->list[0]; i < sf->hdr.count; i++) {
|
||||||
error = context->put_listent(context,
|
error = context->put_listent(context,
|
||||||
sfe->flags,
|
sfe->flags,
|
||||||
(char *)sfe->nameval,
|
sfe->nameval,
|
||||||
(int)sfe->namelen,
|
(int)sfe->namelen,
|
||||||
(int)sfe->valuelen,
|
(int)sfe->valuelen,
|
||||||
(char*)&sfe->nameval[sfe->namelen]);
|
&sfe->nameval[sfe->namelen]);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Either search callback finished early or
|
* Either search callback finished early or
|
||||||
|
@ -659,8 +659,8 @@ xfs_attr_shortform_list(xfs_attr_list_context_t *context)
|
||||||
}
|
}
|
||||||
|
|
||||||
sbp->entno = i;
|
sbp->entno = i;
|
||||||
sbp->hash = xfs_da_hashname((char *)sfe->nameval, sfe->namelen);
|
sbp->hash = xfs_da_hashname(sfe->nameval, sfe->namelen);
|
||||||
sbp->name = (char *)sfe->nameval;
|
sbp->name = sfe->nameval;
|
||||||
sbp->namelen = sfe->namelen;
|
sbp->namelen = sfe->namelen;
|
||||||
/* These are bytes, and both on-disk, don't endian-flip */
|
/* These are bytes, and both on-disk, don't endian-flip */
|
||||||
sbp->valuelen = sfe->valuelen;
|
sbp->valuelen = sfe->valuelen;
|
||||||
|
@ -818,9 +818,9 @@ xfs_attr_leaf_to_shortform(xfs_dabuf_t *bp, xfs_da_args_t *args, int forkoff)
|
||||||
continue;
|
continue;
|
||||||
ASSERT(entry->flags & XFS_ATTR_LOCAL);
|
ASSERT(entry->flags & XFS_ATTR_LOCAL);
|
||||||
name_loc = xfs_attr_leaf_name_local(leaf, i);
|
name_loc = xfs_attr_leaf_name_local(leaf, i);
|
||||||
nargs.name = (char *)name_loc->nameval;
|
nargs.name = name_loc->nameval;
|
||||||
nargs.namelen = name_loc->namelen;
|
nargs.namelen = name_loc->namelen;
|
||||||
nargs.value = (char *)&name_loc->nameval[nargs.namelen];
|
nargs.value = &name_loc->nameval[nargs.namelen];
|
||||||
nargs.valuelen = be16_to_cpu(name_loc->valuelen);
|
nargs.valuelen = be16_to_cpu(name_loc->valuelen);
|
||||||
nargs.hashval = be32_to_cpu(entry->hashval);
|
nargs.hashval = be32_to_cpu(entry->hashval);
|
||||||
nargs.flags = XFS_ATTR_NSP_ONDISK_TO_ARGS(entry->flags);
|
nargs.flags = XFS_ATTR_NSP_ONDISK_TO_ARGS(entry->flags);
|
||||||
|
@ -2370,10 +2370,10 @@ xfs_attr_leaf_list_int(xfs_dabuf_t *bp, xfs_attr_list_context_t *context)
|
||||||
|
|
||||||
retval = context->put_listent(context,
|
retval = context->put_listent(context,
|
||||||
entry->flags,
|
entry->flags,
|
||||||
(char *)name_loc->nameval,
|
name_loc->nameval,
|
||||||
(int)name_loc->namelen,
|
(int)name_loc->namelen,
|
||||||
be16_to_cpu(name_loc->valuelen),
|
be16_to_cpu(name_loc->valuelen),
|
||||||
(char *)&name_loc->nameval[name_loc->namelen]);
|
&name_loc->nameval[name_loc->namelen]);
|
||||||
if (retval)
|
if (retval)
|
||||||
return retval;
|
return retval;
|
||||||
} else {
|
} else {
|
||||||
|
@ -2397,15 +2397,15 @@ xfs_attr_leaf_list_int(xfs_dabuf_t *bp, xfs_attr_list_context_t *context)
|
||||||
return retval;
|
return retval;
|
||||||
retval = context->put_listent(context,
|
retval = context->put_listent(context,
|
||||||
entry->flags,
|
entry->flags,
|
||||||
(char *)name_rmt->name,
|
name_rmt->name,
|
||||||
(int)name_rmt->namelen,
|
(int)name_rmt->namelen,
|
||||||
valuelen,
|
valuelen,
|
||||||
(char*)args.value);
|
args.value);
|
||||||
kmem_free(args.value);
|
kmem_free(args.value);
|
||||||
} else {
|
} else {
|
||||||
retval = context->put_listent(context,
|
retval = context->put_listent(context,
|
||||||
entry->flags,
|
entry->flags,
|
||||||
(char *)name_rmt->name,
|
name_rmt->name,
|
||||||
(int)name_rmt->namelen,
|
(int)name_rmt->namelen,
|
||||||
valuelen,
|
valuelen,
|
||||||
NULL);
|
NULL);
|
||||||
|
|
|
@ -52,7 +52,7 @@ typedef struct xfs_attr_sf_sort {
|
||||||
__uint8_t valuelen; /* length of value */
|
__uint8_t valuelen; /* length of value */
|
||||||
__uint8_t flags; /* flags bits (see xfs_attr_leaf.h) */
|
__uint8_t flags; /* flags bits (see xfs_attr_leaf.h) */
|
||||||
xfs_dahash_t hash; /* this entry's hash value */
|
xfs_dahash_t hash; /* this entry's hash value */
|
||||||
char *name; /* name value, pointer into buffer */
|
unsigned char *name; /* name value, pointer into buffer */
|
||||||
} xfs_attr_sf_sort_t;
|
} xfs_attr_sf_sort_t;
|
||||||
|
|
||||||
#define XFS_ATTR_SF_ENTSIZE_BYNAME(nlen,vlen) /* space name/value uses */ \
|
#define XFS_ATTR_SF_ENTSIZE_BYNAME(nlen,vlen) /* space name/value uses */ \
|
||||||
|
|
|
@ -43,11 +43,11 @@ int xfs_change_file_space(struct xfs_inode *ip, int cmd,
|
||||||
int xfs_rename(struct xfs_inode *src_dp, struct xfs_name *src_name,
|
int xfs_rename(struct xfs_inode *src_dp, struct xfs_name *src_name,
|
||||||
struct xfs_inode *src_ip, struct xfs_inode *target_dp,
|
struct xfs_inode *src_ip, struct xfs_inode *target_dp,
|
||||||
struct xfs_name *target_name, struct xfs_inode *target_ip);
|
struct xfs_name *target_name, struct xfs_inode *target_ip);
|
||||||
int xfs_attr_get(struct xfs_inode *ip, const char *name, char *value,
|
int xfs_attr_get(struct xfs_inode *ip, const unsigned char *name,
|
||||||
int *valuelenp, int flags);
|
unsigned char *value, int *valuelenp, int flags);
|
||||||
int xfs_attr_set(struct xfs_inode *dp, const char *name, char *value,
|
int xfs_attr_set(struct xfs_inode *dp, const unsigned char *name,
|
||||||
int valuelen, int flags);
|
unsigned char *value, int valuelen, int flags);
|
||||||
int xfs_attr_remove(struct xfs_inode *dp, const char *name, int flags);
|
int xfs_attr_remove(struct xfs_inode *dp, const unsigned char *name, int flags);
|
||||||
int xfs_attr_list(struct xfs_inode *dp, char *buffer, int bufsize,
|
int xfs_attr_list(struct xfs_inode *dp, char *buffer, int bufsize,
|
||||||
int flags, struct attrlist_cursor_kern *cursor);
|
int flags, struct attrlist_cursor_kern *cursor);
|
||||||
ssize_t xfs_read(struct xfs_inode *ip, struct kiocb *iocb,
|
ssize_t xfs_read(struct xfs_inode *ip, struct kiocb *iocb,
|
||||||
|
|
Загрузка…
Ссылка в новой задаче