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
This commit is contained in:
Shehjar Tikoo 2010-02-25 15:37:46 +00:00 committed by Anand V. Avati
parent bdf3fc6985
commit 1262b1e4fe

View File

@ -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);