summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPranith Kumar K <pkarampu@redhat.com>2015-09-23 21:41:55 +0530
committerRaghavendra Bhat <raghavendra@redhat.com>2015-09-28 00:16:55 -0700
commit7f33579e8a42eb19e92559a6c3acaeb92b6bb184 (patch)
tree18a6a1470fcaf40835dc6eb16ff98b5a0a90f708
parent0428a0acf7cfeef6a92065eeca2b8904b0f8a132 (diff)
storage/posix: Prevent extra handle-path
In readdirp_fill we already have the path of the file/directory. No need to construct handle-path again. This saves two lstats and at least two readlink calls per directory. Change-Id: I8d1b2afeda3e053265a243d4e9a101192f5f509e BUG: 1265893 Signed-off-by: Pranith Kumar K <pkarampu@redhat.com> Reviewed-on: http://review.gluster.org/12222 Tested-by: NetBSD Build System <jenkins@build.gluster.org> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Raghavendra Bhat <raghavendra@redhat.com>
-rw-r--r--xlators/storage/posix/src/posix.c14
1 files changed, 2 insertions, 12 deletions
diff --git a/xlators/storage/posix/src/posix.c b/xlators/storage/posix/src/posix.c
index 2f5f2d9c660..c86f8894d69 100644
--- a/xlators/storage/posix/src/posix.c
+++ b/xlators/storage/posix/src/posix.c
@@ -5544,24 +5544,14 @@ out:
dict_t *
posix_entry_xattr_fill (xlator_t *this, inode_t *inode,
- fd_t *fd, char *name, dict_t *dict,
+ fd_t *fd, char *entry_path, dict_t *dict,
struct iatt *stbuf)
{
loc_t tmp_loc = {0,};
- char *entry_path = NULL;
/* if we don't send the 'loc', open-fd-count be a problem. */
tmp_loc.inode = inode;
- MAKE_HANDLE_PATH (entry_path, this, fd->inode->gfid, name);
- if (!entry_path) {
- gf_msg (this->name, GF_LOG_WARNING, 0,
- P_MSG_HANDLE_CREATE,
- "Failed to create handle path for %s/%s",
- uuid_utoa (fd->inode->gfid), name);
-
- return NULL;
- }
return posix_xattr_fill (this, entry_path, &tmp_loc, NULL, -1, dict,
stbuf);
@@ -5618,7 +5608,7 @@ posix_readdirp_fill (xlator_t *this, fd_t *fd, gf_dirent_t *entries, dict_t *dic
if (dict) {
entry->dict =
posix_entry_xattr_fill (this, entry->inode,
- fd, entry->d_name,
+ fd, hpath,
dict, &stbuf);
}