diff options
Diffstat (limited to 'xlators/storage/posix/src/posix-handle.h')
-rw-r--r-- | xlators/storage/posix/src/posix-handle.h | 53 |
1 files changed, 30 insertions, 23 deletions
diff --git a/xlators/storage/posix/src/posix-handle.h b/xlators/storage/posix/src/posix-handle.h index e0b5b67e20f..356b7b9f309 100644 --- a/xlators/storage/posix/src/posix-handle.h +++ b/xlators/storage/posix/src/posix-handle.h @@ -19,6 +19,7 @@ #include <sys/types.h> #include "xlator.h" #include "gf-dirent.h" +#include "posix-messages.h" /* From Open Group Base Specifications Issue 6 */ #ifndef _XOPEN_PATH_MAX @@ -50,9 +51,9 @@ flags); \ if (op_ret == -1) { \ op_errno = errno; \ - gf_log (this->name, GF_LOG_WARNING, \ - "setting xattr failed on %s: key = %s (%s)", \ - path, key, strerror (op_errno)); \ + gf_msg (this->name, GF_LOG_WARNING, errno, P_MSG_PGFID_OP, \ + "setting xattr failed on %s: key = %s ", \ + path, key); \ goto label; \ } \ } while (0) @@ -67,9 +68,10 @@ SET_PGFID_XATTR (path, key, value, flags, \ op_ret, this, label); \ } else { \ - gf_log(this->name, GF_LOG_WARNING, "getting " \ - "xattr failed on %s: key = %s (%s)", \ - path, key, strerror (op_errno)); \ + gf_msg (this->name, GF_LOG_WARNING, op_errno, \ + P_MSG_PGFID_OP, "getting xattr " \ + "failed on %s: key = %s ", \ + path, key); \ } \ } \ } while (0) @@ -78,9 +80,10 @@ op_ret = sys_lremovexattr (path, key); \ if (op_ret == -1) { \ op_errno = errno; \ - gf_log (this->name, GF_LOG_WARNING, "removing xattr " \ - "failed on %s: key = %s (%s)", path, key, \ - strerror (op_errno)); \ + gf_msg (this->name, GF_LOG_WARNING, op_errno, \ + P_MSG_PGFID_OP, \ + "removing xattr failed" \ + "on %s: key = %s", path, key); \ goto label; \ } \ } while (0) @@ -93,9 +96,9 @@ if (op_errno == ENOATTR || op_errno == ENODATA) { \ value = 1; \ } else { \ - gf_log (this->name, GF_LOG_WARNING,"getting xattr " \ - "failed on %s: key = %s (%s)", path, key, \ - strerror (op_errno)); \ + gf_msg (this->name, GF_LOG_WARNING, errno, \ + P_MSG_PGFID_OP, "getting xattr " \ + "failed on %s: key = %s ", path, key); \ goto label; \ } \ } else { \ @@ -110,8 +113,9 @@ op_ret = sys_lgetxattr (path, key, &value, sizeof (value)); \ if (op_ret == -1) { \ op_errno = errno; \ - gf_log (this->name, GF_LOG_WARNING, "getting xattr failed on " \ - "%s: key = %s (%s)", path, key, strerror (op_errno)); \ + gf_msg (this->name, GF_LOG_WARNING, errno, \ + P_MSG_PGFID_OP, "getting xattr failed on " \ + "%s: key = %s ", path, key); \ goto label; \ } else { \ value = ntoh32 (value); \ @@ -182,7 +186,8 @@ #define MAKE_INODE_HANDLE(rpath, this, loc, iatt_p) do { \ if (gf_uuid_is_null (loc->gfid)) { \ - gf_log (this->name, GF_LOG_ERROR, \ + gf_msg (this->name, GF_LOG_ERROR, 0, \ + P_MSG_INODE_HANDLE_CREATE, \ "null gfid for path %s", (loc)->path); \ break; \ } \ @@ -194,12 +199,13 @@ errno = 0; \ op_ret = posix_istat (this, loc->gfid, NULL, iatt_p); \ if (errno != ELOOP) { \ - MAKE_HANDLE_PATH (rpath, this, (loc)->gfid, NULL); \ + MAKE_HANDLE_PATH (rpath, this, (loc)->gfid, NULL); \ if (!rpath) { \ op_ret = -1; \ - gf_log (this->name, GF_LOG_ERROR, \ - "Failed to create inode handle " \ - "for path %s", (loc)->path); \ + gf_msg (this->name, GF_LOG_ERROR, errno, \ + P_MSG_INODE_HANDLE_CREATE, \ + "Failed to create inode handle " \ + "for path %s", (loc)->path); \ } \ break; \ } \ @@ -211,7 +217,7 @@ char *__parp; \ \ if (gf_uuid_is_null (loc->pargfid) || !loc->name) { \ - gf_log (this->name, GF_LOG_ERROR, \ + gf_msg (this->name, GF_LOG_ERROR, 0, P_MSG_ENTRY_HANDLE_CREATE,\ "null pargfid/name for path %s", loc->path); \ break; \ } \ @@ -229,9 +235,10 @@ MAKE_HANDLE_PATH (parp, this, loc->pargfid, NULL); \ MAKE_HANDLE_PATH (entp, this, loc->pargfid, loc->name); \ if (!parp || !entp) { \ - gf_log (this->name, GF_LOG_ERROR, \ - "Failed to create entry handle " \ - "for path %s", loc->path); \ + gf_msg (this->name, GF_LOG_ERROR, errno, \ + P_MSG_ENTRY_HANDLE_CREATE, \ + "Failed to create entry handle " \ + "for path %s", loc->path); \ } \ break; \ } \ |