summaryrefslogtreecommitdiffstats
path: root/xlators/features/marker/src/marker.c
diff options
context:
space:
mode:
authorJunaid <junaid@gluster.com>2011-04-12 10:01:28 +0000
committerAnand Avati <avati@gluster.com>2011-04-13 00:38:55 -0700
commitbdb3e709e3eec1863181339bf1a5b66b702ac1bb (patch)
tree7fcd85122078c2f0f0e8a6a9ff51ca03e6df6273 /xlators/features/marker/src/marker.c
parent4b6a08fba53d895c84676d8c3ae6a5ef45fa2286 (diff)
features/marker: Filter the quota xattr's on getxattr with NULL name argument.
Signed-off-by: Junaid <junaid@gluster.com> Signed-off-by: Anand Avati <avati@gluster.com> BUG: 2473 (Support for volume and directory level quota) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2473
Diffstat (limited to 'xlators/features/marker/src/marker.c')
-rw-r--r--xlators/features/marker/src/marker.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/xlators/features/marker/src/marker.c b/xlators/features/marker/src/marker.c
index 66ef66f62..6e65d090f 100644
--- a/xlators/features/marker/src/marker.c
+++ b/xlators/features/marker/src/marker.c
@@ -27,6 +27,7 @@
#include "marker.h"
#include "marker-mem-types.h"
#include "marker-quota.h"
+#include "marker-common.h"
void
fini (xlator_t *this);
@@ -263,6 +264,12 @@ int32_t
marker_getxattr_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
int32_t op_ret, int32_t op_errno, dict_t *dict)
{
+ if (frame->cookie) {
+ gf_log (this->name, GF_LOG_DEBUG,
+ "Filtering the quota extended attributes");
+
+ dict_foreach (dict, marker_filter_quota_xattr, NULL);
+ }
STACK_UNWIND_STRICT (getxattr, frame, op_ret, op_errno, dict);
return 0;
}
@@ -283,9 +290,18 @@ marker_getxattr (call_frame_t *frame, xlator_t *this, loc_t *loc,
ret = call_from_special_client (frame, this, name);
wind:
- if (ret == _gf_false)
+ if (ret == _gf_false) {
+ if (name == NULL) {
+ /* Signifies that marker translator
+ * has to filter the quota's xattr's,
+ * this is to prevent afr from performing
+ * self healing on marker-quota xattrs'
+ */
+ frame->cookie = (void *) 1;
+ }
STACK_WIND (frame, marker_getxattr_cbk, FIRST_CHILD(this),
FIRST_CHILD(this)->fops->getxattr, loc, name);
+ }
return 0;
}