From 4944fc943efc41df1841e4e559180171f6541112 Mon Sep 17 00:00:00 2001 From: Pranith Kumar K Date: Tue, 26 Feb 2013 16:12:11 +0530 Subject: cluster/afr: Handle REPLICATE_TRASH_DIR from old bricks Change-Id: Ib99f79d3fa607c818dbc62006516480f598d8add BUG: 886998 Signed-off-by: Pranith Kumar K Reviewed-on: http://review.gluster.org/4640 Tested-by: Gluster Build System Reviewed-by: Vijay Bellur --- libglusterfs/src/glusterfs.h | 1 + libglusterfs/src/xlator.c | 11 +++++++++++ libglusterfs/src/xlator.h | 1 + 3 files changed, 13 insertions(+) (limited to 'libglusterfs') diff --git a/libglusterfs/src/glusterfs.h b/libglusterfs/src/glusterfs.h index ac0c81267..b3ff1fd38 100644 --- a/libglusterfs/src/glusterfs.h +++ b/libglusterfs/src/glusterfs.h @@ -143,6 +143,7 @@ ZR_FILE_CONTENT_STRLEN)) #define DEFAULT_VAR_RUN_DIRECTORY DATADIR "/run/gluster" +#define GF_REPLICATE_TRASH_DIR ".landfill" /* GlusterFS's maximum supported Auxilary GIDs */ /* TODO: Keeping it to 200, so that we can fit in 2KB buffer for auth data diff --git a/libglusterfs/src/xlator.c b/libglusterfs/src/xlator.c index b1c090c1e..a7caedf02 100644 --- a/libglusterfs/src/xlator.c +++ b/libglusterfs/src/xlator.c @@ -684,6 +684,17 @@ err: return ret; } +gf_boolean_t +loc_is_root (loc_t *loc) +{ + if (loc && __is_root_gfid (loc->gfid)) { + return _gf_true; + } else if (loc && loc->inode && __is_root_gfid (loc->inode->gfid)) { + return _gf_true; + } + return _gf_false; +} + int xlator_list_destroy (xlator_list_t *list) { diff --git a/libglusterfs/src/xlator.h b/libglusterfs/src/xlator.h index 817eaddec..d23ee0c25 100644 --- a/libglusterfs/src/xlator.h +++ b/libglusterfs/src/xlator.h @@ -922,6 +922,7 @@ void loc_wipe (loc_t *loc); int loc_path (loc_t *loc, const char *bname); void loc_gfid (loc_t *loc, uuid_t gfid); char* loc_gfid_utoa (loc_t *loc); +gf_boolean_t loc_is_root (loc_t *loc); int xlator_mem_acct_init (xlator_t *xl, int num_types); int is_gf_log_command (xlator_t *trans, const char *name, char *value); int glusterd_check_log_level (const char *value); -- cgit