summaryrefslogtreecommitdiffstats
path: root/xlators
diff options
context:
space:
mode:
Diffstat (limited to 'xlators')
-rw-r--r--xlators/features/protect/src/prot_client.c7
-rw-r--r--xlators/meta/src/frames-file.c6
2 files changed, 6 insertions, 7 deletions
diff --git a/xlators/features/protect/src/prot_client.c b/xlators/features/protect/src/prot_client.c
index dde3abdadc8..79636410b94 100644
--- a/xlators/features/protect/src/prot_client.c
+++ b/xlators/features/protect/src/prot_client.c
@@ -35,10 +35,9 @@ pcli_print_trace (char *name, call_frame_t *frame)
int i;
gf_log (name, GF_LOG_INFO, "Translator stack:");
- while (frame) {
+ list_for_each_entry (frame, &frame->root->myframes, frames) {
gf_log (name, GF_LOG_INFO, "%s (%s)",
frame->wind_from, frame->this->name);
- frame = frame->next;
}
size = backtrace (frames, NUM_FRAMES);
@@ -77,7 +76,7 @@ pcli_rename (call_frame_t *frame, xlator_t *this, loc_t *oldloc,
if (value != PROT_ACT_NONE) {
gf_log (this->name, GF_LOG_WARNING,
"got rename for protected %s", oldloc->path);
- pcli_print_trace (this->name, frame->next);
+ pcli_print_trace (this->name, frame);
if (value == PROT_ACT_REJECT) {
STACK_UNWIND_STRICT (rename, frame, -1, EPERM,
NULL, NULL, NULL, NULL, NULL,
@@ -161,7 +160,7 @@ pcli_unlink (call_frame_t *frame, xlator_t *this, loc_t *loc, int xflag,
if (value != PROT_ACT_NONE) {
gf_log (this->name, GF_LOG_WARNING,
"got unlink for protected %s", loc->path);
- pcli_print_trace(this->name,frame->next);
+ pcli_print_trace(this->name, frame);
if (value == PROT_ACT_REJECT) {
STACK_UNWIND_STRICT (unlink, frame, -1, EPERM,
NULL, NULL, NULL);
diff --git a/xlators/meta/src/frames-file.c b/xlators/meta/src/frames-file.c
index 7d48d7a62d4..ebac3d9cbaa 100644
--- a/xlators/meta/src/frames-file.c
+++ b/xlators/meta/src/frames-file.c
@@ -39,8 +39,7 @@ frames_file_fill (xlator_t *this, inode_t *file, strfd_t *strfd)
strprintf (strfd, "\t\t\"Number\": %d,\n", ++i);
strprintf (strfd, "\t\t\"Frame\": [\n");
j = 1;
- for (frame = &stack->frames; frame;
- frame = frame->next) {
+ list_for_each_entry (frame, &stack->myframes, frames) {
strprintf (strfd, "\t\t {\n");
strprintf (strfd, "\t\t\t\"Number\": %d,\n",
j++);
@@ -71,7 +70,8 @@ frames_file_fill (xlator_t *this, inode_t *file, strfd_t *strfd)
frame->unwind_to);
strprintf (strfd, "\t\t\t\"Complete\": %d\n",
frame->complete);
- if (frame->next == NULL)
+ if (list_is_last (&frame->frames,
+ &stack->myframes))
strprintf (strfd, "\t\t }\n");
else
strprintf (strfd, "\t\t },\n");