libglusterfsclient: Add VMP-based getxattr

Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
This commit is contained in:
Shehjar Tikoo 2009-04-20 12:29:57 -07:00 committed by Anand V. Avati
parent 6cd6561529
commit bb2ca0ec0d
2 changed files with 35 additions and 8 deletions

View File

@ -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,

View File

@ -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,