<DIV>Hi,</DIV>
<DIV>why is there a window between  statements "err = ext3_journal_get_write_access(handle, this_bh);" and "ext3_journal_dirty_metadata(handle, this_bh);" ?</DIV>
<DIV> </DIV>
<DIV>In my test, there is an error in journal_dirty_metadata: jh is null<BR></DIV>
<DIV>thanks!</DIV>
<DIV>D.Yang</DIV>
<DIV>April 1, 2004</DIV>
<DIV>----------------------------------------------------------------------------------------------------------------------------------</DIV>
<DIV>/**<BR> * ext3_free_data - free a list of data blocks<BR> * @handle: handle for this transaction<BR> * @inode: inode we are dealing with<BR> * @this_bh: indirect buffer_head which contains <A href="mailto:*@first">*@first</A> and <A href="mailto:*@last">*@last</A><BR> * @first: array of block numbers<BR> * @last: points immediately past the end of array<BR> *<BR> * We are freeing all blocks refered from that array (numbers are stored as<BR> * little-endian 32-bit) and updating @inode->i_blocks appropriately.<BR> *<BR> * We accumulate contiguous runs of blocks to free.  Conveniently, if these<BR> * blocks are contiguous then releasing them at one time will only affect one<BR> * or two bitmap blocks (+ group descriptor(s) and superblock) and we won't<BR> * actually use a lot of journal space.<BR> *<BR> * @this_bh will be %NULL if @first and @last point into the!
 inode's
 direct<BR> * block pointers.<BR> */<BR>static void ext3_free_data(handle_t *handle, struct inode *inode,<BR>      struct buffer_head *this_bh, u32 *first, u32 *last)<BR>{<BR> unsigned long block_to_free = 0;    /* Starting block # of a run */<BR> unsigned long count = 0;     /* Number of blocks in the run */ <BR> u32 *block_to_free_p = NULL;     /* Pointer into inode/ind<BR>            corresponding to<BR>            block_to_free */<BR> unsigned long nr;      /* Current block # */<BR> u32 *p;        /* Pointer into inode/ind<BR>            for current block */<BR> int err;</DIV>
<DIV> if (this_bh) {    /* For indirect block */<BR>  BUFFER_TRACE(this_bh, "get_write_access");<BR>  err = ext3_journal_get_write_access(handle, this_bh);<BR>  /* Important: if we can't update the indirect pointers<BR>   * to the blocks, we can't free them. */<BR>  if (err)<BR>   return;<BR> }</DIV>
<DIV> for (p = first; p < last; p++) {<BR>  conditional_schedule();<BR>  nr = le32_to_cpu(*p);<BR>  if (nr) {<BR>   /* accumulate blocks to free if they're contiguous */<BR>   if (count == 0) {<BR>    block_to_free = nr;<BR>    block_to_free_p = p;<BR>    count = 1;<BR>   } else if (nr == block_to_free + count) {<BR>    count++;<BR>   } else {<BR>    ext3_clear_blocks(handle, inode, this_bh, <BR>        block_to_free,<BR>        count, block_to_free_p, p);<BR>    block_to_free = nr;<BR>    block_to_free_p = p;<BR>    count = 1;<BR>   }<BR>  }<BR> }</DIV>
<DIV> if (count > 0)<BR>  ext3_clear_blocks(handle, inode, this_bh, block_to_free,<BR>      count, block_to_free_p, p);</DIV>
<DIV> if (this_bh) {<BR>  BUFFER_TRACE(this_bh, "call ext3_journal_dirty_metadata");<BR>  ext3_journal_dirty_metadata(handle, this_bh);<BR> }<BR>}</DIV><p><hr size=1><font face=arial size=-1>Do you Yahoo!?<br>
<a href="http://us.rd.yahoo.com/evt=23609/*http://promotions.yahoo.com/design_giveaway/static/index2.html">Yahoo! Small Business $15K Web Design Giveaway</a> - Enter today