Re: [PATCH] ramfs: pretend dirent sizes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Chris Wedgwood wrote:

Hos does that work if offset >= m?


Eerrh, did you actually read my patch? The i_size of a directory is increased by SIMPLE_BOGO_DIRENT_SIZE for every entry in the directory.

>>So you can seek to m*<stack-depth>+<offset> to access an offset into
>>> >something at depth m?
>>> >
>>
>> Yes.

I got that one wrong! You can seek to the "sum of i_sizes (of the m directories) + offset" to access offset in the m'th directory/stack-depth.


lseek talks about bytes --- yes, it means for files specifically but I
still don't see why we need to define more counter-intuitive semantics
for directories when we don't need them.

It is counter-intuitive to have a value which is information less, like in the zero case.


Also, how is lseek + readdir supposed to work in general?

This is how libc is reading directories (at least on arch s390x):

getdents() != 0
lseek() to d_off of last dirent
getdents() != 0
lseek() to d_off of last dirent
getdents() == 0
return

Therefore I really need values that make sense for d_off. Therefore I really need values that make (some kind of) sense for i_size.

Jan
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]
  Powered by Linux