summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--xlators/features/snapview-client/src/snapview-client.c338
-rw-r--r--xlators/features/snapview-client/src/snapview-client.h24
2 files changed, 159 insertions, 203 deletions
diff --git a/xlators/features/snapview-client/src/snapview-client.c b/xlators/features/snapview-client/src/snapview-client.c
index 719fa532b5b..218d178f65f 100644
--- a/xlators/features/snapview-client/src/snapview-client.c
+++ b/xlators/features/snapview-client/src/snapview-client.c
@@ -13,7 +13,7 @@
#include "byte-order.h"
-void
+static void
svc_local_free (svc_local_t *local)
{
if (local) {
@@ -26,7 +26,7 @@ svc_local_free (svc_local_t *local)
}
}
-xlator_t *
+static xlator_t *
svc_get_subvolume (xlator_t *this, int inode_type)
{
xlator_t *subvolume = NULL;
@@ -42,7 +42,7 @@ out:
return subvolume;
}
-int32_t
+static int32_t
__svc_inode_ctx_set (xlator_t *this, inode_t *inode, int inode_type)
{
uint64_t value = 0;
@@ -59,7 +59,7 @@ out:
return ret;
}
-int
+static int
__svc_inode_ctx_get (xlator_t *this, inode_t *inode, int *inode_type)
{
uint64_t value = 0;
@@ -78,7 +78,7 @@ out:
return ret;
}
-int
+static int
svc_inode_ctx_get (xlator_t *this, inode_t *inode, int *inode_type)
{
int ret = -1;
@@ -96,7 +96,7 @@ out:
return ret;
}
-int32_t
+static int32_t
svc_inode_ctx_set (xlator_t *this, inode_t *inode, int inode_type)
{
int32_t ret = -1;
@@ -114,7 +114,7 @@ out:
return ret;
}
-svc_fd_t *
+static svc_fd_t *
svc_fd_new (void)
{
svc_fd_t *svc_fd = NULL;
@@ -124,7 +124,7 @@ svc_fd_new (void)
return svc_fd;
}
-svc_fd_t *
+static svc_fd_t *
__svc_fd_ctx_get (xlator_t *this, fd_t *fd)
{
svc_fd_t *svc_fd = NULL;
@@ -144,7 +144,7 @@ out:
return svc_fd;
}
-svc_fd_t *
+static svc_fd_t *
svc_fd_ctx_get (xlator_t *this, fd_t *fd)
{
svc_fd_t *svc_fd = NULL;
@@ -162,7 +162,7 @@ out:
return svc_fd;
}
-int
+static int
__svc_fd_ctx_set (xlator_t *this, fd_t *fd, svc_fd_t *svc_fd)
{
uint64_t value = 0;
@@ -180,26 +180,7 @@ out:
return ret;
}
-int32_t
-svc_fd_ctx_set (xlator_t *this, fd_t *fd, svc_fd_t *svc_fd)
-{
- int32_t ret = -1;
-
- GF_VALIDATE_OR_GOTO ("snapview-client", this, out);
- GF_VALIDATE_OR_GOTO (this->name, fd, out);
- GF_VALIDATE_OR_GOTO (this->name, svc_fd, out);
-
- LOCK (&fd->lock);
- {
- ret = __svc_fd_ctx_set (this, fd, svc_fd);
- }
- UNLOCK (&fd->lock);
-
-out:
- return ret;
-}
-
-svc_fd_t *
+static svc_fd_t *
__svc_fd_ctx_get_or_new (xlator_t *this, fd_t *fd)
{
svc_fd_t *svc_fd = NULL;
@@ -239,7 +220,7 @@ out:
return svc_fd;
}
-svc_fd_t *
+static svc_fd_t *
svc_fd_ctx_get_or_new (xlator_t *this, fd_t *fd)
{
svc_fd_t *svc_fd = NULL;
@@ -259,9 +240,9 @@ out:
static int32_t
-svc_lookup_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
- int32_t op_ret, int32_t op_errno, inode_t *inode,
- struct iatt *buf, dict_t *xdata, struct iatt *postparent)
+gf_svc_lookup_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
+ int32_t op_ret, int32_t op_errno, inode_t *inode,
+ struct iatt *buf, dict_t *xdata, struct iatt *postparent)
{
svc_local_t *local = NULL;
xlator_t *subvolume = NULL;
@@ -318,8 +299,8 @@ svc_lookup_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
subvolume = SECOND_CHILD (this);
local->subvolume = subvolume;
- STACK_WIND (frame, svc_lookup_cbk, subvolume,
- subvolume->fops->lookup,
+ STACK_WIND (frame, gf_svc_lookup_cbk,
+ subvolume, subvolume->fops->lookup,
&local->loc, xdata);
do_unwind = _gf_false;
}
@@ -348,8 +329,7 @@ out:
}
static int32_t
-svc_lookup (call_frame_t *frame, xlator_t *this, loc_t *loc,
- dict_t *xdata)
+gf_svc_lookup (call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *xdata)
{
int32_t ret = -1;
svc_local_t *local = NULL;
@@ -453,8 +433,8 @@ svc_lookup (call_frame_t *frame, xlator_t *this, loc_t *loc,
out:
if (wind)
- STACK_WIND (frame, svc_lookup_cbk,
- subvolume, subvolume->fops->lookup, loc, xdata);
+ STACK_WIND (frame, gf_svc_lookup_cbk, subvolume,
+ subvolume->fops->lookup, loc, xdata);
else
SVC_STACK_UNWIND (lookup, frame, op_ret, op_errno, NULL,
NULL, NULL, NULL);
@@ -468,8 +448,7 @@ out:
}
static int32_t
-svc_statfs (call_frame_t *frame, xlator_t *this, loc_t *loc,
- dict_t *xdata)
+gf_svc_statfs (call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *xdata)
{
xlator_t *subvolume = NULL;
int32_t ret = -1;
@@ -526,10 +505,10 @@ out:
return 0;
}
-int32_t
-svc_stat_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
- int32_t op_ret, int32_t op_errno, struct iatt *buf,
- dict_t *xdata)
+static int32_t
+gf_svc_stat_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
+ int32_t op_ret, int32_t op_errno, struct iatt *buf,
+ dict_t *xdata)
{
/* Consider a testcase:
* #mount -t nfs host1:/vol1 /mnt
@@ -555,8 +534,8 @@ svc_stat_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
be sent and in the call back update the contexts.
*/
static int32_t
-svc_stat (call_frame_t *frame, xlator_t *this, loc_t *loc,
- dict_t *xdata)
+gf_svc_stat (call_frame_t *frame, xlator_t *this, loc_t *loc,
+ dict_t *xdata)
{
int32_t ret = -1;
int inode_type = -1;
@@ -573,7 +552,7 @@ svc_stat (call_frame_t *frame, xlator_t *this, loc_t *loc,
SVC_GET_SUBVOL_FROM_CTX (this, op_ret, op_errno, inode_type, ret,
loc->inode, subvolume, out);
- STACK_WIND (frame, svc_stat_cbk, subvolume,
+ STACK_WIND (frame, gf_svc_stat_cbk, subvolume,
subvolume->fops->stat, loc, xdata);
wind = _gf_true;
@@ -586,7 +565,7 @@ out:
}
static int32_t
-svc_fstat (call_frame_t *frame, xlator_t *this, fd_t *fd, dict_t *xdata)
+gf_svc_fstat (call_frame_t *frame, xlator_t *this, fd_t *fd, dict_t *xdata)
{
int32_t ret = -1;
int inode_type = -1;
@@ -615,8 +594,8 @@ out:
}
static int32_t
-svc_opendir_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
- int32_t op_ret, int32_t op_errno, fd_t *fd, dict_t *xdata)
+gf_svc_opendir_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
+ int32_t op_ret, int32_t op_errno, fd_t *fd, dict_t *xdata)
{
svc_fd_t *svc_fd = NULL;
svc_local_t *local = NULL;
@@ -682,8 +661,8 @@ out:
svc has to do things that open-behind is doing.
*/
static int32_t
-svc_opendir (call_frame_t *frame, xlator_t *this, loc_t *loc, fd_t *fd,
- dict_t *xdata)
+gf_svc_opendir (call_frame_t *frame, xlator_t *this, loc_t *loc, fd_t *fd,
+ dict_t *xdata)
{
int32_t ret = -1;
int inode_type = -1;
@@ -715,8 +694,8 @@ svc_opendir (call_frame_t *frame, xlator_t *this, loc_t *loc, fd_t *fd,
local->subvolume = subvolume;
frame->local = local;
- STACK_WIND (frame, svc_opendir_cbk, subvolume, subvolume->fops->opendir,
- loc, fd, xdata);
+ STACK_WIND (frame, gf_svc_opendir_cbk, subvolume,
+ subvolume->fops->opendir, loc, fd, xdata);
wind = _gf_true;
@@ -728,8 +707,8 @@ out:
}
static int32_t
-svc_setattr (call_frame_t *frame, xlator_t *this, loc_t *loc,
- struct iatt *stbuf, int32_t valid, dict_t *xdata)
+gf_svc_setattr (call_frame_t *frame, xlator_t *this, loc_t *loc,
+ struct iatt *stbuf, int32_t valid, dict_t *xdata)
{
int32_t ret = -1;
int inode_type = -1;
@@ -771,10 +750,11 @@ out:
return 0;
}
-/* XXX: This function is currently not used. Mark it 'static' when required */
-int32_t
-svc_fsetattr (call_frame_t *frame, xlator_t *this, fd_t *fd, struct iatt *stbuf,
- int32_t valid, dict_t *xdata)
+/* XXX: This function is currently not used. Remove "#if 0" when required */
+#if 0
+static int32_t
+gf_svc_fsetattr (call_frame_t *frame, xlator_t *this, fd_t *fd,
+ struct iatt *stbuf, int32_t valid, dict_t *xdata)
{
int32_t ret = -1;
int inode_type = -1;
@@ -814,10 +794,11 @@ out:
NULL, NULL, NULL);
return 0;
}
+#endif /* gf_svc_fsetattr() is not used */
static int32_t
-svc_getxattr (call_frame_t *frame, xlator_t *this, loc_t *loc, const char *name,
- dict_t *xdata)
+gf_svc_getxattr (call_frame_t *frame, xlator_t *this, loc_t *loc,
+ const char *name, dict_t *xdata)
{
int32_t ret = -1;
int inode_type = -1;
@@ -895,10 +876,11 @@ out:
return 0;
}
-/* XXX: This function is currently not used. Mark it 'static' when required */
-int32_t
-svc_fgetxattr (call_frame_t *frame, xlator_t *this, fd_t *fd, const char *name,
- dict_t *xdata)
+/* XXX: This function is currently not used. Mark it '#if 0' when required */
+#if 0
+static int32_t
+gf_svc_fgetxattr (call_frame_t *frame, xlator_t *this, fd_t *fd,
+ const char *name, dict_t *xdata)
{
int32_t ret = -1;
int inode_type = -1;
@@ -926,10 +908,11 @@ out:
NULL, NULL);
return 0;
}
+#endif /* gf_svc_fgetxattr() is not used */
static int32_t
-svc_setxattr (call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *dict,
- int32_t flags, dict_t *xdata)
+gf_svc_setxattr (call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *dict,
+ int32_t flags, dict_t *xdata)
{
int32_t ret = -1;
int inode_type = -1;
@@ -973,8 +956,8 @@ out:
}
static int32_t
-svc_fsetxattr (call_frame_t *frame, xlator_t *this, fd_t *fd, dict_t *dict,
- int32_t flags, dict_t *xdata)
+gf_svc_fsetxattr (call_frame_t *frame, xlator_t *this, fd_t *fd, dict_t *dict,
+ int32_t flags, dict_t *xdata)
{
int32_t ret = -1;
int inode_type = -1;
@@ -1017,8 +1000,8 @@ out:
}
static int32_t
-svc_rmdir (call_frame_t *frame, xlator_t *this, loc_t *loc, int flags,
- dict_t *xdata)
+gf_svc_rmdir (call_frame_t *frame, xlator_t *this, loc_t *loc, int flags,
+ dict_t *xdata)
{
int inode_type = -1;
int ret = -1;
@@ -1061,10 +1044,10 @@ out:
}
static int32_t
-svc_mkdir_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
- int32_t op_ret, int32_t op_errno, inode_t *inode,
- struct iatt *buf, struct iatt *preparent,
- struct iatt *postparent, dict_t *xdata)
+gf_svc_mkdir_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
+ int32_t op_ret, int32_t op_errno, inode_t *inode,
+ struct iatt *buf, struct iatt *preparent,
+ struct iatt *postparent, dict_t *xdata)
{
int inode_type = -1;
int ret = -1;
@@ -1086,8 +1069,8 @@ out:
}
static int32_t
-svc_mkdir (call_frame_t *frame, xlator_t *this, loc_t *loc, mode_t mode,
- mode_t umask, dict_t *xdata)
+gf_svc_mkdir (call_frame_t *frame, xlator_t *this, loc_t *loc, mode_t mode,
+ mode_t umask, dict_t *xdata)
{
int parent_type = -1;
int ret = -1;
@@ -1114,7 +1097,7 @@ svc_mkdir (call_frame_t *frame, xlator_t *this, loc_t *loc, mode_t mode,
}
if (strcmp (loc->name, priv->path) && parent_type == NORMAL_INODE) {
- STACK_WIND (frame, svc_mkdir_cbk, FIRST_CHILD (this),
+ STACK_WIND (frame, gf_svc_mkdir_cbk, FIRST_CHILD (this),
FIRST_CHILD (this)->fops->mkdir, loc, mode,
umask, xdata);
} else {
@@ -1133,10 +1116,10 @@ out:
}
static int32_t
-svc_mknod_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
- int32_t op_ret, int32_t op_errno, inode_t *inode,
- struct iatt *buf, struct iatt *preparent,
- struct iatt *postparent, dict_t *xdata)
+gf_svc_mknod_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
+ int32_t op_ret, int32_t op_errno, inode_t *inode,
+ struct iatt *buf, struct iatt *preparent,
+ struct iatt *postparent, dict_t *xdata)
{
int inode_type = -1;
int ret = -1;
@@ -1157,8 +1140,8 @@ out:
}
static int32_t
-svc_mknod (call_frame_t *frame, xlator_t *this, loc_t *loc, mode_t mode,
- dev_t rdev, mode_t umask, dict_t *xdata)
+gf_svc_mknod (call_frame_t *frame, xlator_t *this, loc_t *loc, mode_t mode,
+ dev_t rdev, mode_t umask, dict_t *xdata)
{
int parent_type = -1;
int ret = -1;
@@ -1185,7 +1168,7 @@ svc_mknod (call_frame_t *frame, xlator_t *this, loc_t *loc, mode_t mode,
}
if (strcmp (loc->name, priv->path) && parent_type == NORMAL_INODE) {
- STACK_WIND (frame, svc_mknod_cbk, FIRST_CHILD (this),
+ STACK_WIND (frame, gf_svc_mknod_cbk, FIRST_CHILD (this),
FIRST_CHILD (this)->fops->mknod, loc, mode,
rdev, umask, xdata);
} else {
@@ -1208,8 +1191,8 @@ out:
STACK_WIND the call to the first child of svc xlator.
*/
static int32_t
-svc_open (call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t flags,
- fd_t *fd, dict_t *xdata)
+gf_svc_open (call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t flags,
+ fd_t *fd, dict_t *xdata)
{
xlator_t *subvolume = NULL;
int inode_type = -1;
@@ -1253,10 +1236,10 @@ out:
}
static int32_t
-svc_create_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
- int32_t op_ret, int32_t op_errno, fd_t *fd, inode_t *inode,
- struct iatt *stbuf, struct iatt *preparent,
- struct iatt *postparent, dict_t *xdata)
+gf_svc_create_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
+ int32_t op_ret, int32_t op_errno, fd_t *fd, inode_t *inode,
+ struct iatt *stbuf, struct iatt *preparent,
+ struct iatt *postparent, dict_t *xdata)
{
int inode_type = -1;
int ret = -1;
@@ -1278,9 +1261,8 @@ out:
}
static int32_t
-svc_create (call_frame_t *frame, xlator_t *this,
- loc_t *loc, int32_t flags, mode_t mode,
- mode_t umask, fd_t *fd, dict_t *xdata)
+gf_svc_create (call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t flags,
+ mode_t mode, mode_t umask, fd_t *fd, dict_t *xdata)
{
int parent_type = -1;
int ret = -1;
@@ -1308,7 +1290,7 @@ svc_create (call_frame_t *frame, xlator_t *this,
}
if (strcmp (loc->name, priv->path) && parent_type == NORMAL_INODE) {
- STACK_WIND (frame, svc_create_cbk, FIRST_CHILD (this),
+ STACK_WIND (frame, gf_svc_create_cbk, FIRST_CHILD (this),
FIRST_CHILD (this)->fops->create, loc, flags,
mode, umask, fd, xdata);
} else {
@@ -1327,10 +1309,10 @@ out:
}
static int32_t
-svc_symlink_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
- int32_t op_ret, int32_t op_errno, inode_t *inode,
- struct iatt *buf, struct iatt *preparent,
- struct iatt *postparent, dict_t *xdata)
+gf_svc_symlink_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
+ int32_t op_ret, int32_t op_errno, inode_t *inode,
+ struct iatt *buf, struct iatt *preparent,
+ struct iatt *postparent, dict_t *xdata)
{
int inode_type = -1;
int ret = -1;
@@ -1352,8 +1334,8 @@ out:
}
static int32_t
-svc_symlink (call_frame_t *frame, xlator_t *this, const char *linkpath,
- loc_t *loc, mode_t umask, dict_t *xdata)
+gf_svc_symlink (call_frame_t *frame, xlator_t *this, const char *linkpath,
+ loc_t *loc, mode_t umask, dict_t *xdata)
{
int parent_type = -1;
int op_ret = -1;
@@ -1380,7 +1362,7 @@ svc_symlink (call_frame_t *frame, xlator_t *this, const char *linkpath,
}
if (strcmp (loc->name, priv->path) && parent_type == NORMAL_INODE) {
- STACK_WIND (frame, svc_symlink_cbk, FIRST_CHILD (this),
+ STACK_WIND (frame, gf_svc_symlink_cbk, FIRST_CHILD (this),
FIRST_CHILD (this)->fops->symlink, linkpath, loc,
umask, xdata);
} else {
@@ -1399,8 +1381,8 @@ out:
}
static int32_t
-svc_unlink (call_frame_t *frame, xlator_t *this, loc_t *loc, int flags,
- dict_t *xdata)
+gf_svc_unlink (call_frame_t *frame, xlator_t *this, loc_t *loc, int flags,
+ dict_t *xdata)
{
int inode_type = -1;
int op_ret = -1;
@@ -1442,8 +1424,8 @@ out:
}
static int32_t
-svc_readv (call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size,
- off_t offset, uint32_t flags, dict_t *xdata)
+gf_svc_readv (call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size,
+ off_t offset, uint32_t flags, dict_t *xdata)
{
int inode_type = -1;
xlator_t *subvolume = NULL;
@@ -1473,8 +1455,8 @@ out:
}
static int32_t
-svc_readlink (call_frame_t *frame, xlator_t *this,
- loc_t *loc, size_t size, dict_t *xdata)
+gf_svc_readlink (call_frame_t *frame, xlator_t *this, loc_t *loc, size_t size,
+ dict_t *xdata)
{
int inode_type = -1;
xlator_t *subvolume = NULL;
@@ -1504,8 +1486,8 @@ out:
}
static int32_t
-svc_access (call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t mask,
- dict_t *xdata)
+gf_svc_access (call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t mask,
+ dict_t *xdata)
{
int ret = -1;
int inode_type = -1;
@@ -1535,9 +1517,9 @@ out:
}
int32_t
-svc_readdir_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
- int32_t op_ret, int32_t op_errno, gf_dirent_t *entries,
- dict_t *xdata)
+gf_svc_readdir_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
+ int32_t op_ret, int32_t op_errno, gf_dirent_t *entries,
+ dict_t *xdata)
{
gf_dirent_t *entry = NULL;
gf_dirent_t *tmpentry = NULL;
@@ -1571,9 +1553,8 @@ out:
}
static int32_t
-svc_readdir (call_frame_t *frame, xlator_t *this, fd_t *fd,
- size_t size, off_t off,
- dict_t *xdata)
+gf_svc_readdir (call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size,
+ off_t off, dict_t *xdata)
{
int inode_type = -1;
xlator_t *subvolume = NULL;
@@ -1616,8 +1597,8 @@ svc_readdir (call_frame_t *frame, xlator_t *this, fd_t *fd,
local->subvolume = subvolume;
frame->local = local;
- STACK_WIND (frame, svc_readdir_cbk, subvolume, subvolume->fops->readdir,
- fd, size, off, xdata);
+ STACK_WIND (frame, gf_svc_readdir_cbk, subvolume,
+ subvolume->fops->readdir, fd, size, off, xdata);
wind = _gf_true;
@@ -1656,10 +1637,10 @@ out:
*/
static int32_t
-svc_readdirp_lookup_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
- int32_t op_ret, int32_t op_errno, inode_t *inode,
- struct iatt *buf, dict_t *xdata,
- struct iatt *postparent)
+gf_svc_readdirp_lookup_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
+ int32_t op_ret, int32_t op_errno, inode_t *inode,
+ struct iatt *buf, dict_t *xdata,
+ struct iatt *postparent)
{
gf_dirent_t entries;
gf_dirent_t *entry = NULL;
@@ -1727,10 +1708,11 @@ out:
return 0;
}
-gf_boolean_t
-svc_readdir_on_special_dir (call_frame_t *frame, void *cookie, xlator_t *this,
- int32_t op_ret, int32_t op_errno,
- gf_dirent_t *entries, dict_t *xdata)
+static gf_boolean_t
+gf_svc_readdir_on_special_dir (call_frame_t *frame, void *cookie,
+ xlator_t *this, int32_t op_ret,
+ int32_t op_errno, gf_dirent_t *entries,
+ dict_t *xdata)
{
svc_local_t *local = NULL;
svc_private_t *private = NULL;
@@ -1814,7 +1796,7 @@ svc_readdir_on_special_dir (call_frame_t *frame, void *cookie, xlator_t *this,
local->cookie = cookie;
local->xdata = dict_ref (xdata);
- STACK_WIND (frame, svc_readdirp_lookup_cbk,
+ STACK_WIND (frame, gf_svc_readdirp_lookup_cbk,
SECOND_CHILD (this),
SECOND_CHILD (this)->fops->lookup, loc, tmp_xdata);
unwind = _gf_false;
@@ -1829,9 +1811,9 @@ out:
}
static int32_t
-svc_readdirp_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
- int32_t op_ret, int32_t op_errno,
- gf_dirent_t *entries, dict_t *xdata)
+gf_svc_readdirp_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
+ int32_t op_ret, int32_t op_errno,
+ gf_dirent_t *entries, dict_t *xdata)
{
gf_dirent_t *entry = NULL;
gf_dirent_t *tmpentry = NULL;
@@ -1885,8 +1867,8 @@ svc_readdirp_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
svc_fd->last_offset = entry->d_off;
}
- unwind = svc_readdir_on_special_dir (frame, cookie, this, op_ret,
- op_errno, entries, xdata);
+ unwind = gf_svc_readdir_on_special_dir (frame, cookie, this, op_ret,
+ op_errno, entries, xdata);
out:
if (unwind)
@@ -1897,9 +1879,8 @@ out:
}
static int32_t
-svc_readdirp (call_frame_t *frame, xlator_t *this, fd_t *fd,
- size_t size, off_t off,
- dict_t *xdata)
+gf_svc_readdirp (call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size,
+ off_t off, dict_t *xdata)
{
int inode_type = -1;
xlator_t *subvolume = NULL;
@@ -1954,7 +1935,7 @@ svc_readdirp (call_frame_t *frame, xlator_t *this, fd_t *fd,
local->fd = fd_ref (fd);
frame->local = local;
- STACK_WIND (frame, svc_readdirp_cbk, subvolume,
+ STACK_WIND (frame, gf_svc_readdirp_cbk, subvolume,
subvolume->fops->readdirp, fd, size, off, xdata);
wind = _gf_true;
@@ -1973,8 +1954,8 @@ out:
are read-only.
*/
static int32_t
-svc_rename (call_frame_t *frame, xlator_t *this, loc_t *oldloc,
- loc_t *newloc, dict_t *xdata)
+gf_svc_rename (call_frame_t *frame, xlator_t *this, loc_t *oldloc,
+ loc_t *newloc, dict_t *xdata)
{
int src_inode_type = -1;
int dst_inode_type = -1;
@@ -2051,8 +2032,8 @@ out:
And so is vise versa.
*/
static int32_t
-svc_link (call_frame_t *frame, xlator_t *this, loc_t *oldloc, loc_t *newloc,
- dict_t *xdata)
+gf_svc_link (call_frame_t *frame, xlator_t *this, loc_t *oldloc, loc_t *newloc,
+ dict_t *xdata)
{
int src_inode_type = -1;
int dst_parent_type = -1;
@@ -2099,8 +2080,8 @@ out:
}
static int32_t
-svc_removexattr (call_frame_t *frame, xlator_t *this, loc_t *loc,
- const char *name, dict_t *xdata)
+gf_svc_removexattr (call_frame_t *frame, xlator_t *this, loc_t *loc,
+ const char *name, dict_t *xdata)
{
int ret = -1;
int inode_type = -1;
@@ -2144,8 +2125,8 @@ out:
}
static int
-svc_fsync (call_frame_t *frame, xlator_t *this, fd_t *fd, int datasync,
- dict_t *xdata)
+gf_svc_fsync (call_frame_t *frame, xlator_t *this, fd_t *fd, int datasync,
+ dict_t *xdata)
{
int inode_type = -1;
int ret = -1;
@@ -2188,8 +2169,7 @@ out:
}
static int32_t
-svc_flush (call_frame_t *frame, xlator_t *this,
- fd_t *fd, dict_t *xdata)
+gf_svc_flush (call_frame_t *frame, xlator_t *this, fd_t *fd, dict_t *xdata)
{
int32_t op_ret = -1;
int32_t op_errno = 0;
@@ -2218,7 +2198,7 @@ out:
}
static int32_t
-svc_releasedir (xlator_t *this, fd_t *fd)
+gf_svc_releasedir (xlator_t *this, fd_t *fd)
{
svc_fd_t *sfd = NULL;
uint64_t tmp_pfd = 0;
@@ -2241,7 +2221,7 @@ out:
}
static int32_t
-svc_forget (xlator_t *this, inode_t *inode)
+gf_svc_forget (xlator_t *this, inode_t *inode)
{
int ret = -1;
uint64_t value = 0;
@@ -2407,37 +2387,37 @@ notify (xlator_t *this, int event, void *data, ...)
}
struct xlator_fops fops = {
- .lookup = svc_lookup,
- .opendir = svc_opendir,
- .stat = svc_stat,
- .fstat = svc_fstat,
- .statfs = svc_statfs,
- .rmdir = svc_rmdir,
- .rename = svc_rename,
- .mkdir = svc_mkdir,
- .open = svc_open,
- .unlink = svc_unlink,
- .setattr = svc_setattr,
- .getxattr = svc_getxattr,
- .setxattr = svc_setxattr,
- .fsetxattr = svc_fsetxattr,
- .readv = svc_readv,
- .readdir = svc_readdir,
- .readdirp = svc_readdirp,
- .create = svc_create,
- .readlink = svc_readlink,
- .mknod = svc_mknod,
- .symlink = svc_symlink,
- .flush = svc_flush,
- .link = svc_link,
- .access = svc_access,
- .removexattr = svc_removexattr,
- .fsync = svc_fsync,
+ .lookup = gf_svc_lookup,
+ .opendir = gf_svc_opendir,
+ .stat = gf_svc_stat,
+ .fstat = gf_svc_fstat,
+ .statfs = gf_svc_statfs,
+ .rmdir = gf_svc_rmdir,
+ .rename = gf_svc_rename,
+ .mkdir = gf_svc_mkdir,
+ .open = gf_svc_open,
+ .unlink = gf_svc_unlink,
+ .setattr = gf_svc_setattr,
+ .getxattr = gf_svc_getxattr,
+ .setxattr = gf_svc_setxattr,
+ .fsetxattr = gf_svc_fsetxattr,
+ .readv = gf_svc_readv,
+ .readdir = gf_svc_readdir,
+ .readdirp = gf_svc_readdirp,
+ .create = gf_svc_create,
+ .readlink = gf_svc_readlink,
+ .mknod = gf_svc_mknod,
+ .symlink = gf_svc_symlink,
+ .flush = gf_svc_flush,
+ .link = gf_svc_link,
+ .access = gf_svc_access,
+ .removexattr = gf_svc_removexattr,
+ .fsync = gf_svc_fsync,
};
struct xlator_cbks cbks = {
- .forget = svc_forget,
- .releasedir = svc_releasedir,
+ .forget = gf_svc_forget,
+ .releasedir = gf_svc_releasedir,
};
struct volume_options options[] = {
diff --git a/xlators/features/snapview-client/src/snapview-client.h b/xlators/features/snapview-client/src/snapview-client.h
index fb0a15d8615..5b7a862cf3f 100644
--- a/xlators/features/snapview-client/src/snapview-client.h
+++ b/xlators/features/snapview-client/src/snapview-client.h
@@ -26,9 +26,6 @@ struct __svc_local {
};
typedef struct __svc_local svc_local_t;
-void
-svc_local_free (svc_local_t *local);
-
#define SVC_STACK_UNWIND(fop, frame, params ...) do { \
svc_local_t *__local = NULL; \
if (frame) { \
@@ -97,25 +94,4 @@ typedef enum {
VIRTUAL_INODE
} inode_type_t;
-void svc_local_free (svc_local_t *local);
-
-xlator_t *
-svc_get_subvolume (xlator_t *this, int inode_type);
-
-int
-__svc_inode_ctx_get (xlator_t *this, inode_t *inode, int *inode_type);
-
-int
-svc_inode_ctx_get (xlator_t *this, inode_t *inode, int *inode_type);
-
-int32_t
-svc_inode_ctx_set (xlator_t *this, inode_t *inode, int inode_type);
-
-void
-svc_local_free (svc_local_t *local);
-
-gf_boolean_t
-svc_readdir_on_special_dir (call_frame_t *frame, void *cookie, xlator_t *this,
- int32_t op_ret, int32_t op_errno,
- gf_dirent_t *entries, dict_t *xdata);
#endif /* __SNAP_VIEW_CLIENT_H__ */