From 6f91c9dc86be9c10467ccb5bc3edde2c5d767b9f Mon Sep 17 00:00:00 2001 From: Shehjar Tikoo Date: Mon, 20 Apr 2009 12:35:32 -0700 Subject: libglusterfsclient: Add VMP-based mkfifo Signed-off-by: Anand V. Avati --- libglusterfsclient/src/libglusterfsclient.c | 23 ++++++++++++++++++++++- libglusterfsclient/src/libglusterfsclient.h | 7 +++++++ 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/libglusterfsclient/src/libglusterfsclient.c b/libglusterfsclient/src/libglusterfsclient.c index 393367e4595..b907ea477e6 100755 --- a/libglusterfsclient/src/libglusterfsclient.c +++ b/libglusterfsclient/src/libglusterfsclient.c @@ -5075,7 +5075,7 @@ out: } int -glusterfs_mkfifo (glusterfs_handle_t handle, const char *path, mode_t mode) +glusterfs_glh_mkfifo (glusterfs_handle_t handle, const char *path, mode_t mode) { libglusterfs_client_ctx_t *ctx = handle; @@ -5123,6 +5123,27 @@ out: return op_ret; } +int +glusterfs_mkfifo (const char *path, mode_t mode) +{ + struct vmp_entry *entry = NULL; + char *vpath = NULL; + int op_ret = -1; + + GF_VALIDATE_OR_GOTO (LIBGF_XL_NAME, path, 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_mkfifo (entry->handle, vpath, mode); +out: + return op_ret; +} + int32_t libgf_client_unlink_cbk (call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, int32_t op_errno) diff --git a/libglusterfsclient/src/libglusterfsclient.h b/libglusterfsclient/src/libglusterfsclient.h index 90cdc83e206..b9afe4824fc 100755 --- a/libglusterfsclient/src/libglusterfsclient.h +++ b/libglusterfsclient/src/libglusterfsclient.h @@ -318,6 +318,13 @@ glusterfs_glh_utime (glusterfs_handle_t handle, const char *path, int glusterfs_utime (const char *path, const struct utimbuf *buf); + +int +glusterfs_glh_mkfifo (glusterfs_handle_t handle, const char *path, + mode_t mode); + +int +glusterfs_mkfifo (const char *path, mode_t mode); /* FIXME: review the need for these apis */ /* added for log related initialization in booster fork implementation */ void -- cgit