From e31eebf0a4026db32c9793563a0ac3815082cddd Mon Sep 17 00:00:00 2001 From: Pranith Kumar K Date: Wed, 23 Sep 2015 21:41:55 +0530 Subject: 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 >Reviewed-on: http://review.gluster.org/12222 >Tested-by: NetBSD Build System >Tested-by: Gluster Build System >Reviewed-by: Raghavendra Bhat >(cherry picked from commit 7f33579e8a42eb19e92559a6c3acaeb92b6bb184) Change-Id: I6e0654256e09551ed4763aea4c24e17a2039c405 BUG: 1267149 Signed-off-by: Pranith Kumar K Reviewed-on: http://review.gluster.org/12249 Tested-by: Gluster Build System Tested-by: NetBSD Build System Reviewed-by: Raghavendra Bhat --- xlators/storage/posix/src/posix.c | 14 ++------------ 1 file 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); } -- cgit