On Nov 30, 2007, at 5:04 PM, Chris Wedgwood wrote:
On Fri, Nov 30, 2007 at 04:36:25PM -0600, Stephen Lord wrote:
Looks like the readdir is in the bowels of the btree code when
filldir gets called here, there are probably locks on several
buffers in the btree at this point. This will only show up for large
directories I bet.
I see it for fairly small directories. Larger than what you can stuff
into an inode but less than a block (I'm not checking but fairly sure
that's the case).
I told you I did not read any code..... once a directory is out of
and into disk blocks, there will be a lock on the buffer while the
are copied out.
Just rambling, not a single line of code was consulted in writing
Can you explain why the offset is capped and treated in an 'odd way'
+ curr_offset = filp->f_pos;
+ if (curr_offset == 0x7fffffff)
+ offset = 0xffffffff;
+ offset = filp->f_pos;
and later the offset to filldir is masked. Is that some restriction
Too long ago to remember exact reasons. The only thing I do recall is
with glibc readdir code which wanted to remember positions in a dir
backwards. It was translating structures and could end up with more
data from the kernel than would fit in the user buffer. This may have
to do with that and special values used as eof markers in the
and signed 32 bit arguments to lseek. In the original xfs directory
offset of an entry was a 64 bit hash+offset value, that really
when glibc attempted to do math on it.
I also recall that the offsets in the directory fields had different
on different OS's. Sometimes it was the offset of the entry itself,
was the offset of the next entry, that was one of the reasons for the
layer I think.