From 0cd9ef501d4e938a49da7835d96cec9f72521ecd Mon Sep 17 00:00:00 2001 From: Brian Foster Date: Fri, 25 Jan 2013 17:16:45 -0500 Subject: storage/posix: skip path construction when dentry list is empty This is a minor latency optimization to the readdirp path in storage/posix. During a recursive list, we hit this codepath with an empty list once per high-level directory to read when end of directory is reached. Skip constructing hpath, since we don't do anything with it in this case. BUG: 903175 Change-Id: I98d7c65505205d55575f064b1e982700f1320cc0 Signed-off-by: Brian Foster Reviewed-on: http://review.gluster.org/4432 Tested-by: Gluster Build System Reviewed-by: Anand Avati --- xlators/storage/posix/src/posix.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/xlators/storage/posix/src/posix.c b/xlators/storage/posix/src/posix.c index 7fdf235b7..1a7a2c751 100644 --- a/xlators/storage/posix/src/posix.c +++ b/xlators/storage/posix/src/posix.c @@ -3758,6 +3758,8 @@ posix_readdirp_fill (xlator_t *this, fd_t *fd, gf_dirent_t *entries, dict_t *dic struct iatt stbuf = {0, }; uuid_t gfid; + if (list_empty(&entries->list)) + return 0; itable = fd->inode->table; -- cgit