diff options
author | Brian Foster <bfoster@redhat.com> | 2013-01-25 17:16:45 -0500 |
---|---|---|
committer | Anand Avati <avati@redhat.com> | 2013-01-26 11:37:04 -0800 |
commit | 0cd9ef501d4e938a49da7835d96cec9f72521ecd (patch) | |
tree | c4a26f0f3ca2da032ea362fc86f50e091eedea62 /xlators | |
parent | 1939519979b6c4da110f08434fe63d0b03332d52 (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')
-rw-r--r-- | xlators/storage/posix/src/posix.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/xlators/storage/posix/src/posix.c b/xlators/storage/posix/src/posix.c index 7fdf235b799..1a7a2c75123 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; |