cn = get_journal_hash_dev(p_s_sb, journal->j_hash_table, blocknr); if (cn && cn->bh) { bh = cn->bh ; get_bh(bh) ; } /* if it is journal new, we just remove it from this transaction */ if (bh && buffer_journal_new(bh)) { clear_buffer_journal_new (bh); clear_prepared_bits(bh) ; reiserfs_clean_and_file_buffer(bh) ; cleaned = remove_from_transaction(p_s_sb, blocknr, cleaned) ; } else { /* set the bit for this block in the journal bitmap for this transaction */ jb = journal->j_current_jl->j_list_bitmap; if (!jb) { reiserfs_panic(p_s_sb, "journal-1702: journal_mark_freed, journal_list_bitmap is NULL\n") ; } set_bit_in_list_bitmap(p_s_sb, blocknr, jb) ; 
cn = get_journal_hash_dev(p_s_sb, journal->j_hash_table, blocknr); if (cn && cn->bh) { bh = cn->bh; get_bh(bh); } /* if it is journal new, we just remove it from this transaction */ if (bh && buffer_journal_new(bh)) { clear_buffer_journal_new(bh); clear_prepared_bits(bh); reiserfs_clean_and_file_buffer(bh); cleaned = remove_from_transaction(p_s_sb, blocknr, cleaned); } else { /* set the bit for this block in the journal bitmap for this transaction */ jb = journal->j_current_jl->j_list_bitmap; if (!jb) { reiserfs_panic(p_s_sb, "journal-1702: journal_mark_freed, journal_list_bitmap is NULL\n"); } set_bit_in_list_bitmap(p_s_sb, blocknr, jb); 
int journal_mark_freed(struct reiserfs_transaction_handle *th, struct super_block *p_s_sb, b_blocknr_t blocknr) {  struct reiserfs_journal *journal = SB_JOURNAL (p_s_sb);  struct reiserfs_journal_cnode *cn = NULL ;  struct buffer_head *bh = NULL ;  struct reiserfs_list_bitmap *jb = NULL ;  int cleaned = 0 ;  BUG_ON (!th->t_trans_id);  cn = get_journal_hash_dev(p_s_sb, journal->j_hash_table, blocknr);  if (cn && cn->bh) {      bh = cn->bh ;      get_bh(bh) ;  }  /* if it is journal new, we just remove it from this transaction */  if (bh && buffer_journal_new(bh)) {    clear_buffer_journal_new (bh);    clear_prepared_bits(bh) ;    reiserfs_clean_and_file_buffer(bh) ;    cleaned = remove_from_transaction(p_s_sb, blocknr, cleaned) ;  } else {    /* set the bit for this block in the journal bitmap for this transaction */    jb = journal->j_current_jl->j_list_bitmap;    if (!jb) {      reiserfs_panic(p_s_sb, "journal-1702: journal_mark_freed, journal_list_bitmap is NULL\n") ;    }    set_bit_in_list_bitmap(p_s_sb, blocknr, jb) ;    /* Note, the entire while loop is not allowed to schedule.  */    if (bh) {      clear_prepared_bits(bh) ;      reiserfs_clean_and_file_buffer(bh) ;    }    cleaned = remove_from_transaction(p_s_sb, blocknr, cleaned) ;    /* find all older transactions with this block, make sure they don't try to write it out */    cn = get_journal_hash_dev(p_s_sb,journal->j_list_hash_table,  blocknr) ;    while (cn) {      if (p_s_sb == cn->sb && blocknr == cn->blocknr) {	set_bit(BLOCK_FREED, &cn->state) ;	if (cn->bh) {	  if (!cleaned) {	    /* remove_from_transaction will brelse the buffer if it was 	    ** in the current trans	    */            clear_buffer_journal_dirty (cn->bh);	    clear_buffer_dirty(cn->bh);	    clear_buffer_journal_test(cn->bh);	    cleaned = 1 ;	    put_bh(cn->bh) ;	    if (atomic_read(&(cn->bh->b_count)) < 0) {	      reiserfs_warning (p_s_sb, "journal-2138: cn->bh->b_count < 0");	    }	  }	  if (cn->jlist) { /* since we are clearing the bh, we MUST dec nonzerolen */	    atomic_dec(&(cn->jlist->j_nonzerolen)) ;	  }	  cn->bh = NULL ; 	}       }      cn = cn->hnext ;    }  }  if (bh) {    put_bh(bh) ; /* get_hash grabs the buffer */    if (atomic_read(&(bh->b_count)) < 0) {      reiserfs_warning (p_s_sb, "journal-2165: bh->b_count < 0");    }  }  return 0 ;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/bd4c625c061c2a38568d0add3478f59172455159/journal.c/buggy/fs/reiserfs/journal.c