summaryrefslogtreecommitdiffstats
path: root/xlators/features/trash/src
diff options
context:
space:
mode:
authorvmallika <vmallika@redhat.com>2015-11-02 15:39:46 +0530
committerRaghavendra G <rgowdapp@redhat.com>2015-11-09 03:12:26 -0800
commit2794cb71b96c44033dcd01102039c038956cf7b5 (patch)
tree0dc5459474f4e07ba0e75a81b79b0ae99db850bb /xlators/features/trash/src
parentc8c9308134ae4ce24c630a1b0ccfcf4e8f9b0fe7 (diff)
marker: do remove xattr only for last link
With unlink, rename, rmdir, contribution xattrs are removed. If the file is a last link then remove_xattr will fail with ENOENT. So it better to perform remove_xattr only if there are more links to the file Change-Id: Ifc1e7fda4d310fd87f6f28a635c9ea78b8f3929d BUG: 1257694 Signed-off-by: vmallika <vmallika@redhat.com> Reviewed-on: http://review.gluster.org/12033 Tested-by: NetBSD Build System <jenkins@build.gluster.org> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Manikandan Selvaganesh <mselvaga@redhat.com> Reviewed-by: Raghavendra G <rgowdapp@redhat.com>
Diffstat (limited to 'xlators/features/trash/src')
-rw-r--r--xlators/features/trash/src/trash.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/xlators/features/trash/src/trash.c b/xlators/features/trash/src/trash.c
index 35712f98aff..b363dbab825 100644
--- a/xlators/features/trash/src/trash.c
+++ b/xlators/features/trash/src/trash.c
@@ -836,7 +836,7 @@ trash_unlink_rename_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
* CTR Xlator. And trash translator only handles the unlink for
* the last hardlink.
*
- * Check if there is a CTR_REQUEST_LINK_COUNT_XDATA from CTR Xlator
+ * Check if there is a GF_REQUEST_LINK_COUNT_XDATA from CTR Xlator
*
*/
@@ -844,16 +844,16 @@ trash_unlink_rename_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
/* Sending back inode link count to ctr_unlink
* (changetimerecoder xlator) via
- * "CTR_RESPONSE_LINK_COUNT_XDATA" key using xdata.
+ * "GF_RESPONSE_LINK_COUNT_XDATA" key using xdata.
* */
if (xdata) {
ret = dict_set_uint32 (xdata,
- CTR_RESPONSE_LINK_COUNT_XDATA,
+ GF_RESPONSE_LINK_COUNT_XDATA,
1);
if (ret == -1) {
gf_log (this->name, GF_LOG_WARNING,
"Failed to set"
- " CTR_RESPONSE_LINK_COUNT_XDATA");
+ " GF_RESPONSE_LINK_COUNT_XDATA");
}
} else {
new_xdata = dict_new ();
@@ -864,12 +864,12 @@ trash_unlink_rename_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
goto ctr_out;
}
ret = dict_set_uint32 (new_xdata,
- CTR_RESPONSE_LINK_COUNT_XDATA,
+ GF_RESPONSE_LINK_COUNT_XDATA,
1);
if (ret == -1) {
gf_log (this->name, GF_LOG_WARNING,
"Failed to set"
- " CTR_RESPONSE_LINK_COUNT_XDATA");
+ " GF_RESPONSE_LINK_COUNT_XDATA");
}
ctr_out:
TRASH_STACK_UNWIND (unlink, frame, 0, op_errno,
@@ -1088,7 +1088,7 @@ trash_unlink (call_frame_t *frame, xlator_t *this, loc_t *loc, int xflags,
}
/* To know whether CTR xlator requested for the link count */
- ret = dict_get_int32 (xdata, CTR_REQUEST_LINK_COUNT_XDATA,
+ ret = dict_get_int32 (xdata, GF_REQUEST_LINK_COUNT_XDATA,
&ctr_link_req);
if (ret) {
local->ctr_link_count_req = _gf_false;