summaryrefslogtreecommitdiffstats
path: root/libglusterfs
diff options
context:
space:
mode:
authorKrutika Dhananjay <kdhananj@redhat.com>2016-06-27 15:21:26 +0530
committerPranith Kumar Karampuri <pkarampu@redhat.com>2016-07-11 23:13:53 -0700
commitceac3b4172e7c689941ec3e734eca6c537e69368 (patch)
treecc6d9fe4bb62819eb19a4f22281578b7d2decabd /libglusterfs
parentf938b3a26ffab9482d5f910ee76d2bb2b370517f (diff)
afr, index: Clean up stale directory and file indices in granular entry sh
Specifically when a directory tree is removed (rm -rf) while a brick is down, both the directory index and the name indices of the files and subdirs under it will remain. Self-heal will need to pick up these and remove them. Towards this, afr sh will now also crawl indices/entry-changes and call an rmdir on the dir if the directory index is stale. On the brick side, rmdir fop has been implemented for index xl, which would delete the directory index and its contents if present in a synctask. Change-Id: I8b527331c2547e6c141db6c57c14055ad1198a7e BUG: 1331323 Signed-off-by: Krutika Dhananjay <kdhananj@redhat.com> Reviewed-on: http://review.gluster.org/14832 Reviewed-by: Ravishankar N <ravishankar@redhat.com> Smoke: Gluster Build System <jenkins@build.gluster.org> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com> CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
Diffstat (limited to 'libglusterfs')
-rw-r--r--libglusterfs/src/common-utils.c15
-rw-r--r--libglusterfs/src/common-utils.h3
-rw-r--r--libglusterfs/src/glusterfs.h2
3 files changed, 20 insertions, 0 deletions
diff --git a/libglusterfs/src/common-utils.c b/libglusterfs/src/common-utils.c
index 7b19208343f..b9062c159c7 100644
--- a/libglusterfs/src/common-utils.c
+++ b/libglusterfs/src/common-utils.c
@@ -4467,6 +4467,21 @@ fop_enum_to_string (glusterfs_fop_t fop)
return "UNKNOWNFOP";
}
+const char *
+gf_inode_type_to_str (ia_type_t type)
+{
+ static const char *const str_ia_type[] = {
+ "UNKNOWN",
+ "REGULAR FILE",
+ "DIRECTORY",
+ "LINK",
+ "BLOCK DEVICE",
+ "CHARACTER DEVICE",
+ "PIPE",
+ "SOCKET"};
+ return str_ia_type[type];
+}
+
gf_boolean_t
gf_is_zero_filled_stat (struct iatt *buf)
{
diff --git a/libglusterfs/src/common-utils.h b/libglusterfs/src/common-utils.h
index a83678fe322..8d88935ca09 100644
--- a/libglusterfs/src/common-utils.h
+++ b/libglusterfs/src/common-utils.h
@@ -37,6 +37,7 @@ void trap (void);
#include "locking.h"
#include "mem-pool.h"
#include "compat-uuid.h"
+#include "iatt.h"
#include "uuid.h"
#include "libglusterfs-messages.h"
@@ -838,4 +839,6 @@ gf_zero_fill_stat (struct iatt *buf);
gf_boolean_t
is_virtual_xattr (const char *k);
+const char *
+gf_inode_type_to_str (ia_type_t type);
#endif /* _COMMON_UTILS_H */
diff --git a/libglusterfs/src/glusterfs.h b/libglusterfs/src/glusterfs.h
index 1accb62d9e9..3f7bb5ea2e4 100644
--- a/libglusterfs/src/glusterfs.h
+++ b/libglusterfs/src/glusterfs.h
@@ -178,6 +178,8 @@
#define GF_XATTROP_DIRTY_COUNT "glusterfs.xattrop_dirty_count"
#define GF_XATTROP_ENTRY_IN_KEY "glusterfs.xattrop-entry-create"
#define GF_XATTROP_ENTRY_OUT_KEY "glusterfs.xattrop-entry-delete"
+#define GF_INDEX_IA_TYPE_GET_REQ "glusterfs.index-ia-type-get-req"
+#define GF_INDEX_IA_TYPE_GET_RSP "glusterfs.index-ia-type-get-rsp"
#define GF_HEAL_INFO "glusterfs.heal-info"
#define GF_AFR_HEAL_SBRAIN "glusterfs.heal-sbrain"