libglusterfsclient: Add VMP-based getxattr
Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
This commit is contained in:
parent
6cd6561529
commit
bb2ca0ec0d
@ -1554,12 +1554,9 @@ libgf_client_getxattr (libglusterfs_client_ctx_t *ctx,
|
||||
return op_ret;
|
||||
}
|
||||
|
||||
ssize_t
|
||||
glusterfs_getxattr (glusterfs_handle_t handle,
|
||||
const char *path,
|
||||
const char *name,
|
||||
void *value,
|
||||
size_t size)
|
||||
ssize_t
|
||||
glusterfs_glh_getxattr (glusterfs_handle_t handle, const char *path,
|
||||
const char *name, void *value, size_t size)
|
||||
{
|
||||
int32_t op_ret = -1;
|
||||
loc_t loc = {0, };
|
||||
@ -1642,6 +1639,32 @@ out:
|
||||
return op_ret;
|
||||
}
|
||||
|
||||
ssize_t
|
||||
glusterfs_getxattr (const char *path, const char *name, void *value,
|
||||
size_t size)
|
||||
{
|
||||
int op_ret = -1;
|
||||
struct vmp_entry *entry = NULL;
|
||||
char *vpath = NULL;
|
||||
|
||||
GF_VALIDATE_OR_GOTO (LIBGF_XL_NAME, path, out);
|
||||
GF_VALIDATE_OR_GOTO (LIBGF_XL_NAME, name, out);
|
||||
GF_VALIDATE_OR_GOTO (LIBGF_XL_NAME, value, out);
|
||||
|
||||
entry = libgf_vmp_search_entry ((char *)path);
|
||||
if (!entry) {
|
||||
errno = ENODEV;
|
||||
goto out;
|
||||
}
|
||||
|
||||
vpath = libgf_vmp_virtual_path (entry, path);
|
||||
op_ret = glusterfs_glh_getxattr (entry->handle, vpath, name, value,
|
||||
size);
|
||||
|
||||
out:
|
||||
return op_ret;
|
||||
}
|
||||
|
||||
static int32_t
|
||||
libgf_client_open_cbk (call_frame_t *frame,
|
||||
void *cookie,
|
||||
|
@ -139,8 +139,12 @@ glusterfs_fsetxattr (glusterfs_file_t fd, const char *name, const void *value,
|
||||
size_t size, int flags);
|
||||
|
||||
ssize_t
|
||||
glusterfs_getxattr (glusterfs_handle_t handle, const char *path,
|
||||
const char *name, void *value, size_t size);
|
||||
glusterfs_glh_getxattr (glusterfs_handle_t handle, const char *path,
|
||||
const char *name, void *value, size_t size);
|
||||
|
||||
ssize_t
|
||||
glusterfs_getxattr (const char *path, const char *name, void *value,
|
||||
size_t size);
|
||||
|
||||
ssize_t
|
||||
glusterfs_lgetxattr (glusterfs_handle_t handle, const char *path,
|
||||
|
Loading…
x
Reference in New Issue
Block a user