if (nblocks > journal->j_trans_max) BUG(); 
static int do_journal_begin_r(struct reiserfs_transaction_handle *th, struct super_block * p_s_sb,unsigned long nblocks,int join) {  time_t now = get_seconds() ;  int old_trans_id  ;  struct reiserfs_journal *journal = SB_JOURNAL(p_s_sb);  struct reiserfs_transaction_handle myth;  int sched_count = 0;  int retval;  reiserfs_check_lock_depth(p_s_sb, "journal_begin") ;  PROC_INFO_INC( p_s_sb, journal.journal_being );  /* set here for journal_join */  th->t_refcount = 1;  th->t_super = p_s_sb ;relock:  lock_journal(p_s_sb) ;  if (join != JBEGIN_ABORT && reiserfs_is_journal_aborted (journal)) {    unlock_journal (p_s_sb);    retval = journal->j_errno;    goto out_fail;  }  journal->j_bcount++;  if (test_bit(J_WRITERS_BLOCKED, &journal->j_state)) {    unlock_journal(p_s_sb) ;    reiserfs_wait_on_write_block(p_s_sb) ;    PROC_INFO_INC( p_s_sb, journal.journal_relock_writers );    goto relock ;  }  now = get_seconds();  /* if there is no room in the journal OR  ** if this transaction is too old, and we weren't called joinable, wait for it to finish before beginning   ** we don't sleep if there aren't other writers  */  if ( (!join && journal->j_must_wait > 0) ||     ( !join && (journal->j_len_alloc + nblocks + 2) >= journal->j_max_batch) ||     (!join && atomic_read(&journal->j_wcount) > 0 && journal->j_trans_start_time > 0 &&      (now - journal->j_trans_start_time) > journal->j_max_trans_age) ||     (!join && atomic_read(&journal->j_jlock)) ||     (!join && journal->j_cnode_free < (journal->j_trans_max * 3))) {    old_trans_id = journal->j_trans_id;    unlock_journal(p_s_sb) ; /* allow others to finish this transaction */    if (!join && (journal->j_len_alloc + nblocks + 2) >=        journal->j_max_batch &&	((journal->j_len + nblocks + 2) * 100) < (journal->j_len_alloc * 75))    {	if (atomic_read(&journal->j_wcount) > 10) {	    sched_count++;	    queue_log_writer(p_s_sb);	    goto relock;	}    }    /* don't mess with joining the transaction if all we have to do is     * wait for someone else to do a commit     */    if (atomic_read(&journal->j_jlock)) {	while (journal->j_trans_id == old_trans_id &&	       atomic_read(&journal->j_jlock)) {	    queue_log_writer(p_s_sb);        }	goto relock;    }    retval = journal_join(&myth, p_s_sb, 1) ;    if (retval)        goto out_fail;    /* someone might have ended the transaction while we joined */    if (old_trans_id != journal->j_trans_id) {        retval = do_journal_end(&myth, p_s_sb, 1, 0) ;    } else {        retval = do_journal_end(&myth, p_s_sb, 1, COMMIT_NOW) ;    }    if (retval)        goto out_fail;    PROC_INFO_INC( p_s_sb, journal.journal_relock_wcount );    goto relock ;  }  /* we are the first writer, set trans_id */  if (journal->j_trans_start_time == 0) {    journal->j_trans_start_time = get_seconds();  }  atomic_inc(&(journal->j_wcount)) ;  journal->j_len_alloc += nblocks ;  th->t_blocks_logged = 0 ;  th->t_blocks_allocated = nblocks ;  th->t_trans_id = journal->j_trans_id ;  unlock_journal(p_s_sb) ;  INIT_LIST_HEAD (&th->t_list);  return 0 ;out_fail:  memset (th, 0, sizeof (*th));  /* Re-set th->t_super, so we can properly keep track of how many   * persistent transactions there are. We need to do this so if this   * call is part of a failed restart_transaction, we can free it later */  th->t_super = p_s_sb;  return retval;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/bdd5b29c6bc835dab71148afd5952f9cd278eef1/journal.c/buggy/fs/reiserfs/journal.c