X-Git-Url: http://git.vrable.net/?a=blobdiff_plain;f=nfs3%2Fnfs3.c;fp=nfs3%2Fnfs3.c;h=8f15857cecb0bc7cef6e725c7dbaad11187d4059;hb=b0107f8024a860145c8c9c6890d2cd4bf9f74b41;hp=b5dae8075acafbf756d6bb52771bdccbcb0778fa;hpb=072e6a9fa5709b6b5504a19443743b68103ddb1b;p=bluesky.git diff --git a/nfs3/nfs3.c b/nfs3/nfs3.c index b5dae80..8f15857 100644 --- a/nfs3/nfs3.c +++ b/nfs3/nfs3.c @@ -1006,6 +1006,22 @@ void nfsproc3_readdirplus_3_svc(readdirplus3args *argp, RPCRequest *req) * should let multiple inodes be fetched in parallel, instead of * sequentially in the loop that follows. */ i = g_sequence_search(dir->dirents, &start, bluesky_dirent_compare, NULL); + while (count < MAX_READDIR_DIRENTS + && !g_sequence_iter_is_end(i) + && dircount <= argp->dircount + && dircount + attrcount <= argp->maxcount) + { + BlueSkyDirent *d = g_sequence_get(i); + bluesky_inode_prefetch(fs, d->inum); + dircount += 24 + ((strlen(d->name) + 3) & ~3); + attrcount += 88 + 8 + 8; + i = g_sequence_iter_next(i); + } + + i = g_sequence_search(dir->dirents, &start, bluesky_dirent_compare, NULL); + count = 0; + dircount = 88 + 16; + attrcount = 0; while (count < MAX_READDIR_DIRENTS && !g_sequence_iter_is_end(i) && dircount <= argp->dircount