struct xdr_stream stream;
struct xdr_buf buf;
__be32 *ptr = xdr_page;
+ int status;
+ struct nfs_cache_array *array;
buf.head->iov_base = xdr_page;
buf.head->iov_len = buflen;
xdr_init_decode(&stream, &buf, ptr);
- while (xdr_decode(desc, entry, &stream) == 0) {
+
+ do {
+ status = xdr_decode(desc, entry, &stream);
+ if (status != 0)
+ break;
+
if (nfs_readdir_add_to_array(entry, page) == -1)
break;
if (desc->plus == 1)
nfs_prime_dcache(desc->file->f_path.dentry, entry);
+ } while (!entry->eof);
+
+ if (status == -EBADCOOKIE && entry->eof) {
+ array = nfs_readdir_get_array(page);
+ array->eof_index = array->size - 1;
+ status = 0;
+ nfs_readdir_release_array(page);
}
}