Re: Re: block allocation in ext2fs

From: BenHanokh Gabriel (gabriel@SANgate.com)
Date: Mon May 08 2000 - 10:23:14 EST


hi

i'm not sure that what you wrote answer my question.
what i'm trying to do is ask ext2fs to allocate blocks for me( using
ext2_getblk() ), but ignore the zeros it filled the buffer cache, by
simply disposing the returned buffer head.

i don't won't this buffer head ever writen to the disk, and i wont to
clear this buffer head as not to trash all other processes cache( i'm
alloacting very big files ).

as far as i understand
the call mark_buffer_uptodate( bh ), just used to say that buffer
content is the most recent.
and the release( bh ) is used to get the buffer free, and for this it
will first WRITE its content to the disk.

i think a better soultion will be this sequance of calls

---------------- BEGIN -------------------------
/*
 * alloacte the block, and get a buffer_head mapped to this block
filled with zeros
bh = ext2_getblk(...);

/*
  * now the buffer should never be written to disk
  */
mark_buffer_clean( bh );

/*
  * release the buffer, and append it to the free list
  */
bforget( bh )

------------------ END ----------------------------------

please tell me what you think of this code, did i undersand the buffer
cache mechanism or that i'm making a big mess of it.

please let me know if there is any book or paper covering the buffer
cache issue in linux

THX
/gaby

-
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 : Mon May 15 2000 - 21:00:11 EST