Re: why is pipe_i moved out into i_pipe?

From: Alexander Viro (viro@math.psu.edu)
Date: Sat Jul 01 2000 - 11:56:12 EDT

  • Next message: Andrea Arcangeli: "Re: [PATCH] 2.2.17pre7 VM enhancement Re: I/O performance on 2.4.0-test2"

    On Fri, 30 Jun 2000, Tigran Aivazian wrote:

    > Hi guys,
    >
    > I just noticed that pipefs breaks the old good established tradition of
    > piling stuff unto the union in struct inode like all(most) filesystem do.
    >
    > Surely, this is wrong because:

    It is not.

    > a) if you really don't want to do it the way it was in 2.2.x (inside
    > union) then you should have used u.generic_ip pointer. I don't see
    > inode->u.generic_ip used for something else in pipefs so why was a new
    > field inode->i_pipe invented?

    Because FIFOs exist on normal filesystems and you can't use two fields of
    union at the same time. Thus ->i_pipe is needed for these guys and since
    we are using the same code for named pipes and normal ones...

    2.2.x way is broken. Check what kind of shit umsdos, NFS and HPFS have to
    go through because of that. It happens to work for ext2 and friends by
    accident - for these filesystems first bytes of ->u.foofs_i are unused
    in case of named pipes. It's still an invalid C (simultaneous use of two
    fields in the same union), it leads to ugly kludges in case of filesystems
    that have different layout of fs-specific inode part and it makes
    impossible an out-of-struct-inode allocation of fs-specific part for _all_
    filesystems providing named pipes.

    It had been fixed in 2.3.6. Check the l-k archives - discussion is there.

    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.rutgers.edu
    Please read the FAQ at http://www.tux.org/lkml/



    This archive was generated by hypermail 2b29 : Sat Jul 01 2000 - 11:57:58 EDT