How to allocate few bytes to a file automatically after creating it?

From: Vineet Joglekar (vinzip_at_indiatimes.com)
Date: 05/13/04

  • Next message: Jean-David Beyer: "Re: How to allocate few bytes to a file automatically after creating it?"
    Date: 12 May 2004 19:02:35 -0700
    
    

    My aim is to allocate few bytes to a file; with some valid data in it
    as soon as it is created. Will the following approach work?

    Calling the function ext2_direct_IO() with the appropriate parameters
    after creating a new inode. The appro. parameters are rw flag, inode,
    iobuf, blocknr, blocksize.
    If I want to add just 100 bytes to the file, I guess blocknr should be
    1 and blocksize should be 512 or 1024 .. is that right? Also, how to
    fill in "iobuf" which is of the type "struct kiobuf *" to add these
    100 bytes?

    Please help.. I am trying to work on this problem for a long time now.

    Thanks and regards,

    Vineet


  • Next message: Jean-David Beyer: "Re: How to allocate few bytes to a file automatically after creating it?"

    Relevant Pages