|
|
cb8e9e |
From b5e31df9cffbfc8ccedc0cc65e9c8af8ac91e462 Mon Sep 17 00:00:00 2001
|
|
|
cb8e9e |
From: Mohamed Ashiq <ashiq333@gmail.com>
|
|
|
cb8e9e |
Date: Tue, 19 May 2015 15:34:43 +0530
|
|
|
cb8e9e |
Subject: [PATCH 164/190] fd,inode/libglusterfs : porting to a new logging framework
|
|
|
cb8e9e |
|
|
|
cb8e9e |
Change-Id: I4beba3b50456f802824374b6e3fa8079d72f2c00
|
|
|
cb8e9e |
BUG: 1231792
|
|
|
cb8e9e |
Signed-off-by: Mohamed Ashiq Liyazudeen <mliyazud@redhat.com>
|
|
|
cb8e9e |
Reviewed-on: http://review.gluster.org/10825
|
|
|
cb8e9e |
Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
|
|
|
cb8e9e |
Tested-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
|
|
|
cb8e9e |
Reviewed-on: https://code.engineering.redhat.com/gerrit/51214
|
|
|
cb8e9e |
Reviewed-by: Venky Shankar <vshankar@redhat.com>
|
|
|
cb8e9e |
Tested-by: Venky Shankar <vshankar@redhat.com>
|
|
|
cb8e9e |
---
|
|
|
cb8e9e |
libglusterfs/src/fd-lk.c | 47 +++++++--------
|
|
|
cb8e9e |
libglusterfs/src/fd.c | 82 ++++++++++++++++---------
|
|
|
cb8e9e |
libglusterfs/src/inode.c | 150 ++++++++++++++++++++++++++++++----------------
|
|
|
cb8e9e |
3 files changed, 172 insertions(+), 107 deletions(-)
|
|
|
cb8e9e |
|
|
|
cb8e9e |
diff --git a/libglusterfs/src/fd-lk.c b/libglusterfs/src/fd-lk.c
|
|
|
cb8e9e |
index 3c1befe..01c6c1a 100644
|
|
|
cb8e9e |
--- a/libglusterfs/src/fd-lk.c
|
|
|
cb8e9e |
+++ b/libglusterfs/src/fd-lk.c
|
|
|
cb8e9e |
@@ -10,7 +10,7 @@
|
|
|
cb8e9e |
|
|
|
cb8e9e |
#include "fd-lk.h"
|
|
|
cb8e9e |
#include "common-utils.h"
|
|
|
cb8e9e |
-
|
|
|
cb8e9e |
+#include "libglusterfs-messages.h"
|
|
|
cb8e9e |
|
|
|
cb8e9e |
int32_t
|
|
|
cb8e9e |
_fd_lk_delete_lock (fd_lk_ctx_node_t *lock)
|
|
|
cb8e9e |
@@ -89,8 +89,8 @@ fd_lk_ctx_t *
|
|
|
cb8e9e |
_fd_lk_ctx_ref (fd_lk_ctx_t *lk_ctx)
|
|
|
cb8e9e |
{
|
|
|
cb8e9e |
if (!lk_ctx) {
|
|
|
cb8e9e |
- gf_log_callingfn ("fd", GF_LOG_WARNING,
|
|
|
cb8e9e |
- "invalid argument");
|
|
|
cb8e9e |
+ gf_msg_callingfn ("fd-lk", GF_LOG_WARNING, EINVAL,
|
|
|
cb8e9e |
+ LG_MSG_INVALID_ARG, "invalid argument");
|
|
|
cb8e9e |
return NULL;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
@@ -105,8 +105,8 @@ fd_lk_ctx_ref (fd_lk_ctx_t *lk_ctx)
|
|
|
cb8e9e |
fd_lk_ctx_t *new_lk_ctx = NULL;
|
|
|
cb8e9e |
|
|
|
cb8e9e |
if (!lk_ctx) {
|
|
|
cb8e9e |
- gf_log_callingfn ("fd", GF_LOG_WARNING,
|
|
|
cb8e9e |
- "invalid argument");
|
|
|
cb8e9e |
+ gf_msg_callingfn ("fd-lk", GF_LOG_WARNING, EINVAL,
|
|
|
cb8e9e |
+ LG_MSG_INVALID_ARG, "invalid argument");
|
|
|
cb8e9e |
return NULL;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
@@ -418,19 +418,18 @@ print_lock_list (fd_lk_ctx_t *lk_ctx)
|
|
|
cb8e9e |
{
|
|
|
cb8e9e |
fd_lk_ctx_node_t *lk = NULL;
|
|
|
cb8e9e |
|
|
|
cb8e9e |
- gf_log ("fd-lk", GF_LOG_DEBUG, "lock list:");
|
|
|
cb8e9e |
+ gf_msg_debug ("fd-lk", 0, "lock list:");
|
|
|
cb8e9e |
|
|
|
cb8e9e |
list_for_each_entry (lk, &lk_ctx->lk_list, next)
|
|
|
cb8e9e |
- gf_log ("fd-lk", GF_LOG_DEBUG, "owner = %s, "
|
|
|
cb8e9e |
- "cmd = %s fl_type = %s, fs_start = %"PRId64", "
|
|
|
cb8e9e |
- "fs_end = %"PRId64", user_flock: l_type = %s, "
|
|
|
cb8e9e |
- "l_start = %"PRId64", l_len = %"PRId64", ",
|
|
|
cb8e9e |
- lkowner_utoa (&lk->user_flock.l_owner),
|
|
|
cb8e9e |
- get_lk_cmd (lk->cmd), get_lk_type (lk->fl_type),
|
|
|
cb8e9e |
- lk->fl_start, lk->fl_end,
|
|
|
cb8e9e |
- get_lk_type (lk->user_flock.l_type),
|
|
|
cb8e9e |
- lk->user_flock.l_start,
|
|
|
cb8e9e |
- lk->user_flock.l_len);
|
|
|
cb8e9e |
+ gf_msg_debug ("fd-lk", 0, "owner = %s, cmd = %s fl_type = %s,"
|
|
|
cb8e9e |
+ " fs_start = %"PRId64", fs_end = %"PRId64", "
|
|
|
cb8e9e |
+ "user_flock: l_type = %s, l_start = %"PRId64", "
|
|
|
cb8e9e |
+ "l_len = %"PRId64", ",
|
|
|
cb8e9e |
+ lkowner_utoa (&lk->user_flock.l_owner),
|
|
|
cb8e9e |
+ get_lk_cmd (lk->cmd), get_lk_type (lk->fl_type),
|
|
|
cb8e9e |
+ lk->fl_start, lk->fl_end,
|
|
|
cb8e9e |
+ get_lk_type (lk->user_flock.l_type),
|
|
|
cb8e9e |
+ lk->user_flock.l_start, lk->user_flock.l_len);
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
int
|
|
|
cb8e9e |
@@ -447,15 +446,13 @@ fd_lk_insert_and_merge (fd_t *fd, int32_t cmd,
|
|
|
cb8e9e |
lk_ctx = fd_lk_ctx_ref (fd->lk_ctx);
|
|
|
cb8e9e |
lk = fd_lk_ctx_node_new (cmd, flock);
|
|
|
cb8e9e |
|
|
|
cb8e9e |
- gf_log ("fd-lk", GF_LOG_DEBUG,
|
|
|
cb8e9e |
- "new lock requrest: owner = %s, fl_type = %s, "
|
|
|
cb8e9e |
- "fs_start = %"PRId64", fs_end = %"PRId64", "
|
|
|
cb8e9e |
- "user_flock: l_type = %s, l_start = %"PRId64", "
|
|
|
cb8e9e |
- "l_len = %"PRId64, lkowner_utoa (&flock->l_owner),
|
|
|
cb8e9e |
- get_lk_type (lk->fl_type), lk->fl_start,
|
|
|
cb8e9e |
- lk->fl_end, get_lk_type (lk->user_flock.l_type),
|
|
|
cb8e9e |
- lk->user_flock.l_start,
|
|
|
cb8e9e |
- lk->user_flock.l_len);
|
|
|
cb8e9e |
+ gf_msg_debug ("fd-lk", 0, "new lock requrest: owner = %s, fl_type = %s"
|
|
|
cb8e9e |
+ ", fs_start = %"PRId64", fs_end = %"PRId64", user_flock:"
|
|
|
cb8e9e |
+ " l_type = %s, l_start = %"PRId64", l_len = %"PRId64,
|
|
|
cb8e9e |
+ lkowner_utoa (&flock->l_owner),
|
|
|
cb8e9e |
+ get_lk_type (lk->fl_type), lk->fl_start, lk->fl_end,
|
|
|
cb8e9e |
+ get_lk_type (lk->user_flock.l_type),
|
|
|
cb8e9e |
+ lk->user_flock.l_start, lk->user_flock.l_len);
|
|
|
cb8e9e |
|
|
|
cb8e9e |
LOCK (&lk_ctx->lock);
|
|
|
cb8e9e |
{
|
|
|
cb8e9e |
diff --git a/libglusterfs/src/fd.c b/libglusterfs/src/fd.c
|
|
|
cb8e9e |
index 613f901..85334bb 100644
|
|
|
cb8e9e |
--- a/libglusterfs/src/fd.c
|
|
|
cb8e9e |
+++ b/libglusterfs/src/fd.c
|
|
|
cb8e9e |
@@ -13,7 +13,7 @@
|
|
|
cb8e9e |
#include "inode.h"
|
|
|
cb8e9e |
#include "dict.h"
|
|
|
cb8e9e |
#include "statedump.h"
|
|
|
cb8e9e |
-
|
|
|
cb8e9e |
+#include "libglusterfs-messages.h"
|
|
|
cb8e9e |
|
|
|
cb8e9e |
#ifndef _CONFIG_H
|
|
|
cb8e9e |
#define _CONFIG_H
|
|
|
cb8e9e |
@@ -35,7 +35,8 @@ gf_fd_chain_fd_entries (fdentry_t *entries, uint32_t startidx,
|
|
|
cb8e9e |
uint32_t i = 0;
|
|
|
cb8e9e |
|
|
|
cb8e9e |
if (!entries) {
|
|
|
cb8e9e |
- gf_log_callingfn ("fd", GF_LOG_WARNING, "!entries");
|
|
|
cb8e9e |
+ gf_msg_callingfn ("fd", GF_LOG_WARNING, EINVAL,
|
|
|
cb8e9e |
+ LG_MSG_INVALID_ARG, "!entries");
|
|
|
cb8e9e |
return -1;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
@@ -60,7 +61,8 @@ gf_fd_fdtable_expand (fdtable_t *fdtable, uint32_t nr)
|
|
|
cb8e9e |
int ret = -1;
|
|
|
cb8e9e |
|
|
|
cb8e9e |
if (fdtable == NULL || nr > UINT32_MAX) {
|
|
|
cb8e9e |
- gf_log_callingfn ("fd", GF_LOG_ERROR, "invalid argument");
|
|
|
cb8e9e |
+ gf_msg_callingfn ("fd", GF_LOG_ERROR, EINVAL,
|
|
|
cb8e9e |
+ LG_MSG_INVALID_ARG, "invalid argument");
|
|
|
cb8e9e |
ret = EINVAL;
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -127,7 +129,8 @@ __gf_fd_fdtable_get_all_fds (fdtable_t *fdtable, uint32_t *count)
|
|
|
cb8e9e |
fdentry_t *fdentries = NULL;
|
|
|
cb8e9e |
|
|
|
cb8e9e |
if (count == NULL) {
|
|
|
cb8e9e |
- gf_log_callingfn ("fd", GF_LOG_WARNING, "!count");
|
|
|
cb8e9e |
+ gf_msg_callingfn ("fd", GF_LOG_WARNING, EINVAL,
|
|
|
cb8e9e |
+ LG_MSG_INVALID_ARG, "!count");
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
@@ -166,7 +169,8 @@ __gf_fd_fdtable_copy_all_fds (fdtable_t *fdtable, uint32_t *count)
|
|
|
cb8e9e |
int i = 0;
|
|
|
cb8e9e |
|
|
|
cb8e9e |
if (count == NULL) {
|
|
|
cb8e9e |
- gf_log_callingfn ("fd", GF_LOG_WARNING, "!count");
|
|
|
cb8e9e |
+ gf_msg_callingfn ("fd", GF_LOG_WARNING, EINVAL,
|
|
|
cb8e9e |
+ LG_MSG_INVALID_ARG, "!count");
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
@@ -218,7 +222,8 @@ gf_fd_fdtable_destroy (fdtable_t *fdtable)
|
|
|
cb8e9e |
INIT_LIST_HEAD (&list);
|
|
|
cb8e9e |
|
|
|
cb8e9e |
if (!fdtable) {
|
|
|
cb8e9e |
- gf_log_callingfn ("fd", GF_LOG_WARNING, "!fdtable");
|
|
|
cb8e9e |
+ gf_msg_callingfn ("fd", GF_LOG_WARNING, EINVAL,
|
|
|
cb8e9e |
+ LG_MSG_INVALID_ARG, "!fdtable");
|
|
|
cb8e9e |
return;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
@@ -253,7 +258,8 @@ gf_fd_unused_get (fdtable_t *fdtable, fd_t *fdptr)
|
|
|
cb8e9e |
int alloc_attempts = 0;
|
|
|
cb8e9e |
|
|
|
cb8e9e |
if (fdtable == NULL || fdptr == NULL) {
|
|
|
cb8e9e |
- gf_log_callingfn ("fd", GF_LOG_ERROR, "invalid argument");
|
|
|
cb8e9e |
+ gf_msg_callingfn ("fd", GF_LOG_ERROR, EINVAL,
|
|
|
cb8e9e |
+ LG_MSG_INVALID_ARG, "invalid argument");
|
|
|
cb8e9e |
return EINVAL;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
@@ -271,7 +277,8 @@ gf_fd_unused_get (fdtable_t *fdtable, fd_t *fdptr)
|
|
|
cb8e9e |
* seriously wrong with our data structures.
|
|
|
cb8e9e |
*/
|
|
|
cb8e9e |
if (alloc_attempts >= 2) {
|
|
|
cb8e9e |
- gf_log ("fd", GF_LOG_ERROR,
|
|
|
cb8e9e |
+ gf_msg ("fd", GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ LG_MSG_EXPAND_FD_TABLE_FAILED,
|
|
|
cb8e9e |
"multiple attempts to expand fd table"
|
|
|
cb8e9e |
" have failed.");
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
@@ -279,7 +286,8 @@ gf_fd_unused_get (fdtable_t *fdtable, fd_t *fdptr)
|
|
|
cb8e9e |
error = gf_fd_fdtable_expand (fdtable,
|
|
|
cb8e9e |
fdtable->max_fds + 1);
|
|
|
cb8e9e |
if (error) {
|
|
|
cb8e9e |
- gf_log ("fd", GF_LOG_ERROR,
|
|
|
cb8e9e |
+ gf_msg ("fd", GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ LG_MSG_EXPAND_FD_TABLE_FAILED,
|
|
|
cb8e9e |
"Cannot expand fdtable: %s",
|
|
|
cb8e9e |
strerror (error));
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
@@ -312,12 +320,14 @@ gf_fd_put (fdtable_t *fdtable, int32_t fd)
|
|
|
cb8e9e |
return;
|
|
|
cb8e9e |
|
|
|
cb8e9e |
if (fdtable == NULL || fd < 0) {
|
|
|
cb8e9e |
- gf_log_callingfn ("fd", GF_LOG_ERROR, "invalid argument");
|
|
|
cb8e9e |
+ gf_msg_callingfn ("fd", GF_LOG_ERROR, EINVAL,
|
|
|
cb8e9e |
+ LG_MSG_INVALID_ARG, "invalid argument");
|
|
|
cb8e9e |
return;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
if (!(fd < fdtable->max_fds)) {
|
|
|
cb8e9e |
- gf_log_callingfn ("fd", GF_LOG_ERROR, "invalid argument");
|
|
|
cb8e9e |
+ gf_msg_callingfn ("fd", GF_LOG_ERROR, EINVAL,
|
|
|
cb8e9e |
+ LG_MSG_INVALID_ARG, "invalid argument");
|
|
|
cb8e9e |
return;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
@@ -354,7 +364,8 @@ gf_fdptr_put (fdtable_t *fdtable, fd_t *fd)
|
|
|
cb8e9e |
int32_t i = 0;
|
|
|
cb8e9e |
|
|
|
cb8e9e |
if ((fdtable == NULL) || (fd == NULL)) {
|
|
|
cb8e9e |
- gf_log_callingfn ("fd", GF_LOG_ERROR, "invalid argument");
|
|
|
cb8e9e |
+ gf_msg_callingfn ("fd", GF_LOG_ERROR, EINVAL,
|
|
|
cb8e9e |
+ LG_MSG_INVALID_ARG, "invalid argument");
|
|
|
cb8e9e |
return;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
@@ -368,8 +379,10 @@ gf_fdptr_put (fdtable_t *fdtable, fd_t *fd)
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
if (fde == NULL) {
|
|
|
cb8e9e |
- gf_log_callingfn ("fd", GF_LOG_WARNING,
|
|
|
cb8e9e |
- "fd (%p) is not present in fdtable", fd);
|
|
|
cb8e9e |
+ gf_msg_callingfn ("fd", GF_LOG_WARNING, 0,
|
|
|
cb8e9e |
+ LG_MSG_FD_NOT_FOUND_IN_FDTABLE,
|
|
|
cb8e9e |
+ "fd (%p) is not present in fdtable",
|
|
|
cb8e9e |
+ fd);
|
|
|
cb8e9e |
goto unlock_out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
@@ -401,13 +414,15 @@ gf_fd_fdptr_get (fdtable_t *fdtable, int64_t fd)
|
|
|
cb8e9e |
fd_t *fdptr = NULL;
|
|
|
cb8e9e |
|
|
|
cb8e9e |
if (fdtable == NULL || fd < 0) {
|
|
|
cb8e9e |
- gf_log_callingfn ("fd", GF_LOG_ERROR, "invalid argument");
|
|
|
cb8e9e |
+ gf_msg_callingfn ("fd", GF_LOG_ERROR, EINVAL,
|
|
|
cb8e9e |
+ LG_MSG_INVALID_ARG, "invalid argument");
|
|
|
cb8e9e |
errno = EINVAL;
|
|
|
cb8e9e |
return NULL;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
if (!(fd < fdtable->max_fds)) {
|
|
|
cb8e9e |
- gf_log_callingfn ("fd", GF_LOG_ERROR, "invalid argument");
|
|
|
cb8e9e |
+ gf_msg_callingfn ("fd", GF_LOG_ERROR, EINVAL,
|
|
|
cb8e9e |
+ LG_MSG_INVALID_ARG, "invalid argument");
|
|
|
cb8e9e |
errno = EINVAL;
|
|
|
cb8e9e |
return NULL;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -440,7 +455,8 @@ fd_ref (fd_t *fd)
|
|
|
cb8e9e |
fd_t *refed_fd = NULL;
|
|
|
cb8e9e |
|
|
|
cb8e9e |
if (!fd) {
|
|
|
cb8e9e |
- gf_log_callingfn ("fd", GF_LOG_ERROR, "null fd");
|
|
|
cb8e9e |
+ gf_msg_callingfn ("fd", GF_LOG_ERROR, EINVAL,
|
|
|
cb8e9e |
+ LG_MSG_INVALID_ARG, "null fd");
|
|
|
cb8e9e |
return NULL;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
@@ -475,12 +491,15 @@ fd_destroy (fd_t *fd)
|
|
|
cb8e9e |
xlator_t *old_THIS = NULL;
|
|
|
cb8e9e |
|
|
|
cb8e9e |
if (fd == NULL){
|
|
|
cb8e9e |
- gf_log_callingfn ("xlator", GF_LOG_ERROR, "invalid argument");
|
|
|
cb8e9e |
+ gf_msg_callingfn ("xlator", GF_LOG_ERROR, EINVAL,
|
|
|
cb8e9e |
+ LG_MSG_INVALID_ARG, "invalid argument");
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
if (fd->inode == NULL){
|
|
|
cb8e9e |
- gf_log_callingfn ("xlator", GF_LOG_ERROR, "fd->inode is NULL");
|
|
|
cb8e9e |
+ gf_msg_callingfn ("xlator", GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ LG_MSG_FD_INODE_NULL,
|
|
|
cb8e9e |
+ "fd->inode is NULL");
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
if (!fd->_ctx)
|
|
|
cb8e9e |
@@ -533,7 +552,8 @@ fd_unref (fd_t *fd)
|
|
|
cb8e9e |
int32_t refcount = 0;
|
|
|
cb8e9e |
|
|
|
cb8e9e |
if (!fd) {
|
|
|
cb8e9e |
- gf_log_callingfn ("fd", GF_LOG_ERROR, "fd is NULL");
|
|
|
cb8e9e |
+ gf_msg_callingfn ("fd", GF_LOG_ERROR, EINVAL,
|
|
|
cb8e9e |
+ LG_MSG_INVALID_ARG, "fd is NULL");
|
|
|
cb8e9e |
return;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
@@ -567,7 +587,8 @@ fd_t *
|
|
|
cb8e9e |
fd_bind (fd_t *fd)
|
|
|
cb8e9e |
{
|
|
|
cb8e9e |
if (!fd || !fd->inode) {
|
|
|
cb8e9e |
- gf_log_callingfn ("fd", GF_LOG_ERROR, "!fd || !fd->inode");
|
|
|
cb8e9e |
+ gf_msg_callingfn ("fd", GF_LOG_ERROR, EINVAL,
|
|
|
cb8e9e |
+ LG_MSG_INVALID_ARG, "!fd || !fd->inode");
|
|
|
cb8e9e |
return NULL;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
@@ -587,7 +608,8 @@ __fd_create (inode_t *inode, uint64_t pid)
|
|
|
cb8e9e |
fd_t *fd = NULL;
|
|
|
cb8e9e |
|
|
|
cb8e9e |
if (inode == NULL) {
|
|
|
cb8e9e |
- gf_log_callingfn ("fd", GF_LOG_ERROR, "invalid argument");
|
|
|
cb8e9e |
+ gf_msg_callingfn ("fd", GF_LOG_ERROR, EINVAL,
|
|
|
cb8e9e |
+ LG_MSG_INVALID_ARG, "invalid argument");
|
|
|
cb8e9e |
return NULL;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
@@ -687,7 +709,8 @@ fd_lookup (inode_t *inode, pid_t pid)
|
|
|
cb8e9e |
fd_t *fd = NULL;
|
|
|
cb8e9e |
|
|
|
cb8e9e |
if (!inode) {
|
|
|
cb8e9e |
- gf_log_callingfn ("fd", GF_LOG_WARNING, "!inode");
|
|
|
cb8e9e |
+ gf_msg_callingfn ("fd", GF_LOG_WARNING, EINVAL,
|
|
|
cb8e9e |
+ LG_MSG_INVALID_ARG, "!inode");
|
|
|
cb8e9e |
return NULL;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
@@ -706,7 +729,8 @@ fd_lookup_uint64 (inode_t *inode, uint64_t pid)
|
|
|
cb8e9e |
fd_t *fd = NULL;
|
|
|
cb8e9e |
|
|
|
cb8e9e |
if (!inode) {
|
|
|
cb8e9e |
- gf_log_callingfn ("fd", GF_LOG_WARNING, "!inode");
|
|
|
cb8e9e |
+ gf_msg_callingfn ("fd", GF_LOG_WARNING, EINVAL,
|
|
|
cb8e9e |
+ LG_MSG_INVALID_ARG, "!inode");
|
|
|
cb8e9e |
return NULL;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
@@ -786,7 +810,8 @@ fd_lookup_anonymous (inode_t *inode)
|
|
|
cb8e9e |
fd_t *fd = NULL;
|
|
|
cb8e9e |
|
|
|
cb8e9e |
if (!inode) {
|
|
|
cb8e9e |
- gf_log_callingfn ("fd", GF_LOG_WARNING, "!inode");
|
|
|
cb8e9e |
+ gf_msg_callingfn ("fd", GF_LOG_WARNING, EINVAL,
|
|
|
cb8e9e |
+ LG_MSG_INVALID_ARG, "!inode");
|
|
|
cb8e9e |
return NULL;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
@@ -855,10 +880,6 @@ __fd_ctx_set (fd_t *fd, xlator_t *xlator, uint64_t value)
|
|
|
cb8e9e |
(sizeof (struct _fd_ctx)
|
|
|
cb8e9e |
* new_xl_count));
|
|
|
cb8e9e |
if (tmp == NULL) {
|
|
|
cb8e9e |
- gf_log_callingfn (THIS->name, GF_LOG_WARNING,
|
|
|
cb8e9e |
- "realloc of fd->_ctx for fd "
|
|
|
cb8e9e |
- "(ptr: %p) failed, cannot set the key"
|
|
|
cb8e9e |
- , fd);
|
|
|
cb8e9e |
ret = -1;
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -890,7 +911,8 @@ fd_ctx_set (fd_t *fd, xlator_t *xlator, uint64_t value)
|
|
|
cb8e9e |
int ret = 0;
|
|
|
cb8e9e |
|
|
|
cb8e9e |
if (!fd || !xlator) {
|
|
|
cb8e9e |
- gf_log_callingfn ("", GF_LOG_WARNING, "%p %p", fd, xlator);
|
|
|
cb8e9e |
+ gf_msg_callingfn ("fd", GF_LOG_WARNING, EINVAL,
|
|
|
cb8e9e |
+ LG_MSG_INVALID_ARG, "%p %p", fd, xlator);
|
|
|
cb8e9e |
return -1;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
diff --git a/libglusterfs/src/inode.c b/libglusterfs/src/inode.c
|
|
|
cb8e9e |
index 7d3215e..7b49fbe 100644
|
|
|
cb8e9e |
--- a/libglusterfs/src/inode.c
|
|
|
cb8e9e |
+++ b/libglusterfs/src/inode.c
|
|
|
cb8e9e |
@@ -23,6 +23,7 @@
|
|
|
cb8e9e |
#include "list.h"
|
|
|
cb8e9e |
#include <time.h>
|
|
|
cb8e9e |
#include <assert.h>
|
|
|
cb8e9e |
+#include "libglusterfs-messages.h"
|
|
|
cb8e9e |
|
|
|
cb8e9e |
/* TODO:
|
|
|
cb8e9e |
move latest accessed dentry to list_head of inode
|
|
|
cb8e9e |
@@ -85,7 +86,8 @@ __dentry_hash (dentry_t *dentry)
|
|
|
cb8e9e |
int hash = 0;
|
|
|
cb8e9e |
|
|
|
cb8e9e |
if (!dentry) {
|
|
|
cb8e9e |
- gf_log_callingfn (THIS->name, GF_LOG_WARNING, "dentry not found");
|
|
|
cb8e9e |
+ gf_msg_callingfn (THIS->name, GF_LOG_WARNING, 0,
|
|
|
cb8e9e |
+ LG_MSG_DENTRY_NOT_FOUND, "dentry not found");
|
|
|
cb8e9e |
return;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
@@ -102,7 +104,8 @@ static int
|
|
|
cb8e9e |
__is_dentry_hashed (dentry_t *dentry)
|
|
|
cb8e9e |
{
|
|
|
cb8e9e |
if (!dentry) {
|
|
|
cb8e9e |
- gf_log_callingfn (THIS->name, GF_LOG_WARNING, "dentry not found");
|
|
|
cb8e9e |
+ gf_msg_callingfn (THIS->name, GF_LOG_WARNING, 0,
|
|
|
cb8e9e |
+ LG_MSG_DENTRY_NOT_FOUND, "dentry not found");
|
|
|
cb8e9e |
return 0;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
@@ -114,7 +117,8 @@ static void
|
|
|
cb8e9e |
__dentry_unhash (dentry_t *dentry)
|
|
|
cb8e9e |
{
|
|
|
cb8e9e |
if (!dentry) {
|
|
|
cb8e9e |
- gf_log_callingfn (THIS->name, GF_LOG_WARNING, "dentry not found");
|
|
|
cb8e9e |
+ gf_msg_callingfn (THIS->name, GF_LOG_WARNING, 0,
|
|
|
cb8e9e |
+ LG_MSG_DENTRY_NOT_FOUND, "dentry not found");
|
|
|
cb8e9e |
return;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
@@ -126,7 +130,8 @@ static void
|
|
|
cb8e9e |
__dentry_unset (dentry_t *dentry)
|
|
|
cb8e9e |
{
|
|
|
cb8e9e |
if (!dentry) {
|
|
|
cb8e9e |
- gf_log_callingfn (THIS->name, GF_LOG_WARNING, "dentry not found");
|
|
|
cb8e9e |
+ gf_msg_callingfn (THIS->name, GF_LOG_WARNING, 0,
|
|
|
cb8e9e |
+ LG_MSG_DENTRY_NOT_FOUND, "dentry not found");
|
|
|
cb8e9e |
return;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
@@ -157,19 +162,24 @@ __foreach_ancestor_dentry (dentry_t *dentry,
|
|
|
cb8e9e |
int ret = 0;
|
|
|
cb8e9e |
|
|
|
cb8e9e |
if (!dentry) {
|
|
|
cb8e9e |
- gf_log_callingfn (THIS->name, GF_LOG_WARNING, "dentry not found");
|
|
|
cb8e9e |
+ gf_msg_callingfn (THIS->name, GF_LOG_WARNING, 0,
|
|
|
cb8e9e |
+ LG_MSG_DENTRY_NOT_FOUND, "dentry not found");
|
|
|
cb8e9e |
return 0;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
ret = per_dentry_fn (dentry, data);
|
|
|
cb8e9e |
if (ret) {
|
|
|
cb8e9e |
- gf_log (THIS->name, GF_LOG_WARNING, "per dentry fn returned %d", ret);
|
|
|
cb8e9e |
+ gf_msg (THIS->name, GF_LOG_WARNING, 0,
|
|
|
cb8e9e |
+ LG_MSG_PER_DENTRY_FAILED, "per dentry fn returned %d",
|
|
|
cb8e9e |
+ ret);
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
parent = dentry->parent;
|
|
|
cb8e9e |
if (!parent) {
|
|
|
cb8e9e |
- gf_log (THIS->name, GF_LOG_WARNING, "parent not found");
|
|
|
cb8e9e |
+ gf_msg (THIS->name, GF_LOG_WARNING, 0,
|
|
|
cb8e9e |
+ LG_MSG_PARENT_DENTRY_NOT_FOUND,
|
|
|
cb8e9e |
+ "parent not found");
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
@@ -212,10 +222,10 @@ __is_dentry_cyclic (dentry_t *dentry)
|
|
|
cb8e9e |
if (dentry->name)
|
|
|
cb8e9e |
name = dentry->name;
|
|
|
cb8e9e |
|
|
|
cb8e9e |
- gf_log (dentry->inode->table->name, GF_LOG_CRITICAL,
|
|
|
cb8e9e |
- "detected cyclic loop formation during inode linkage."
|
|
|
cb8e9e |
- " inode (%s) linking under itself as %s",
|
|
|
cb8e9e |
- uuid_utoa (inode->gfid), name);
|
|
|
cb8e9e |
+ gf_msg (dentry->inode->table->name, GF_LOG_CRITICAL, 0,
|
|
|
cb8e9e |
+ LG_MSG_DENTRY_CYCLIC_LOOP, "detected cyclic loop "
|
|
|
cb8e9e |
+ "formation during inode linkage. inode (%s) linking "
|
|
|
cb8e9e |
+ "under itself as %s", uuid_utoa (inode->gfid), name);
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
return ret;
|
|
|
cb8e9e |
@@ -226,7 +236,8 @@ static void
|
|
|
cb8e9e |
__inode_unhash (inode_t *inode)
|
|
|
cb8e9e |
{
|
|
|
cb8e9e |
if (!inode) {
|
|
|
cb8e9e |
- gf_log_callingfn (THIS->name, GF_LOG_WARNING, "inode not found");
|
|
|
cb8e9e |
+ gf_msg_callingfn (THIS->name, GF_LOG_WARNING, 0,
|
|
|
cb8e9e |
+ LG_MSG_INODE_NOT_FOUND, "inode not found");
|
|
|
cb8e9e |
return;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
@@ -238,7 +249,8 @@ static int
|
|
|
cb8e9e |
__is_inode_hashed (inode_t *inode)
|
|
|
cb8e9e |
{
|
|
|
cb8e9e |
if (!inode) {
|
|
|
cb8e9e |
- gf_log_callingfn (THIS->name, GF_LOG_WARNING, "inode not found");
|
|
|
cb8e9e |
+ gf_msg_callingfn (THIS->name, GF_LOG_WARNING, 0,
|
|
|
cb8e9e |
+ LG_MSG_INODE_NOT_FOUND, "inode not found");
|
|
|
cb8e9e |
return 0;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
@@ -253,7 +265,8 @@ __inode_hash (inode_t *inode)
|
|
|
cb8e9e |
int hash = 0;
|
|
|
cb8e9e |
|
|
|
cb8e9e |
if (!inode) {
|
|
|
cb8e9e |
- gf_log_callingfn (THIS->name, GF_LOG_WARNING, "inode not found");
|
|
|
cb8e9e |
+ gf_msg_callingfn (THIS->name, GF_LOG_WARNING, 0,
|
|
|
cb8e9e |
+ LG_MSG_INODE_NOT_FOUND, "inode not found");
|
|
|
cb8e9e |
return;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
@@ -272,7 +285,9 @@ __dentry_search_for_inode (inode_t *inode, uuid_t pargfid, const char *name)
|
|
|
cb8e9e |
dentry_t *tmp = NULL;
|
|
|
cb8e9e |
|
|
|
cb8e9e |
if (!inode || !name) {
|
|
|
cb8e9e |
- gf_log_callingfn (THIS->name, GF_LOG_WARNING, "inode || name not found");
|
|
|
cb8e9e |
+ gf_msg_callingfn (THIS->name, GF_LOG_WARNING, EINVAL,
|
|
|
cb8e9e |
+ LG_MSG_INVALID_ARG,
|
|
|
cb8e9e |
+ "inode || name not found");
|
|
|
cb8e9e |
return NULL;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
@@ -302,12 +317,14 @@ __inode_ctx_free (inode_t *inode)
|
|
|
cb8e9e |
xlator_t *old_THIS = NULL;
|
|
|
cb8e9e |
|
|
|
cb8e9e |
if (!inode) {
|
|
|
cb8e9e |
- gf_log_callingfn (THIS->name, GF_LOG_WARNING, "inode not found");
|
|
|
cb8e9e |
+ gf_msg_callingfn (THIS->name, GF_LOG_WARNING, 0,
|
|
|
cb8e9e |
+ LG_MSG_INODE_NOT_FOUND, "inode not found");
|
|
|
cb8e9e |
return;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
if (!inode->_ctx) {
|
|
|
cb8e9e |
- gf_log (THIS->name, GF_LOG_WARNING, "_ctx not found");
|
|
|
cb8e9e |
+ gf_msg (THIS->name, GF_LOG_WARNING, 0, LG_MSG_CTX_NULL,
|
|
|
cb8e9e |
+ "_ctx not found");
|
|
|
cb8e9e |
goto noctx;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
@@ -333,7 +350,8 @@ static void
|
|
|
cb8e9e |
__inode_destroy (inode_t *inode)
|
|
|
cb8e9e |
{
|
|
|
cb8e9e |
if (!inode) {
|
|
|
cb8e9e |
- gf_log_callingfn (THIS->name, GF_LOG_WARNING, "inode not found");
|
|
|
cb8e9e |
+ gf_msg_callingfn (THIS->name, GF_LOG_WARNING, 0,
|
|
|
cb8e9e |
+ LG_MSG_INODE_NOT_FOUND, "inode not found");
|
|
|
cb8e9e |
return;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
@@ -352,12 +370,14 @@ inode_ctx_merge (fd_t *fd, inode_t *inode, inode_t *linked_inode)
|
|
|
cb8e9e |
xlator_t *old_THIS = NULL;
|
|
|
cb8e9e |
|
|
|
cb8e9e |
if (!fd || !inode || !linked_inode) {
|
|
|
cb8e9e |
- gf_log_callingfn (THIS->name, GF_LOG_WARNING, "invalid inode");
|
|
|
cb8e9e |
+ gf_msg_callingfn (THIS->name, GF_LOG_WARNING, EINVAL,
|
|
|
cb8e9e |
+ LG_MSG_INVALID_ARG, "invalid inode");
|
|
|
cb8e9e |
return;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
if (!inode->_ctx || !linked_inode->_ctx) {
|
|
|
cb8e9e |
- gf_log_callingfn (THIS->name, GF_LOG_WARNING,
|
|
|
cb8e9e |
+ gf_msg_callingfn (THIS->name, GF_LOG_WARNING, EINVAL,
|
|
|
cb8e9e |
+ LG_MSG_INVALID_ARG,
|
|
|
cb8e9e |
"invalid inode context");
|
|
|
cb8e9e |
return;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -394,7 +414,8 @@ __inode_passivate (inode_t *inode)
|
|
|
cb8e9e |
dentry_t *t = NULL;
|
|
|
cb8e9e |
|
|
|
cb8e9e |
if (!inode) {
|
|
|
cb8e9e |
- gf_log_callingfn (THIS->name, GF_LOG_WARNING, "inode not found");
|
|
|
cb8e9e |
+ gf_msg_callingfn (THIS->name, GF_LOG_WARNING, 0,
|
|
|
cb8e9e |
+ LG_MSG_INODE_NOT_FOUND, "inode not found");
|
|
|
cb8e9e |
return;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
@@ -415,7 +436,8 @@ __inode_retire (inode_t *inode)
|
|
|
cb8e9e |
dentry_t *t = NULL;
|
|
|
cb8e9e |
|
|
|
cb8e9e |
if (!inode) {
|
|
|
cb8e9e |
- gf_log_callingfn (THIS->name, GF_LOG_WARNING, "inode not found");
|
|
|
cb8e9e |
+ gf_msg_callingfn (THIS->name, GF_LOG_WARNING, 0,
|
|
|
cb8e9e |
+ LG_MSG_INODE_NOT_FOUND, "inode not found");
|
|
|
cb8e9e |
return;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
@@ -536,7 +558,8 @@ __dentry_create (inode_t *inode, inode_t *parent, const char *name)
|
|
|
cb8e9e |
dentry_t *newd = NULL;
|
|
|
cb8e9e |
|
|
|
cb8e9e |
if (!inode || !parent || !name) {
|
|
|
cb8e9e |
- gf_log_callingfn (THIS->name, GF_LOG_WARNING,
|
|
|
cb8e9e |
+ gf_msg_callingfn (THIS->name, GF_LOG_WARNING, EINVAL,
|
|
|
cb8e9e |
+ LG_MSG_INVALID_ARG,
|
|
|
cb8e9e |
"inode || parent || name not found");
|
|
|
cb8e9e |
return NULL;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -573,7 +596,9 @@ __inode_create (inode_table_t *table)
|
|
|
cb8e9e |
inode_t *newi = NULL;
|
|
|
cb8e9e |
|
|
|
cb8e9e |
if (!table) {
|
|
|
cb8e9e |
- gf_log_callingfn (THIS->name, GF_LOG_WARNING, "table not found");
|
|
|
cb8e9e |
+ gf_msg_callingfn (THIS->name, GF_LOG_WARNING, 0,
|
|
|
cb8e9e |
+ LG_MSG_INODE_TABLE_NOT_FOUND, "table not "
|
|
|
cb8e9e |
+ "found");
|
|
|
cb8e9e |
return NULL;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
@@ -616,7 +641,9 @@ inode_new (inode_table_t *table)
|
|
|
cb8e9e |
inode_t *inode = NULL;
|
|
|
cb8e9e |
|
|
|
cb8e9e |
if (!table) {
|
|
|
cb8e9e |
- gf_log_callingfn (THIS->name, GF_LOG_WARNING, "inode not found");
|
|
|
cb8e9e |
+ gf_msg_callingfn (THIS->name, GF_LOG_WARNING, 0,
|
|
|
cb8e9e |
+ LG_MSG_INODE_TABLE_NOT_FOUND, "inode not "
|
|
|
cb8e9e |
+ "found");
|
|
|
cb8e9e |
return NULL;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
@@ -727,8 +754,9 @@ inode_grep (inode_table_t *table, inode_t *parent, const char *name)
|
|
|
cb8e9e |
dentry_t *dentry = NULL;
|
|
|
cb8e9e |
|
|
|
cb8e9e |
if (!table || !parent || !name) {
|
|
|
cb8e9e |
- gf_log_callingfn (THIS->name, GF_LOG_WARNING,
|
|
|
cb8e9e |
- "table || parent || name not found");
|
|
|
cb8e9e |
+ gf_msg_callingfn (THIS->name, GF_LOG_WARNING, EINVAL,
|
|
|
cb8e9e |
+ LG_MSG_INVALID_ARG, "table || parent || name"
|
|
|
cb8e9e |
+ " not found");
|
|
|
cb8e9e |
return NULL;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
@@ -800,8 +828,9 @@ inode_grep_for_gfid (inode_table_t *table, inode_t *parent, const char *name,
|
|
|
cb8e9e |
int ret = -1;
|
|
|
cb8e9e |
|
|
|
cb8e9e |
if (!table || !parent || !name) {
|
|
|
cb8e9e |
- gf_log_callingfn (THIS->name, GF_LOG_WARNING,
|
|
|
cb8e9e |
- "table || parent || name not found");
|
|
|
cb8e9e |
+ gf_msg_callingfn (THIS->name, GF_LOG_WARNING, EINVAL,
|
|
|
cb8e9e |
+ LG_MSG_INVALID_ARG, "table || parent || name"
|
|
|
cb8e9e |
+ " not found");
|
|
|
cb8e9e |
return ret;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
@@ -848,7 +877,9 @@ __inode_find (inode_table_t *table, uuid_t gfid)
|
|
|
cb8e9e |
int hash = 0;
|
|
|
cb8e9e |
|
|
|
cb8e9e |
if (!table) {
|
|
|
cb8e9e |
- gf_log_callingfn (THIS->name, GF_LOG_WARNING, "table not found");
|
|
|
cb8e9e |
+ gf_msg_callingfn (THIS->name, GF_LOG_WARNING, 0,
|
|
|
cb8e9e |
+ LG_MSG_INODE_TABLE_NOT_FOUND, "table not "
|
|
|
cb8e9e |
+ "found");
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
@@ -875,7 +906,9 @@ inode_find (inode_table_t *table, uuid_t gfid)
|
|
|
cb8e9e |
inode_t *inode = NULL;
|
|
|
cb8e9e |
|
|
|
cb8e9e |
if (!table) {
|
|
|
cb8e9e |
- gf_log_callingfn (THIS->name, GF_LOG_WARNING, "table not found");
|
|
|
cb8e9e |
+ gf_msg_callingfn (THIS->name, GF_LOG_WARNING, 0,
|
|
|
cb8e9e |
+ LG_MSG_INODE_TABLE_NOT_FOUND, "table not "
|
|
|
cb8e9e |
+ "found");
|
|
|
cb8e9e |
return NULL;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
@@ -976,7 +1009,8 @@ __inode_link (inode_t *inode, inode_t *parent, const char *name,
|
|
|
cb8e9e |
if (!old_dentry || old_dentry->inode != link_inode) {
|
|
|
cb8e9e |
dentry = __dentry_create (link_inode, parent, name);
|
|
|
cb8e9e |
if (!dentry) {
|
|
|
cb8e9e |
- gf_log_callingfn (THIS->name, GF_LOG_ERROR,
|
|
|
cb8e9e |
+ gf_msg_callingfn (THIS->name, GF_LOG_ERROR, 0,
|
|
|
cb8e9e |
+ LG_MSG_DENTRY_CREATE_FAILED,
|
|
|
cb8e9e |
"dentry create failed on "
|
|
|
cb8e9e |
"inode %s with parent %s",
|
|
|
cb8e9e |
uuid_utoa (link_inode->gfid),
|
|
|
cb8e9e |
@@ -1006,7 +1040,8 @@ inode_link (inode_t *inode, inode_t *parent, const char *name,
|
|
|
cb8e9e |
inode_t *linked_inode = NULL;
|
|
|
cb8e9e |
|
|
|
cb8e9e |
if (!inode) {
|
|
|
cb8e9e |
- gf_log_callingfn (THIS->name, GF_LOG_WARNING, "inode not found");
|
|
|
cb8e9e |
+ gf_msg_callingfn (THIS->name, GF_LOG_WARNING, 0,
|
|
|
cb8e9e |
+ LG_MSG_INODE_NOT_FOUND, "inode not found");
|
|
|
cb8e9e |
return NULL;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
@@ -1033,7 +1068,8 @@ inode_lookup (inode_t *inode)
|
|
|
cb8e9e |
inode_table_t *table = NULL;
|
|
|
cb8e9e |
|
|
|
cb8e9e |
if (!inode) {
|
|
|
cb8e9e |
- gf_log_callingfn (THIS->name, GF_LOG_WARNING, "inode not found");
|
|
|
cb8e9e |
+ gf_msg_callingfn (THIS->name, GF_LOG_WARNING, 0,
|
|
|
cb8e9e |
+ LG_MSG_INODE_NOT_FOUND, "inode not found");
|
|
|
cb8e9e |
return -1;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
@@ -1055,7 +1091,8 @@ inode_ref_reduce_by_n (inode_t *inode, uint64_t nref)
|
|
|
cb8e9e |
inode_table_t *table = NULL;
|
|
|
cb8e9e |
|
|
|
cb8e9e |
if (!inode) {
|
|
|
cb8e9e |
- gf_log_callingfn (THIS->name, GF_LOG_WARNING, "inode not found");
|
|
|
cb8e9e |
+ gf_msg_callingfn (THIS->name, GF_LOG_WARNING, 0,
|
|
|
cb8e9e |
+ LG_MSG_INODE_NOT_FOUND, "inode not found");
|
|
|
cb8e9e |
return -1;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
@@ -1079,7 +1116,8 @@ inode_forget (inode_t *inode, uint64_t nlookup)
|
|
|
cb8e9e |
inode_table_t *table = NULL;
|
|
|
cb8e9e |
|
|
|
cb8e9e |
if (!inode) {
|
|
|
cb8e9e |
- gf_log_callingfn (THIS->name, GF_LOG_WARNING, "inode not found");
|
|
|
cb8e9e |
+ gf_msg_callingfn (THIS->name, GF_LOG_WARNING, 0,
|
|
|
cb8e9e |
+ LG_MSG_INODE_NOT_FOUND, "inode not found");
|
|
|
cb8e9e |
return -1;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
@@ -1109,7 +1147,8 @@ inode_invalidate(inode_t *inode)
|
|
|
cb8e9e |
xlator_t *old_THIS = NULL;
|
|
|
cb8e9e |
|
|
|
cb8e9e |
if (!inode) {
|
|
|
cb8e9e |
- gf_log_callingfn(THIS->name, GF_LOG_WARNING, "inode not found");
|
|
|
cb8e9e |
+ gf_msg_callingfn(THIS->name, GF_LOG_WARNING, 0,
|
|
|
cb8e9e |
+ LG_MSG_INODE_NOT_FOUND, "inode not found");
|
|
|
cb8e9e |
return -1;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
@@ -1161,8 +1200,9 @@ __inode_unlink (inode_t *inode, inode_t *parent, const char *name)
|
|
|
cb8e9e |
if (dentry) {
|
|
|
cb8e9e |
__dentry_unset (dentry);
|
|
|
cb8e9e |
} else {
|
|
|
cb8e9e |
- gf_log ("inode", GF_LOG_WARNING, "%s/%s: dentry not "
|
|
|
cb8e9e |
- "found in %s", uuid_utoa_r (parent->gfid, pgfid), name,
|
|
|
cb8e9e |
+ gf_msg ("inode", GF_LOG_WARNING, 0, LG_MSG_DENTRY_NOT_FOUND,
|
|
|
cb8e9e |
+ "%s/%s: dentry not found in %s",
|
|
|
cb8e9e |
+ uuid_utoa_r (parent->gfid, pgfid), name,
|
|
|
cb8e9e |
uuid_utoa_r (inode->gfid, gfid));
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
@@ -1175,7 +1215,8 @@ inode_unlink (inode_t *inode, inode_t *parent, const char *name)
|
|
|
cb8e9e |
inode_table_t *table = NULL;
|
|
|
cb8e9e |
|
|
|
cb8e9e |
if (!inode) {
|
|
|
cb8e9e |
- gf_log_callingfn (THIS->name, GF_LOG_WARNING, "inode not found");
|
|
|
cb8e9e |
+ gf_msg_callingfn (THIS->name, GF_LOG_WARNING, 0,
|
|
|
cb8e9e |
+ LG_MSG_INODE_NOT_FOUND, "inode not found");
|
|
|
cb8e9e |
return;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
@@ -1197,7 +1238,8 @@ inode_rename (inode_table_t *table, inode_t *srcdir, const char *srcname,
|
|
|
cb8e9e |
struct iatt *iatt)
|
|
|
cb8e9e |
{
|
|
|
cb8e9e |
if (!inode) {
|
|
|
cb8e9e |
- gf_log_callingfn (THIS->name, GF_LOG_WARNING, "inode not found");
|
|
|
cb8e9e |
+ gf_msg_callingfn (THIS->name, GF_LOG_WARNING, 0,
|
|
|
cb8e9e |
+ LG_MSG_INODE_NOT_FOUND, "inode not found");
|
|
|
cb8e9e |
return -1;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
@@ -1251,7 +1293,8 @@ inode_parent (inode_t *inode, uuid_t pargfid, const char *name)
|
|
|
cb8e9e |
dentry_t *dentry = NULL;
|
|
|
cb8e9e |
|
|
|
cb8e9e |
if (!inode) {
|
|
|
cb8e9e |
- gf_log_callingfn (THIS->name, GF_LOG_WARNING, "inode not found");
|
|
|
cb8e9e |
+ gf_msg_callingfn (THIS->name, GF_LOG_WARNING, 0,
|
|
|
cb8e9e |
+ LG_MSG_INODE_NOT_FOUND, "inode not found");
|
|
|
cb8e9e |
return NULL;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
@@ -1290,7 +1333,8 @@ __inode_path (inode_t *inode, const char *name, char **bufp)
|
|
|
cb8e9e |
|
|
|
cb8e9e |
if (!inode || gf_uuid_is_null (inode->gfid)) {
|
|
|
cb8e9e |
GF_ASSERT (0);
|
|
|
cb8e9e |
- gf_log_callingfn (THIS->name, GF_LOG_WARNING, "invalid inode");
|
|
|
cb8e9e |
+ gf_msg_callingfn (THIS->name, GF_LOG_WARNING, EINVAL,
|
|
|
cb8e9e |
+ LG_MSG_INVALID_ARG, "invalid inode");
|
|
|
cb8e9e |
return -EINVAL;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
@@ -1303,9 +1347,10 @@ __inode_path (inode_t *inode, const char *name, char **bufp)
|
|
|
cb8e9e |
i ++; /* "/" */
|
|
|
cb8e9e |
i += strlen (trav->name);
|
|
|
cb8e9e |
if (i > PATH_MAX) {
|
|
|
cb8e9e |
- gf_log (table->name, GF_LOG_CRITICAL,
|
|
|
cb8e9e |
- "possible infinite loop detected, "
|
|
|
cb8e9e |
- "forcing break. name=(%s)", name);
|
|
|
cb8e9e |
+ gf_msg (table->name, GF_LOG_CRITICAL, 0,
|
|
|
cb8e9e |
+ LG_MSG_DENTRY_CYCLIC_LOOP, "possible infinite "
|
|
|
cb8e9e |
+ "loop detected, forcing break. name=(%s)",
|
|
|
cb8e9e |
+ name);
|
|
|
cb8e9e |
ret = -ENOENT;
|
|
|
cb8e9e |
goto out;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
@@ -1623,12 +1668,13 @@ inode_table_ctx_free (inode_table_t *table)
|
|
|
cb8e9e |
|
|
|
cb8e9e |
ret = purge_count + lru_count + active_count;
|
|
|
cb8e9e |
itable_size = table->active_size + table->lru_size + table->purge_size;
|
|
|
cb8e9e |
- gf_log_callingfn (this->name, GF_LOG_INFO, "total %d (itable size: %d) "
|
|
|
cb8e9e |
- "inode contexts have been freed (active: %d, "
|
|
|
cb8e9e |
- "(active size: %d), lru: %d, (lru size: %d), "
|
|
|
cb8e9e |
- " purge: %d, (purge size: %d))", ret, itable_size,
|
|
|
cb8e9e |
- active_count, table->active_size, lru_count,
|
|
|
cb8e9e |
- table->lru_size, purge_count, table->purge_size);
|
|
|
cb8e9e |
+ gf_msg_callingfn (this->name, GF_LOG_INFO, 0,
|
|
|
cb8e9e |
+ LG_MSG_INODE_CONTEXT_FREED, "total %d (itable size: "
|
|
|
cb8e9e |
+ "%d) inode contexts have been freed (active: %d, ("
|
|
|
cb8e9e |
+ "active size: %d), lru: %d, (lru size: %d), purge: "
|
|
|
cb8e9e |
+ "%d, (purge size: %d))", ret, itable_size,
|
|
|
cb8e9e |
+ active_count, table->active_size, lru_count,
|
|
|
cb8e9e |
+ table->lru_size, purge_count, table->purge_size);
|
|
|
cb8e9e |
return ret;
|
|
|
cb8e9e |
}
|
|
|
cb8e9e |
|
|
|
cb8e9e |
--
|
|
|
cb8e9e |
1.7.1
|
|
|
cb8e9e |
|