summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorshishir gowda <shishirng@gluster.com>2010-07-20 04:24:08 +0000
committerAnand V. Avati <avati@dev.gluster.com>2010-07-20 09:45:44 -0700
commit22516806e1c0c7830362f8d7fe055037df0d09e8 (patch)
tree2df73c2d07ea5ce6e00f74a9d4f096a2bda72db0
parenta81a794c9311f90551277670c0f9d201bd96abfc (diff)
features/trash convert STACK_UNWIND TO STACK_UNWIND STRICT
Signed-off-by: shishir gowda <shishirng@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 269 (Add a specialized STACK_UNWIND macro for each FOP) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=269
-rw-r--r--xlators/features/trash/src/trash.c24
-rw-r--r--xlators/features/trash/src/trash.h8
2 files changed, 16 insertions, 16 deletions
diff --git a/xlators/features/trash/src/trash.c b/xlators/features/trash/src/trash.c
index d60bf4b8310..7a0b6f2b880 100644
--- a/xlators/features/trash/src/trash.c
+++ b/xlators/features/trash/src/trash.c
@@ -73,7 +73,7 @@ trash_common_unwind_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
int32_t op_ret, int32_t op_errno,
struct iatt *preparent, struct iatt *postparent)
{
- TRASH_STACK_UNWIND (frame, op_ret, op_errno, preparent, postparent);
+ TRASH_STACK_UNWIND (unlink, frame, op_ret, op_errno, preparent, postparent);
return 0;
}
@@ -247,7 +247,7 @@ trash_unlink_rename_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
}
/* All other cases, unlink should return success */
- TRASH_STACK_UNWIND (frame, 0, op_errno, &local->preparent,
+ TRASH_STACK_UNWIND (unlink, frame, 0, op_errno, &local->preparent,
&local->postparent);
return 0;
@@ -260,7 +260,7 @@ trash_common_unwind_buf_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
int32_t op_ret, int32_t op_errno,
struct iatt *prebuf, struct iatt *postbuf)
{
- TRASH_STACK_UNWIND (frame, op_ret, op_errno, prebuf, postbuf);
+ TRASH_STACK_UNWIND (truncate, frame, op_ret, op_errno, prebuf, postbuf);
return 0;
}
@@ -270,7 +270,7 @@ trash_common_rename_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
struct iatt *preoldparent, struct iatt *postoldparent,
struct iatt *prenewparent, struct iatt *postnewparent)
{
- TRASH_STACK_UNWIND (frame, op_ret, op_errno, stbuf, preoldparent,
+ TRASH_STACK_UNWIND (rename, frame, op_ret, op_errno, stbuf, preoldparent,
postoldparent, prenewparent, postnewparent);
return 0;
}
@@ -320,8 +320,8 @@ trash_unlink_stat_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
return 0;
fail:
- TRASH_STACK_UNWIND (frame, op_ret, op_errno, buf,
- NULL, NULL, NULL, NULL);
+ TRASH_STACK_UNWIND (unlink, frame, op_ret, op_errno, buf,
+ NULL);
return 0;
@@ -539,7 +539,7 @@ trash_rename (call_frame_t *frame, xlator_t *this, loc_t *oldloc,
gf_trash_mt_trash_local_t);
if (!local) {
gf_log (this->name, GF_LOG_ERROR, "out of memory");
- TRASH_STACK_UNWIND (frame, -1, ENOMEM,
+ TRASH_STACK_UNWIND (rename, frame, -1, ENOMEM,
NULL, NULL, NULL, NULL, NULL);
return 0;
}
@@ -616,7 +616,7 @@ trash_unlink (call_frame_t *frame, xlator_t *this, loc_t *loc)
gf_trash_mt_trash_local_t);
if (!local) {
gf_log (this->name, GF_LOG_DEBUG, "out of memory");
- TRASH_STACK_UNWIND (frame, -1, ENOMEM, NULL, NULL);
+ TRASH_STACK_UNWIND (unlink, frame, -1, ENOMEM, NULL, NULL);
return 0;
}
frame->local = local;
@@ -961,7 +961,7 @@ trash_truncate_stat_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
"fstat on the file failed: %s",
strerror (op_errno));
- TRASH_STACK_UNWIND (frame, op_ret, op_errno, buf);
+ TRASH_STACK_UNWIND (truncate, frame, op_ret, op_errno, buf, NULL);
return 0;
}
@@ -1051,7 +1051,7 @@ trash_truncate (call_frame_t *frame, xlator_t *this, loc_t *loc,
gf_trash_mt_trash_local_t);
if (!local) {
gf_log (this->name, GF_LOG_DEBUG, "out of memory");
- TRASH_STACK_UNWIND (frame, -1, ENOMEM, NULL);
+ TRASH_STACK_UNWIND (truncate, frame, -1, ENOMEM, NULL, NULL);
return 0;
}
@@ -1323,7 +1323,7 @@ trash_ftruncate_fstat_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
gf_log (this->name, GF_LOG_DEBUG,
"%s: %s",local->newloc.path, strerror(op_errno));
- TRASH_STACK_UNWIND (frame, -1, op_errno, buf, NULL);
+ TRASH_STACK_UNWIND (ftruncate, frame, -1, op_errno, buf, NULL);
return 0;
}
if ((buf->ia_size == 0) || (buf->ia_size > priv->max_trash_file_size))
@@ -1392,7 +1392,7 @@ trash_ftruncate (call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset)
gf_trash_mt_trash_local_t);
if (!local) {
gf_log (this->name, GF_LOG_DEBUG, "out of memory");
- TRASH_STACK_UNWIND (frame, -1, ENOMEM, NULL, NULL);
+ TRASH_STACK_UNWIND (ftruncate, frame, -1, ENOMEM, NULL, NULL);
return 0;
}
diff --git a/xlators/features/trash/src/trash.h b/xlators/features/trash/src/trash.h
index e1a1c314dc8..ea393fe67ef 100644
--- a/xlators/features/trash/src/trash.h
+++ b/xlators/features/trash/src/trash.h
@@ -59,8 +59,8 @@ struct trash_struct {
char origpath[PATH_MAX];
char newpath[PATH_MAX];
int32_t loop_count;
- struct stat preparent;
- struct stat postparent;
+ struct iatt preparent;
+ struct iatt postparent;
};
typedef struct trash_struct trash_local_t;
@@ -77,11 +77,11 @@ struct trash_priv {
};
typedef struct trash_priv trash_private_t;
-#define TRASH_STACK_UNWIND(frame, params ...) do { \
+#define TRASH_STACK_UNWIND(op, frame, params ...) do { \
trash_local_t *__local = NULL; \
__local = frame->local; \
frame->local = NULL; \
- STACK_UNWIND (frame, params); \
+ STACK_UNWIND_STRICT (op, frame, params); \
trash_local_wipe (__local); \
} while (0)