From 1262b1e4fe3fcdfe3f8d6e3c29f41de68cfe8fa3 Mon Sep 17 00:00:00 2001 From: Shehjar Tikoo Date: Thu, 25 Feb 2010 15:37:46 +0000 Subject: 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 Signed-off-by: Anand V. Avati 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 --- xlators/storage/posix/src/posix.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'xlators/storage/posix/src/posix.c') 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); -- cgit