Subject: dircount & maxcount

From: Peter Åstrand <[email-masked]>
Date: Fri, 2 Nov 2001 20:13:44 +0100 (CET)

I have some questions about the dircount and maxcount parameters to the 
READDIR operation. 

1) About dircount: Since this is only a hint, the server can return both
more and less data, right? But what actually is the dircount parameter
representing: Is it the length of all returned entry4 structs? 3010 says
"the length of the names of the directory entries and the cookie value for
these entries", but what about the attribute data? (Btw, shouldn't it be 
"cookie valueS"?)

2) About maxcount: 3010 says "The maxcount value of the argument is the
maximum number of bytes for the result." What is "result" in this context? 
Is it:

a) The result for the entire COMPOUND procedure?
b) READDIR4res
c) something else

-- 
Peter Åstrand                Telephone: +46-13-29 08 61
Cendio Systems               E-mail: [email-masked]
Teknikringen 3
583 30 Linköping

---

From: "Kendrick M. Smith" <[email-masked]>
Date: Fri, 2 Nov 2001 15:37:32 -0500 (EST)

i'll answer your questions based on what i assumed when working on the
linux implementation:

> these entries", but what about the attribute data? (Btw, shouldn't it be

i was never a big fan of this field.
the linux server totally ignores it; the linux client sets it to some
nominal value derived from maxcount (maxcount divided by 16, i think).

> a) The result for the entire COMPOUND procedure?

my interpretation was (b).  in fact, if the READDIR4res consists of more
than maxcount bytes, the linux client might return -EIO for the entire
readdir() system call.

---

From: Spencer Shepler <[email-masked]>
Date: Fri, 2 Nov 2001 14:51:43 -0600

> more and less data, right? But what actually is the dircount parameter

Yes.

> these entries", but what about the attribute data? (Btw, shouldn't it be 

The IMPLEMENTATION section for READDIR provides additional context.
The answer is that dircount represents only the directory entries and
the associated cookieS (as you point out that should be corrected).

The client would typically use this to fulfill an API request for a
buffer filled with directory entries.  From this the client can help
the server provide the appropriate number of entries based on total
encoded size.  Therefore, encoding of the attributes does not count
towards dircount.

> a) The result for the entire COMPOUND procedure?

The right answer is: d) READDIR4resok.  The size without the status
indicator in READDIR4res.

-- 
Spencer

---

From: Spencer Shepler <[email-masked]>
Date: Fri, 2 Nov 2001 14:53:42 -0600

> nominal value derived from maxcount (maxcount divided by 16, i think).

The client might use this to fulfill in one request the request of a
readdir() system call.  Since it is only a hint, the server can do
what it wants.

> than maxcount bytes, the linux client might return -EIO for the entire

So I said READDIR4resok.  Guess it should be more specific. :-)

-- 
Spencer