summaryrefslogtreecommitdiffstats
path: root/xlators/storage/posix/src/posix.c
diff options
context:
space:
mode:
authorBrian Foster <bfoster@redhat.com>2013-01-25 17:16:45 -0500
committerAnand Avati <avati@redhat.com>2013-01-26 11:37:04 -0800
commit0cd9ef501d4e938a49da7835d96cec9f72521ecd (patch)
treec4a26f0f3ca2da032ea362fc86f50e091eedea62 /xlators/storage/posix/src/posix.c
parent1939519979b6c4da110f08434fe63d0b03332d52 (diff)
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 <bfoster@redhat.com> Reviewed-on: http://review.gluster.org/4432 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
Diffstat (limited to 'xlators/storage/posix/src/posix.c')
-rw-r--r--xlators/storage/posix/src/posix.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/xlators/storage/posix/src/posix.c b/xlators/storage/posix/src/posix.c
index 7fdf235b..1a7a2c75 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;