:                        /*
:                         * If either the dircount or maxcount will be
:                         * exceeded, get out now. Both of these lengths
:                         * are calculated conservatively, including all
:                         * XDR overheads.
:                         */
:                        len += (7 * NFSX_UNSIGNED + nlen + rem + NFSX_V3FH +
:                                NFSX_V3POSTOPATTR);
:                        dirlen += (6 * NFSX_UNSIGNED + nlen + rem);
:                        if (len > cnt || dirlen > fullsiz) {
:                                eofflag = 0;
:                                break;
:                        }
:
:Unfortunately I haven't been able to wrap my brain around how this is
:being counted up for the "len" calculation. Whatever it's doing, it's
:off by 4 bytes. Possibly somebody forgot that "filename3" is a string,
:which in XDR format consists of a string bytes, plus padding to a longword
:boundary, *plus* a longword length value. Some comments would have been
:useful here. (Hint, hint.)
:
:What I don't know is whether or not the calculation for dirlen is
:wrong or not. Hopefully now that I've shown everyone the light, maybe
:somebody can tell me for sure.
:
:-Bill

    I think dirlen is supposed to be a calculation of the size of the 
    struct dirent that the client will eventually synthesize from all
    of this, in order to ensure that the result synthesized by the client
    does not cross a 512 byte boundry.  But if it is, it is being *very*
    conservative.

    I think this may simply be because different clients have different
    structural sizes for struct dirent.  I am guess that the 
    (6 * NFSX_UNSIGNED) is basically a NFS constant.
    
                                        -Matt
                                        Matthew Dillon 
                                        <[EMAIL PROTECTED]>



To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message

Reply via email to