summaryrefslogtreecommitdiffstats
path: root/xlators/performance
diff options
context:
space:
mode:
authorRaghavendra G <raghavendra@gluster.com>2009-12-03 21:47:23 +0000
committerAnand V. Avati <avati@dev.gluster.com>2009-12-04 01:46:38 -0800
commit349f9b77178aac3d2823bb35b0dc6c40b7a3b876 (patch)
tree8d45df9f06351aa8bedddb7f90395dcee4195c47 /xlators/performance
parent45494f35deb30b6e0410351bdea7cf10f8f83c04 (diff)
performance/stat-prefetch: add "caller" arguement to sp_process_inode_ctx.
- since sp_process_inode_ctx is called by many fops, if the context is not set "caller" argument can be logged in log msgs to identify caller. Signed-off-by: Raghavendra G <raghavendra@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 221 (stat prefetch implementation) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=221
Diffstat (limited to 'xlators/performance')
-rw-r--r--xlators/performance/stat-prefetch/src/stat-prefetch.c58
1 files changed, 37 insertions, 21 deletions
diff --git a/xlators/performance/stat-prefetch/src/stat-prefetch.c b/xlators/performance/stat-prefetch/src/stat-prefetch.c
index 0f697aaf295..89f4509b5dc 100644
--- a/xlators/performance/stat-prefetch/src/stat-prefetch.c
+++ b/xlators/performance/stat-prefetch/src/stat-prefetch.c
@@ -235,7 +235,7 @@ out:
int32_t
sp_process_inode_ctx (call_frame_t *frame, xlator_t *this, loc_t *loc,
call_stub_t *stub, char *need_unwind, char *need_lookup,
- char *can_wind, int32_t *error)
+ char *can_wind, int32_t *error, glusterfs_fop_t caller)
{
int32_t ret = -1, op_errno = -1;
sp_local_t *local = NULL;
@@ -256,7 +256,7 @@ sp_process_inode_ctx (call_frame_t *frame, xlator_t *this, loc_t *loc,
ret = inode_ctx_get (loc->inode, this, &value);
if (ret == -1) {
gf_log (this->name, GF_LOG_DEBUG, "context not set in inode "
- "(%p)", loc->inode);
+ "(%p) (caller %d)", loc->inode, caller);
*can_wind = 1;
*need_unwind = 0;
op_errno = 0;
@@ -1366,7 +1366,7 @@ sp_open (call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t flags,
}
sp_process_inode_ctx (frame, this, loc, stub, &need_unwind,
- &need_lookup, &can_wind, &op_errno);
+ &need_lookup, &can_wind, &op_errno, GF_FOP_OPEN);
out:
if (need_unwind) {
SP_STACK_UNWIND (open, frame, -1, op_errno, fd);
@@ -1566,7 +1566,8 @@ sp_opendir (call_frame_t *frame, xlator_t *this, loc_t *loc, fd_t *fd)
}
sp_process_inode_ctx (frame, this, loc, stub, &need_unwind,
- &need_lookup, &can_wind, &op_errno);
+ &need_lookup, &can_wind, &op_errno,
+ GF_FOP_OPENDIR);
out:
if (need_unwind) {
@@ -1907,7 +1908,7 @@ sp_link (call_frame_t *frame, xlator_t *this, loc_t *oldloc, loc_t *newloc)
}
sp_process_inode_ctx (frame, this, oldloc, stub, &need_unwind,
- &need_lookup, &can_wind, &op_errno);
+ &need_lookup, &can_wind, &op_errno, GF_FOP_LINK);
out:
if (need_unwind) {
@@ -1996,7 +1997,8 @@ sp_truncate (call_frame_t *frame, xlator_t *this, loc_t *loc, off_t offset)
}
sp_process_inode_ctx (frame, this, loc, stub, &need_unwind,
- &need_lookup, &can_wind, &op_errno);
+ &need_lookup, &can_wind, &op_errno,
+ GF_FOP_TRUNCATE);
out:
if (need_unwind) {
@@ -2131,7 +2133,8 @@ sp_setattr (call_frame_t *frame, xlator_t *this,
}
sp_process_inode_ctx (frame, this, loc, stub, &need_unwind,
- &need_lookup, &can_wind, &op_errno);
+ &need_lookup, &can_wind, &op_errno,
+ GF_FOP_SETATTR);
out:
if (need_unwind) {
@@ -2229,7 +2232,8 @@ sp_readlink (call_frame_t *frame, xlator_t *this, loc_t *loc, size_t size)
}
sp_process_inode_ctx (frame, this, loc, stub, &need_unwind,
- &need_lookup, &can_wind, &op_errno);
+ &need_lookup, &can_wind, &op_errno,
+ GF_FOP_READLINK);
out:
if (need_unwind) {
@@ -2345,7 +2349,8 @@ sp_unlink (call_frame_t *frame, xlator_t *this, loc_t *loc)
}
sp_process_inode_ctx (frame, this, loc, stub, &need_unwind,
- &need_lookup, &can_wind, &op_errno);
+ &need_lookup, &can_wind, &op_errno,
+ GF_FOP_UNLINK);
out:
if (need_unwind) {
@@ -2466,7 +2471,8 @@ sp_rmdir (call_frame_t *frame, xlator_t *this, loc_t *loc)
}
sp_process_inode_ctx (frame, this, loc, stub, &need_unwind,
- &need_lookup, &can_wind, &op_errno);
+ &need_lookup, &can_wind, &op_errno,
+ GF_FOP_RMDIR);
out:
if (need_unwind) {
@@ -2766,7 +2772,7 @@ sp_rename (call_frame_t *frame, xlator_t *this, loc_t *oldloc,loc_t *newloc)
ret = sp_process_inode_ctx (frame, this, oldloc, stub, &need_unwind,
&old_inode_need_lookup, &old_inode_can_wind,
- &op_errno);
+ &op_errno, GF_FOP_RENAME);
if (ret == -1) {
goto out;
}
@@ -2783,7 +2789,8 @@ sp_rename (call_frame_t *frame, xlator_t *this, loc_t *oldloc,loc_t *newloc)
ret = sp_process_inode_ctx (frame, this, newloc, stub,
&need_unwind,
&new_inode_need_lookup,
- &new_inode_can_wind, &op_errno);
+ &new_inode_can_wind, &op_errno,
+ GF_FOP_RENAME);
if (ret == -1) {
ret = inode_ctx_get (oldloc->inode, this, &value);
if (ret == -1) {
@@ -2908,7 +2915,8 @@ sp_setxattr (call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *dict,
}
sp_process_inode_ctx (frame, this, loc, stub, &need_unwind,
- &need_lookup, &can_wind, &op_errno);
+ &need_lookup, &can_wind, &op_errno,
+ GF_FOP_SETXATTR);
out:
if (need_unwind) {
@@ -2998,7 +3006,8 @@ sp_removexattr (call_frame_t *frame, xlator_t *this, loc_t *loc,
}
sp_process_inode_ctx (frame, this, loc, stub, &need_unwind,
- &need_lookup, &can_wind, &op_errno);
+ &need_lookup, &can_wind, &op_errno,
+ GF_FOP_REMOVEXATTR);
out:
if (need_unwind) {
@@ -3086,7 +3095,8 @@ sp_getxattr (call_frame_t *frame, xlator_t *this, loc_t *loc, const char *name)
}
sp_process_inode_ctx (frame, this, loc, stub, &need_unwind,
- &need_lookup, &can_wind, &op_errno);
+ &need_lookup, &can_wind, &op_errno,
+ GF_FOP_GETXATTR);
out:
if (need_unwind) {
@@ -3316,7 +3326,8 @@ sp_checksum (call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t flag)
}
sp_process_inode_ctx (frame, this, loc, stub, &need_unwind,
- &need_lookup, &can_wind, &op_errno);
+ &need_lookup, &can_wind, &op_errno,
+ GF_FOP_CHECKSUM);
out:
if (need_unwind) {
@@ -3414,7 +3425,8 @@ sp_xattrop (call_frame_t *frame, xlator_t *this, loc_t *loc,
}
sp_process_inode_ctx (frame, this, loc, stub, &need_unwind,
- &need_lookup, &can_wind, &op_errno);
+ &need_lookup, &can_wind, &op_errno,
+ GF_FOP_XATTROP);
out:
if (need_unwind) {
@@ -3537,7 +3549,8 @@ sp_stat (call_frame_t *frame, xlator_t *this, loc_t *loc)
}
sp_process_inode_ctx (frame, this, loc, stub, &need_unwind,
- &need_lookup, &can_wind, &op_errno);
+ &need_lookup, &can_wind, &op_errno,
+ GF_FOP_STAT);
out:
if (need_unwind) {
@@ -3615,7 +3628,8 @@ sp_access (call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t mask)
}
sp_process_inode_ctx (frame, this, loc, stub, &need_unwind,
- &need_lookup, &can_wind, &op_errno);
+ &need_lookup, &can_wind, &op_errno,
+ GF_FOP_ACCESS);
out:
if (need_unwind) {
@@ -3696,7 +3710,8 @@ sp_inodelk (call_frame_t *frame, xlator_t *this, const char *volume, loc_t *loc,
}
sp_process_inode_ctx (frame, this, loc, stub, &need_unwind,
- &need_lookup, &can_wind, &op_errno);
+ &need_lookup, &can_wind, &op_errno,
+ GF_FOP_INODELK);
out:
if (need_unwind) {
@@ -3780,7 +3795,8 @@ sp_entrylk (call_frame_t *frame, xlator_t *this, const char *volume, loc_t *loc,
}
sp_process_inode_ctx (frame, this, loc, stub, &need_unwind,
- &need_lookup, &can_wind, &op_errno);
+ &need_lookup, &can_wind, &op_errno,
+ GF_FOP_ENTRYLK);
out:
if (need_unwind) {