summaryrefslogtreecommitdiffstats
path: root/heal/src
diff options
context:
space:
mode:
authorPranith Kumar K <pkarampu@redhat.com>2015-02-05 21:23:37 +0530
committerVijay Bellur <vbellur@redhat.com>2015-02-06 14:04:32 -0800
commit2efb36047aa11838b2cde93a3e95741e7ba40bae (patch)
treeb5a06756058974d9d390b1781f8c920cf28859d4 /heal/src
parentf75bb4a9ca14b50c7f828ee3fe4ba73dd78f094c (diff)
syncop: Provide syncop_ftw and syncop_dir_scan utils
ftw provides file tree walk. dir_scan does just a readdir not readdirp. Also changed Afr's self-heal-daemon's crawling functions to use this. These utils will be used by ec in future to do proactive/full healing. Change-Id: I05715ddb789592c1b79a71e98f1e8cc29aac5c26 BUG: 1177601 Signed-off-by: Pranith Kumar K <pkarampu@redhat.com> Reviewed-on: http://review.gluster.org/9485 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Ravishankar N <ravishankar@redhat.com> Reviewed-by: Krutika Dhananjay <kdhananj@redhat.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Diffstat (limited to 'heal/src')
-rw-r--r--heal/src/glfs-heal.c36
1 files changed, 3 insertions, 33 deletions
diff --git a/heal/src/glfs-heal.c b/heal/src/glfs-heal.c
index a6208fa052f..3ea3f430e3b 100644
--- a/heal/src/glfs-heal.c
+++ b/heal/src/glfs-heal.c
@@ -92,37 +92,6 @@ out:
return ret;
}
-int
-glfsh_get_index_dir_fd (xlator_t *xl, loc_t *loc, fd_t **fd)
-{
- int ret = -1;
-
- *fd = fd_create (loc->inode, GF_CLIENT_PID_GLFS_HEAL);
- if (!*fd) {
- printf ("fd_create failed: %s", strerror(errno));
- goto out;
- }
- ret = syncop_opendir (xl, loc, *fd);
- if (ret) {
- fd_unref(*fd);
-#ifdef GF_LINUX_HOST_OS /* See comment in afr_shd_index_opendir() */
- *fd = fd_anonymous (loc->inode);
- if (!*fd) {
- printf ("fd_anonymous failed: %s",
- strerror(errno));
- goto out;
- }
- ret = 0;
-#else
- printf ("opendir failed: %s", strerror(errno));
- goto out;
-#endif
- }
-
-out:
- return ret;
-}
-
static xlator_t*
_get_afr_ancestor (xlator_t *xl)
{
@@ -478,7 +447,7 @@ glfsh_print_pending_heals (glfs_t *fs, xlator_t *top_subvol, loc_t *rootloc,
goto out;
}
- ret = glfsh_get_index_dir_fd (xl, &dirloc, &fd);
+ ret = syncop_dirfd (xl, &dirloc, &fd, GF_CLIENT_PID_GLFS_HEAL);
if (ret)
goto out;
@@ -691,7 +660,8 @@ glfsh_heal_from_brick (glfs_t *fs, xlator_t *top_subvol, loc_t *rootloc,
else {
ret = glfsh_get_index_dir_loc (rootloc, client, &dirloc,
&op_errno);
- ret = glfsh_get_index_dir_fd (client, &dirloc, &fd);
+ ret = syncop_dirfd (client, &dirloc, &fd,
+ GF_CLIENT_PID_GLFS_HEAL);
if (ret)
goto out;
ret = glfsh_crawl_directory (fs, top_subvol, rootloc, client,