/* Compute the hash value for a user/root/secure extended attribute */
xfs_dahash_t
xfs_attr_hashname(
- const uint8_t *name,
+ const char *name,
int namelen)
{
return xfs_da_hashname(name, namelen);
xfs_attr_hashval(
struct xfs_mount *mp,
unsigned int attr_flags,
- const uint8_t *name,
+ const char *name,
int namelen,
const void *value,
int valuelen)
return xfs_attr_init_add_state(args);
}
-xfs_dahash_t xfs_attr_hashname(const uint8_t *name, int namelen);
+xfs_dahash_t xfs_attr_hashname(const char *name, int namelen);
xfs_dahash_t xfs_attr_hashval(struct xfs_mount *mp, unsigned int attr_flags,
- const uint8_t *name, int namelen, const void *value,
+ const char *name, int namelen, const void *value,
int valuelen);
/* Set the hash value for any extended attribute from any namespace. */
sfe = xfs_attr_sf_firstentry(sf);
for (i = 0; i < sf->count; i++) {
- nargs.name = sfe->nameval;
+ nargs.name = (const char *)sfe->nameval;
nargs.namelen = sfe->namelen;
nargs.value = &sfe->nameval[nargs.namelen];
nargs.valuelen = sfe->valuelen;
continue;
ASSERT(entry->flags & XFS_ATTR_LOCAL);
name_loc = xfs_attr3_leaf_name_local(leaf, i);
- nargs.name = name_loc->nameval;
+ nargs.name = (const char *)name_loc->nameval;
nargs.namelen = name_loc->namelen;
nargs.value = &name_loc->nameval[nargs.namelen];
nargs.valuelen = be16_to_cpu(name_loc->valuelen);
* This is implemented with some source-level loop unrolling.
*/
xfs_dahash_t
-xfs_da_hashname(const uint8_t *name, int namelen)
+xfs_da_hashname(const char *_name, int namelen)
{
+ const uint8_t *name = (const uint8_t *)_name;
xfs_dahash_t hash;
/*
*/
typedef struct xfs_da_args {
struct xfs_da_geometry *geo; /* da block geometry */
- const uint8_t *name; /* string (maybe not NULL terminated) */
- const uint8_t *new_name; /* new attr name */
+ const char *name; /* string (maybe not NULL terminated) */
+ const char *new_name; /* new attr name */
void *value; /* set of bytes (maybe contain NULLs) */
void *new_value; /* new xattr value (may contain NULLs) */
struct xfs_inode *dp; /* directory inode to manipulate */
void xfs_da_buf_copy(struct xfs_buf *dst, struct xfs_buf *src,
size_t size);
-uint xfs_da_hashname(const uint8_t *name_string, int name_length);
+uint xfs_da_hashname(const char *name_string, int name_length);
enum xfs_dacmp xfs_da_compname(struct xfs_da_args *args,
const unsigned char *name, int len);
#include "xfs_ialloc.h"
const struct xfs_name xfs_name_dotdot = {
- .name = (const unsigned char *)"..",
+ .name = "..",
.len = 2,
.type = XFS_DIR3_FT_DIR,
};
const struct xfs_name xfs_name_dot = {
- .name = (const unsigned char *)".",
+ .name = ".",
.len = 1,
.type = XFS_DIR3_FT_DIR,
};
void
xfs_dir_startup(void)
{
- xfs_dir_hash_dot = xfs_da_hashname((unsigned char *)".", 1);
- xfs_dir_hash_dotdot = xfs_da_hashname((unsigned char *)"..", 2);
+ xfs_dir_hash_dot = xfs_da_hashname(".", 1);
+ xfs_dir_hash_dotdot = xfs_da_hashname("..", 2);
}
static xfs_failaddr_t
tagp = xfs_dir2_data_entry_tag_p(mp, dep);
*tagp = cpu_to_be16(newoffset);
xfs_dir2_data_log_entry(args, bp, dep);
- name.name = sfep->name;
+ name.name = (char *)sfep->name;
name.len = sfep->namelen;
blp[2 + i].hashval = cpu_to_be32(xfs_dir2_hashname(mp, &name));
blp[2 + i].address =
addr = xfs_dir2_db_off_to_dataptr(geo, geo->datablk,
(xfs_dir2_data_aoff_t)
((char *)dep - (char *)hdr));
- name.name = dep->name;
+ name.name = (char *)dep->name;
name.len = dep->namelen;
hash = xfs_dir2_hashname(mp, &name);
for (i = 0; i < be32_to_cpu(btp->count); i++) {
xfs_dahash_t
xfs_parent_hashval(
struct xfs_mount *mp,
- const uint8_t *name,
+ const char *name,
int namelen,
xfs_ino_t parent_ino)
{
xfs_dahash_t
xfs_parent_hashattr(
struct xfs_mount *mp,
- const uint8_t *name,
+ const char *name,
int namelen,
const void *value,
int valuelen)
xfs_parent_from_attr(
struct xfs_mount *mp,
unsigned int attr_flags,
- const unsigned char *name,
+ const char *name,
unsigned int namelen,
const void *value,
unsigned int valuelen,
bool xfs_parent_valuecheck(struct xfs_mount *mp, const void *value,
size_t valuelen);
-xfs_dahash_t xfs_parent_hashval(struct xfs_mount *mp, const uint8_t *name,
+xfs_dahash_t xfs_parent_hashval(struct xfs_mount *mp, const char *name,
int namelen, xfs_ino_t parent_ino);
-xfs_dahash_t xfs_parent_hashattr(struct xfs_mount *mp, const uint8_t *name,
+xfs_dahash_t xfs_parent_hashattr(struct xfs_mount *mp, const char *name,
int namelen, const void *value, int valuelen);
/* Initializes a xfs_parent_rec to be stored as an attribute name. */
struct xfs_inode *child);
int xfs_parent_from_attr(struct xfs_mount *mp, unsigned int attr_flags,
- const unsigned char *name, unsigned int namelen,
+ const char *name, unsigned int namelen,
const void *value, unsigned int valuelen,
xfs_ino_t *parent_ino, uint32_t *parent_gen);
{ XFS_LOOKUP_GEi, "ge" }
struct xfs_name {
- const unsigned char *name;
+ const char *name;
int len;
int type;
};