Skip to contentSkip to conversation

Why NFS enforce size limit on readdirplus

DISCUSSION Xin Zhao 2 participants 2 messages Jun 2, 2006 VFS

lore
Share & tools
lore

Xin Zhao

author
#0 lore raw

Maybe this question is a little dumb.

I am wondering why in NFS readdirplus can be used only for directories of size less than 8*PAGE_SIZE, otherwise, it will switch to use normal readdir?

In nfs/inode.c, I noticed the following code:

			    if (nfs_server_capable(inode, NFS_CAP_READDIRPLUS) &&
fattr->size <= NFS_LIMIT_READDIRPLUS)
				    set_bit(NFS_INO_ADVISE_RDPLUS, &NFS_FLAGS(inode));

Can someone kindly explain the reason?

Thanks a lot!

Xin

#1 lore raw
Quoted 6 lines · Xin Zhao

Maybe this question is a little dumb.

I am wondering why in NFS readdirplus can be used only for directories of size less than 8*PAGE_SIZE, otherwise, it will switch to use normal readdir?

Quoted 6 lines

In nfs/inode.c, I noticed the following code:

			    if (nfs_server_capable(inode, NFS_CAP_READDIRPLUS) &&
fattr->size <= NFS_LIMIT_READDIRPLUS)
				    set_bit(NFS_INO_ADVISE_RDPLUS, &NFS_FLAGS(inode));

Can someone kindly explain the reason?

Efficiency: READDIRPLUS requires a lookup for each entry. If there are too many entries, the whole thing gets really really slow...

Cheers,
Trond