summaryrefslogtreecommitdiffstats
path: root/libglusterfsclient
diff options
context:
space:
mode:
authorShehjar Tikoo <shehjart@zresearch.com>2009-04-20 12:35:17 -0700
committerAnand V. Avati <avati@amp.gluster.com>2009-04-21 12:50:02 +0530
commitbcc9a67fc22147f54a27a81ee35f4c081a0e6b73 (patch)
tree05ce2b98ab25ceae8cd0fc48e0d591cbd066e044 /libglusterfsclient
parenta7205e78bfb962d9e5ff11db2a0b394e6db03256 (diff)
libglusterfsclient: Add VMP-based mknod
Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
Diffstat (limited to 'libglusterfsclient')
-rwxr-xr-xlibglusterfsclient/src/libglusterfsclient.c25
-rwxr-xr-xlibglusterfsclient/src/libglusterfsclient.h7
2 files changed, 28 insertions, 4 deletions
diff --git a/libglusterfsclient/src/libglusterfsclient.c b/libglusterfsclient/src/libglusterfsclient.c
index 2ab95d1f5..393367e45 100755
--- a/libglusterfsclient/src/libglusterfsclient.c
+++ b/libglusterfsclient/src/libglusterfsclient.c
@@ -5006,8 +5006,8 @@ out:
}
int
-glusterfs_mknod(glusterfs_handle_t handle, const char *path, mode_t mode,
- dev_t dev)
+glusterfs_glh_mknod(glusterfs_handle_t handle, const char *path, mode_t mode,
+ dev_t dev)
{
libglusterfs_client_ctx_t *ctx = handle;
loc_t loc = {0, };
@@ -5054,6 +5054,27 @@ out:
}
int
+glusterfs_mknod(const char *pathname, mode_t mode, dev_t dev)
+{
+ struct vmp_entry *entry = NULL;
+ char *vpath = NULL;
+ int op_ret = -1;
+
+ GF_VALIDATE_OR_GOTO (LIBGF_XL_NAME, pathname, out);
+
+ entry = libgf_vmp_search_entry ((char *)pathname);
+ if (!entry) {
+ errno = ENODEV;
+ goto out;
+ }
+
+ vpath = libgf_vmp_virtual_path (entry, pathname);
+ op_ret = glusterfs_glh_mknod (entry->handle, vpath, mode, dev);
+out:
+ return op_ret;
+}
+
+int
glusterfs_mkfifo (glusterfs_handle_t handle, const char *path, mode_t mode)
{
diff --git a/libglusterfsclient/src/libglusterfsclient.h b/libglusterfsclient/src/libglusterfsclient.h
index b4454a370..90cdc83e2 100755
--- a/libglusterfsclient/src/libglusterfsclient.h
+++ b/libglusterfsclient/src/libglusterfsclient.h
@@ -252,8 +252,11 @@ glusterfs_getdents (glusterfs_dir_t fd, struct dirent *dirp,
unsigned int count);
int
-glusterfs_mknod(glusterfs_handle_t handle, const char *pathname, mode_t mode,
- dev_t dev);
+glusterfs_glh_mknod(glusterfs_handle_t handle, const char *pathname,
+ mode_t mode, dev_t dev);
+
+int
+glusterfs_mknod(const char *pathname, mode_t mode, dev_t dev);
char *
glusterfs_realpath (glusterfs_handle_t handle, const char *path,