summaryrefslogtreecommitdiffstats
path: root/libglusterfs/src/common-utils.c
diff options
context:
space:
mode:
authorKrutika Dhananjay <kdhananj@redhat.com>2016-06-27 15:21:26 +0530
committerJeff Darcy <jdarcy@redhat.com>2016-07-15 06:43:13 -0700
commit6c4908fe3f1a0b7900089b307b311940a2b7e1a1 (patch)
tree8ada88aa465488bfb8335fd2d5bff3ebd4395e4a /libglusterfs/src/common-utils.c
parent09678a68a323b3873c8f8fe24d42e14294e0034c (diff)
afr, index: Clean up stale directory and file indices in granular entry sh
Backport of: http://review.gluster.org/14832 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: I08f45201adca56737ec2be1aab5433aebaefefd0 BUG: 1355609 Signed-off-by: Krutika Dhananjay <kdhananj@redhat.com> Reviewed-on: http://review.gluster.org/14920 Smoke: Gluster Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.org> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> Reviewed-by: Ravishankar N <ravishankar@redhat.com> Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
Diffstat (limited to 'libglusterfs/src/common-utils.c')
-rw-r--r--libglusterfs/src/common-utils.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/libglusterfs/src/common-utils.c b/libglusterfs/src/common-utils.c
index 45886dae3ee..09dfd450102 100644
--- a/libglusterfs/src/common-utils.c
+++ b/libglusterfs/src/common-utils.c
@@ -4426,6 +4426,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)
{