summaryrefslogtreecommitdiffstats
path: root/xlators/storage
diff options
context:
space:
mode:
authorShehjar Tikoo <shehjart@gluster.com>2010-02-25 15:37:46 +0000
committerAnand V. Avati <avati@dev.gluster.com>2010-03-04 03:12:14 -0800
commit1262b1e4fe3fcdfe3f8d6e3c29f41de68cfe8fa3 (patch)
treee576d13ffb734a574f843ff2f14ac7e2d4619078 /xlators/storage
parentbdf3fc698515b44e6f1a11f6dbc8d9ff4b5fd74e (diff)
posix: Support end-of-stream determination
state, higher translators do not need to perform another readdir to determine end of stream. Instead, if a successful directory read operation is accompanied with an op_errno=ENOENT, it means end-of-stream on the directory fd_t. Signed-off-by: Shehjar Tikoo <shehjart@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 597 (miscellaneous fixes for xlators to work well with NFS xlator) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=597
Diffstat (limited to 'xlators/storage')
-rw-r--r--xlators/storage/posix/src/posix.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/xlators/storage/posix/src/posix.c b/xlators/storage/posix/src/posix.c
index acb0eafd397..dcff1dbe29e 100644
--- a/xlators/storage/posix/src/posix.c
+++ b/xlators/storage/posix/src/posix.c
@@ -4513,6 +4513,9 @@ posix_do_readdir (call_frame_t *frame, xlator_t *this,
}
op_ret = count;
+ errno = 0;
+ if ((!readdir (dir) && (errno == 0)))
+ op_errno = ENOENT;
out:
STACK_UNWIND_STRICT (readdir, frame, op_ret, op_errno, &entries);