ll_rw_block(WRITE, 1, &tbh); 
ll_rw_block(SWRITE, 1, &tbh); 
static int flush_commit_list(struct super_block *s,			     struct reiserfs_journal_list *jl, int flushall){	int i;	int bn;	struct buffer_head *tbh = NULL;	unsigned long trans_id = jl->j_trans_id;	struct reiserfs_journal *journal = SB_JOURNAL(s);	int barrier = 0;	int retval = 0;	reiserfs_check_lock_depth(s, "flush_commit_list");	if (atomic_read(&jl->j_older_commits_done)) {		return 0;	}	get_fs_excl();	/* before we can put our commit blocks on disk, we have to make sure everyone older than	 ** us is on disk too	 */	BUG_ON(jl->j_len <= 0);	BUG_ON(trans_id == journal->j_trans_id);	get_journal_list(jl);	if (flushall) {		if (flush_older_commits(s, jl) == 1) {			/* list disappeared during flush_older_commits.  return */			goto put_jl;		}	}	/* make sure nobody is trying to flush this one at the same time */	down(&jl->j_commit_lock);	if (!journal_list_still_alive(s, trans_id)) {		up(&jl->j_commit_lock);		goto put_jl;	}	BUG_ON(jl->j_trans_id == 0);	/* this commit is done, exit */	if (atomic_read(&(jl->j_commit_left)) <= 0) {		if (flushall) {			atomic_set(&(jl->j_older_commits_done), 1);		}		up(&jl->j_commit_lock);		goto put_jl;	}	if (!list_empty(&jl->j_bh_list)) {		unlock_kernel();		write_ordered_buffers(&journal->j_dirty_buffers_lock,				      journal, jl, &jl->j_bh_list);		lock_kernel();	}	BUG_ON(!list_empty(&jl->j_bh_list));	/*	 * for the description block and all the log blocks, submit any buffers	 * that haven't already reached the disk	 */	atomic_inc(&journal->j_async_throttle);	for (i = 0; i < (jl->j_len + 1); i++) {		bn = SB_ONDISK_JOURNAL_1st_BLOCK(s) + (jl->j_start + i) %		    SB_ONDISK_JOURNAL_SIZE(s);		tbh = journal_find_get_block(s, bn);		if (buffer_dirty(tbh))	/* redundant, ll_rw_block() checks */			ll_rw_block(WRITE, 1, &tbh);		put_bh(tbh);	}	atomic_dec(&journal->j_async_throttle);	/* wait on everything written so far before writing the commit	 * if we are in barrier mode, send the commit down now	 */	barrier = reiserfs_barrier_flush(s);	if (barrier) {		int ret;		lock_buffer(jl->j_commit_bh);		ret = submit_barrier_buffer(jl->j_commit_bh);		if (ret == -EOPNOTSUPP) {			set_buffer_uptodate(jl->j_commit_bh);			disable_barrier(s);			barrier = 0;		}	}	for (i = 0; i < (jl->j_len + 1); i++) {		bn = SB_ONDISK_JOURNAL_1st_BLOCK(s) +		    (jl->j_start + i) % SB_ONDISK_JOURNAL_SIZE(s);		tbh = journal_find_get_block(s, bn);		wait_on_buffer(tbh);		// since we're using ll_rw_blk above, it might have skipped over		// a locked buffer.  Double check here		//		if (buffer_dirty(tbh))	/* redundant, sync_dirty_buffer() checks */			sync_dirty_buffer(tbh);		if (unlikely(!buffer_uptodate(tbh))) {#ifdef CONFIG_REISERFS_CHECK			reiserfs_warning(s, "journal-601, buffer write failed");#endif			retval = -EIO;		}		put_bh(tbh);	/* once for journal_find_get_block */		put_bh(tbh);	/* once due to original getblk in do_journal_end */		atomic_dec(&(jl->j_commit_left));	}	BUG_ON(atomic_read(&(jl->j_commit_left)) != 1);	if (!barrier) {		if (buffer_dirty(jl->j_commit_bh))			BUG();		mark_buffer_dirty(jl->j_commit_bh);		sync_dirty_buffer(jl->j_commit_bh);	} else		wait_on_buffer(jl->j_commit_bh);	check_barrier_completion(s, jl->j_commit_bh);	/* If there was a write error in the journal - we can't commit this	 * transaction - it will be invalid and, if successful, will just end	 * up propogating the write error out to the filesystem. */	if (unlikely(!buffer_uptodate(jl->j_commit_bh))) {#ifdef CONFIG_REISERFS_CHECK		reiserfs_warning(s, "journal-615: buffer write failed");#endif		retval = -EIO;	}	bforget(jl->j_commit_bh);	if (journal->j_last_commit_id != 0 &&	    (jl->j_trans_id - journal->j_last_commit_id) != 1) {		reiserfs_warning(s, "clm-2200: last commit %lu, current %lu",				 journal->j_last_commit_id, jl->j_trans_id);	}	journal->j_last_commit_id = jl->j_trans_id;	/* now, every commit block is on the disk.  It is safe to allow blocks freed during this transaction to be reallocated */	cleanup_freed_for_journal_list(s, jl);	retval = retval ? retval : journal->j_errno;	/* mark the metadata dirty */	if (!retval)		dirty_one_transaction(s, jl);	atomic_dec(&(jl->j_commit_left));	if (flushall) {		atomic_set(&(jl->j_older_commits_done), 1);	}	up(&jl->j_commit_lock);      put_jl:	put_journal_list(s, jl);	if (retval)		reiserfs_abort(s, retval, "Journal write error in %s",			       __FUNCTION__);	put_fs_excl();	return retval;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/53778ffde601c962ad9250c4998df7de6f428246/journal.c/buggy/fs/reiserfs/journal.c