lkml.org 
[lkml]   [2005]   [Jul]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH] ramfs: pretend dirent sizes
    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 majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

    \
     
     \ /
      Last update: 2005-07-20 20:27    [W:0.033 / U:33.228 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site