A few tweaks to the extended attribute editing APIs:
* Use size_t, not unsigned int, in the new extended attribute editing
API.
* Don't expose the _expand() call since there should be no external
users.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
char *block_buf,
int adjust, __u32 *newcount,
ext2_ino_t inum);
char *block_buf,
int adjust, __u32 *newcount,
ext2_ino_t inum);
-errcode_t ext2fs_xattrs_expand(struct ext2_xattr_handle *h,
- unsigned int expandby);
errcode_t ext2fs_xattrs_write(struct ext2_xattr_handle *handle);
errcode_t ext2fs_xattrs_read(struct ext2_xattr_handle *handle);
errcode_t ext2fs_xattrs_iterate(struct ext2_xattr_handle *h,
int (*func)(char *name, char *value,
errcode_t ext2fs_xattrs_write(struct ext2_xattr_handle *handle);
errcode_t ext2fs_xattrs_read(struct ext2_xattr_handle *handle);
errcode_t ext2fs_xattrs_iterate(struct ext2_xattr_handle *h,
int (*func)(char *name, char *value,
+ size_t value_len, void *data),
void *data);
errcode_t ext2fs_xattr_get(struct ext2_xattr_handle *h, const char *key,
void *data);
errcode_t ext2fs_xattr_get(struct ext2_xattr_handle *h, const char *key,
- void **value, unsigned int *value_len);
+ void **value, size_t *value_len);
errcode_t ext2fs_xattr_set(struct ext2_xattr_handle *handle,
const char *key,
const void *value,
errcode_t ext2fs_xattr_set(struct ext2_xattr_handle *handle,
const char *key,
const void *value,
- unsigned int value_len);
errcode_t ext2fs_xattr_remove(struct ext2_xattr_handle *handle,
const char *key);
errcode_t ext2fs_xattrs_open(ext2_filsys fs, ext2_ino_t ino,
errcode_t ext2fs_xattr_remove(struct ext2_xattr_handle *handle,
const char *key);
errcode_t ext2fs_xattrs_open(ext2_filsys fs, ext2_ino_t ino,
struct ext2_xattr {
char *name;
void *value;
struct ext2_xattr {
char *name;
void *value;
- unsigned int value_len;
};
struct ext2_xattr_handle {
ext2_filsys fs;
struct ext2_xattr *attrs;
};
struct ext2_xattr_handle {
ext2_filsys fs;
struct ext2_xattr *attrs;
ext2_ino_t ino;
int dirty;
};
ext2_ino_t ino;
int dirty;
};
-errcode_t ext2fs_xattrs_expand(struct ext2_xattr_handle *h,
- unsigned int expandby)
+static errcode_t ext2fs_xattrs_expand(struct ext2_xattr_handle *h,
+ unsigned int expandby)
{
struct ext2_xattr *new_attrs;
errcode_t err;
{
struct ext2_xattr *new_attrs;
errcode_t err;
errcode_t ext2fs_xattrs_iterate(struct ext2_xattr_handle *h,
int (*func)(char *name, char *value,
errcode_t ext2fs_xattrs_iterate(struct ext2_xattr_handle *h,
int (*func)(char *name, char *value,
+ size_t value_len, void *data),
void *data)
{
struct ext2_xattr *x;
void *data)
{
struct ext2_xattr *x;
- ret = func(x->name, x->value, data);
+ ret = func(x->name, x->value, x->value_len, data);
if (ret & XATTR_CHANGED)
h->dirty = 1;
if (ret & XATTR_ABORT)
if (ret & XATTR_CHANGED)
h->dirty = 1;
if (ret & XATTR_ABORT)
}
errcode_t ext2fs_xattr_get(struct ext2_xattr_handle *h, const char *key,
}
errcode_t ext2fs_xattr_get(struct ext2_xattr_handle *h, const char *key,
- void **value, unsigned int *value_len)
+ void **value, size_t *value_len)
{
struct ext2_xattr *x;
void *val;
{
struct ext2_xattr *x;
void *val;
errcode_t ext2fs_xattr_set(struct ext2_xattr_handle *handle,
const char *key,
const void *value,
errcode_t ext2fs_xattr_set(struct ext2_xattr_handle *handle,
const char *key,
const void *value,
- unsigned int value_len)
{
struct ext2_xattr *x, *last_empty;
char *new_value;
{
struct ext2_xattr *x, *last_empty;
char *new_value;