summaryrefslogtreecommitdiffstats
path: root/xlators/nfs/server/src/nfs3-helpers.c
diff options
context:
space:
mode:
Diffstat (limited to 'xlators/nfs/server/src/nfs3-helpers.c')
-rw-r--r--xlators/nfs/server/src/nfs3-helpers.c104
1 files changed, 58 insertions, 46 deletions
diff --git a/xlators/nfs/server/src/nfs3-helpers.c b/xlators/nfs/server/src/nfs3-helpers.c
index 2670e60c759..2c24f94f540 100644
--- a/xlators/nfs/server/src/nfs3-helpers.c
+++ b/xlators/nfs/server/src/nfs3-helpers.c
@@ -3382,7 +3382,8 @@ nfs3_loglevel (int nfs_op, nfsstat3 stat) {
}
void
-nfs3_log_common_res (uint32_t xid, int op, nfsstat3 stat, int pstat)
+nfs3_log_common_res (uint32_t xid, int op, nfsstat3 stat, int pstat,
+ const char *path)
{
char errstr[1024];
int ll = nfs3_loglevel (op, stat);
@@ -3391,14 +3392,17 @@ nfs3_log_common_res (uint32_t xid, int op, nfsstat3 stat, int pstat)
return;
nfs3_stat_to_errstr (xid, nfs3op_strings[op].str, stat, pstat, errstr, sizeof (errstr));
if (ll == GF_LOG_DEBUG)
- gf_msg_debug (GF_NFS3, 0, "%s", errstr);
+ gf_msg_debug (GF_NFS3, 0, "%s => (%s)", path,
+ errstr);
else
- gf_msg (GF_NFS3, ll, errno, NFS_MSG_STAT_ERROR, "%s", errstr);
+ gf_msg (GF_NFS3, ll, errno, NFS_MSG_STAT_ERROR,
+ "%s => (%s)", path, errstr);
}
void
-nfs3_log_readlink_res (uint32_t xid, nfsstat3 stat, int pstat, char *linkpath)
+nfs3_log_readlink_res (uint32_t xid, nfsstat3 stat, int pstat, char *linkpath,
+ const char *path)
{
char errstr[1024];
int ll = nfs3_loglevel (NFS3_READLINK, stat);
@@ -3408,15 +3412,18 @@ nfs3_log_readlink_res (uint32_t xid, nfsstat3 stat, int pstat, char *linkpath)
nfs3_stat_to_errstr (xid, "READLINK", stat, pstat, errstr, sizeof (errstr));
if (ll == GF_LOG_DEBUG)
- gf_msg_debug (GF_NFS3, 0, "%s, target: %s", errstr, linkpath);
+ gf_msg_debug (GF_NFS3, 0, "%s => (%s), target: %s", path,
+ errstr, linkpath);
else
- gf_msg (GF_NFS3, ll, errno, NFS_MSG_STAT_ERROR, "%s, target: %s",
- errstr, linkpath);
+ gf_msg (GF_NFS3, ll, errno, NFS_MSG_STAT_ERROR,
+ "%s => (%s) target: %s" , path,
+ errstr, linkpath);
}
void
nfs3_log_read_res (uint32_t xid, nfsstat3 stat, int pstat, count3 count,
- int is_eof, struct iovec *vec, int32_t veccount)
+ int is_eof, struct iovec *vec,
+ int32_t veccount, const char *path)
{
char errstr[1024];
int ll = GF_LOG_DEBUG;
@@ -3427,30 +3434,31 @@ nfs3_log_read_res (uint32_t xid, nfsstat3 stat, int pstat, count3 count,
nfs3_stat_to_errstr (xid, "READ", stat, pstat, errstr, sizeof (errstr));
if (vec)
if (ll == GF_LOG_DEBUG)
- gf_msg (GF_NFS3, ll, errno, NFS_MSG_STAT_ERROR,
- "%s, count: %"PRIu32", is_eof:"
- " %d, vector: count: %d, len: %zd", errstr,
- count, is_eof, veccount, vec->iov_len);
- else
gf_msg_debug (GF_NFS3, 0,
- "%s, count: %"PRIu32", is_eof:"
- " %d, vector: count: %d, len: %zd", errstr,
- count, is_eof, veccount, vec->iov_len);
+ "%s => (%s), count: %"PRIu32", is_eof:"
+ " %d, vector: count: %d, len: %zd", path,
+ errstr, count, is_eof, veccount,
+ vec->iov_len);
+ else
+ gf_msg (GF_NFS3, ll, errno, NFS_MSG_STAT_ERROR,
+ "%s => (%s), count: %"PRIu32", is_eof:"
+ " %d, vector: count: %d, len: %zd", path,
+ errstr, count, is_eof, veccount, vec->iov_len);
else
if (ll == GF_LOG_DEBUG)
gf_msg_debug (GF_NFS3, 0,
- "%s, count: %"PRIu32", is_eof:"
- " %d", errstr, count, is_eof);
+ "%s => (%s), count: %"PRIu32", is_eof:"
+ " %d", path, errstr, count, is_eof);
else
gf_msg (GF_NFS3, ll, errno, NFS_MSG_STAT_ERROR,
- "%s, count: %"PRIu32", is_eof:"
- " %d", errstr, count, is_eof);
+ "%s => (%s), count: %"PRIu32", is_eof:"
+ " %d", path, errstr, count, is_eof);
}
void
nfs3_log_write_res (uint32_t xid, nfsstat3 stat, int pstat, count3 count,
- int stable, uint64_t wverf)
+ int stable, uint64_t wverf, const char *path)
{
char errstr[1024];
int ll = nfs3_loglevel (NFS3_WRITE, stat);
@@ -3461,19 +3469,19 @@ nfs3_log_write_res (uint32_t xid, nfsstat3 stat, int pstat, count3 count,
nfs3_stat_to_errstr (xid, "WRITE", stat, pstat, errstr, sizeof (errstr));
if (ll == GF_LOG_DEBUG)
gf_msg_debug (GF_NFS3, 0,
- "%s, count: %"PRIu32", %s,wverf: %"PRIu64
- , errstr, count, (stable == UNSTABLE)?"UNSTABLE":"STABLE",
- wverf);
+ "%s => (%s), count: %"PRIu32", %s,wverf: "
+ "%"PRIu64, path, errstr, count,
+ (stable == UNSTABLE)?"UNSTABLE":"STABLE", wverf);
else
gf_msg (GF_NFS3, ll, errno, NFS_MSG_STAT_ERROR,
- "%s, count: %"PRIu32", %s,wverf: %"PRIu64
- , errstr, count, (stable == UNSTABLE)?"UNSTABLE":"STABLE",
- wverf);
+ "%s => (%s), count: %"PRIu32", %s,wverf: %"PRIu64
+ , path, errstr, count,
+ (stable == UNSTABLE)?"UNSTABLE":"STABLE", wverf);
}
void
nfs3_log_newfh_res (uint32_t xid, int op, nfsstat3 stat, int pstat,
- struct nfs3_fh *newfh)
+ struct nfs3_fh *newfh, const char *path)
{
char errstr[1024];
char fhstr[1024];
@@ -3485,15 +3493,16 @@ nfs3_log_newfh_res (uint32_t xid, int op, nfsstat3 stat, int pstat,
nfs3_fh_to_str (newfh, fhstr, sizeof (fhstr));
if (ll == GF_LOG_DEBUG)
- gf_msg_debug (GF_NFS3, 0, "%s, %s", errstr, fhstr);
+ gf_msg_debug (GF_NFS3, 0, "%s => (%s), %s", path, errstr,
+ fhstr);
else
gf_msg (GF_NFS3, nfs3_loglevel (op, stat), errno, NFS_MSG_STAT_ERROR,
- "%s, %s", errstr, fhstr);
+ "%s => (%s), %s", path, errstr, fhstr);
}
void
nfs3_log_readdir_res (uint32_t xid, nfsstat3 stat, int pstat, uint64_t cverf,
- count3 count, int is_eof)
+ count3 count, int is_eof, const char *path)
{
char errstr[1024];
int ll = nfs3_loglevel (NFS3_READDIR, stat);
@@ -3503,17 +3512,19 @@ nfs3_log_readdir_res (uint32_t xid, nfsstat3 stat, int pstat, uint64_t cverf,
nfs3_stat_to_errstr (xid, "READDIR", stat, pstat, errstr, sizeof (errstr));
if (ll == GF_LOG_DEBUG)
gf_msg_debug (GF_NFS3, 0,
- "%s, count: %"PRIu32", cverf: %"PRIu64
- ", is_eof: %d", errstr, count, cverf, is_eof);
+ "%s => (%s), count: %"PRIu32", cverf: %"PRIu64
+ ", is_eof: %d", path, errstr, count, cverf,
+ is_eof);
else
gf_msg (GF_NFS3, ll, errno, NFS_MSG_STAT_ERROR,
- "%s, count: %"PRIu32", cverf: %"PRIu64
- ", is_eof: %d", errstr, count, cverf, is_eof);
+ "%s => (%s), count: %"PRIu32", cverf: %"PRIu64
+ ", is_eof: %d", path, errstr, count, cverf, is_eof);
}
void
nfs3_log_readdirp_res (uint32_t xid, nfsstat3 stat, int pstat, uint64_t cverf,
- count3 dircount, count3 maxcount, int is_eof)
+ count3 dircount, count3 maxcount, int is_eof,
+ const char *path)
{
char errstr[1024];
int ll = nfs3_loglevel (NFS3_READDIRP, stat);
@@ -3523,19 +3534,20 @@ nfs3_log_readdirp_res (uint32_t xid, nfsstat3 stat, int pstat, uint64_t cverf,
nfs3_stat_to_errstr (xid, "READDIRPLUS", stat, pstat, errstr, sizeof (errstr));
if (ll == GF_LOG_DEBUG)
gf_msg_debug (GF_NFS3, 0,
- "%s, dircount: %"PRIu32", maxcount: %"
- PRIu32", cverf: %"PRIu64", is_eof: %d", errstr, dircount,
- maxcount, cverf, is_eof);
+ "%s => (%s), dircount: %"PRIu32", maxcount: %"
+ PRIu32", cverf: %"PRIu64", is_eof: %d", path,
+ errstr, dircount, maxcount, cverf, is_eof);
else
gf_msg (GF_NFS3, ll, errno, NFS_MSG_STAT_ERROR,
- "%s, dircount: %"PRIu32", maxcount: %"
- PRIu32", cverf: %"PRIu64", is_eof: %d", errstr, dircount,
- maxcount, cverf, is_eof);
+ "%s => (%s), dircount: %"PRIu32", maxcount: %"
+ PRIu32", cverf: %"PRIu64", is_eof: %d", path, errstr,
+ dircount, maxcount, cverf, is_eof);
}
void
-nfs3_log_commit_res (uint32_t xid, nfsstat3 stat, int pstat, uint64_t wverf)
+nfs3_log_commit_res (uint32_t xid, nfsstat3 stat, int pstat, uint64_t wverf,
+ const char *path)
{
char errstr[1024];
int ll = nfs3_loglevel (NFS3_COMMIT, stat);
@@ -3544,11 +3556,11 @@ nfs3_log_commit_res (uint32_t xid, nfsstat3 stat, int pstat, uint64_t wverf)
return;
nfs3_stat_to_errstr (xid, "COMMIT", stat, pstat, errstr, sizeof (errstr));
if (ll == GF_LOG_DEBUG)
- gf_msg_debug (GF_NFS3, 0, "%s, wverf: %"PRIu64,
- errstr, wverf);
+ gf_msg_debug (GF_NFS3, 0, "%s => (%s), wverf: %"PRIu64,
+ path, errstr, wverf);
else
gf_msg (GF_NFS3, ll, errno, NFS_MSG_STAT_ERROR,
- "%s, wverf: %"PRIu64, errstr, wverf);
+ "%s => (%s), wverf: %"PRIu64, path, errstr, wverf);
}