libglusterfsclient: Add VMP-based get
Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
This commit is contained in:
parent
86a1c646ee
commit
6cd6561529
@ -1187,11 +1187,8 @@ out:
|
||||
}
|
||||
|
||||
int
|
||||
glusterfs_get (glusterfs_handle_t handle,
|
||||
const char *path,
|
||||
void *buf,
|
||||
size_t size,
|
||||
struct stat *stbuf)
|
||||
glusterfs_glh_get (glusterfs_handle_t handle, const char *path, void *buf,
|
||||
size_t size, struct stat *stbuf)
|
||||
{
|
||||
int32_t op_ret = -1;
|
||||
loc_t loc = {0, };
|
||||
@ -1268,6 +1265,30 @@ out:
|
||||
return op_ret;
|
||||
}
|
||||
|
||||
int
|
||||
glusterfs_get (const char *path, void *buf, size_t size, struct stat *stbuf)
|
||||
{
|
||||
struct vmp_entry *entry = NULL;
|
||||
int op_ret = -1;
|
||||
char *vpath = NULL;
|
||||
|
||||
GF_VALIDATE_OR_GOTO (LIBGF_XL_NAME, path, out);
|
||||
GF_VALIDATE_OR_GOTO (LIBGF_XL_NAME, buf, out);
|
||||
GF_VALIDATE_OR_GOTO (LIBGF_XL_NAME, stbuf, 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_get (entry->handle, vpath, buf, size, stbuf);
|
||||
|
||||
out:
|
||||
return op_ret;
|
||||
}
|
||||
|
||||
int
|
||||
libgf_client_lookup_async_cbk (call_frame_t *frame,
|
||||
void *cookie,
|
||||
|
@ -91,9 +91,12 @@ glusterfs_fini (glusterfs_handle_t handle);
|
||||
*/
|
||||
|
||||
int
|
||||
glusterfs_get (glusterfs_handle_t handle, const char *path, void *buf,
|
||||
glusterfs_glh_get (glusterfs_handle_t handle, const char *path, void *buf,
|
||||
size_t size, struct stat *stbuf);
|
||||
|
||||
int
|
||||
glusterfs_get (const char *path, void *buf, size_t size, struct stat *stbuf);
|
||||
|
||||
int
|
||||
glusterfs_get_async (glusterfs_handle_t handle, const char *path, size_t size,
|
||||
glusterfs_get_cbk_t cbk, void *cbk_data);
|
||||
|
Loading…
x
Reference in New Issue
Block a user