summaryrefslogtreecommitdiffstats
path: root/xlators/storage/posix/src/posix.c
diff options
context:
space:
mode:
authorPranith Kumar K <pkarampu@redhat.com>2015-09-23 21:41:55 +0530
committerRaghavendra Bhat <raghavendra@redhat.com>2015-10-01 02:27:24 -0700
commite31eebf0a4026db32c9793563a0ac3815082cddd (patch)
treeefff904be152440537e640149df0fd39e95d4fbd /xlators/storage/posix/src/posix.c
parent3d74cb6e906288154cdb2001dc430734459a029e (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> >(cherry picked from commit 7f33579e8a42eb19e92559a6c3acaeb92b6bb184) Change-Id: I6e0654256e09551ed4763aea4c24e17a2039c405 BUG: 1267149 Signed-off-by: Pranith Kumar K <pkarampu@redhat.com> Reviewed-on: http://review.gluster.org/12249 Tested-by: Gluster Build System <jenkins@build.gluster.com> Tested-by: NetBSD Build System <jenkins@build.gluster.org> Reviewed-by: Raghavendra Bhat <raghavendra@redhat.com>
Diffstat (limited to 'xlators/storage/posix/src/posix.c')
-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 aded216241d..0e22a6346ac 100644
--- a/xlators/storage/posix/src/posix.c
+++ b/xlators/storage/posix/src/posix.c
@@ -5663,24 +5663,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);
@@ -5737,7 +5727,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);
}