/* find an available list bitmap. If you can't find one, flush a commit list and try again  */
static struct reiserfs_list_bitmap* get_list_bitmap(struct super_block *sb, struct reiserfs_journal_list *jl)
/* find an available list bitmap. If you can't find one, flush a commit list and try again  */
static struct reiserfs_list_bitmap* get_list_bitmap(struct super_block *sb, struct reiserfs_journal_list *jl)
{
	int i, j;
	struct reiserfs_journal *journal = SB_JOURNAL(sb);
	struct reiserfs_list_bitmap *jb = NULL;
	for (j = 0; j < (JOURNAL_NUM_BITMAPS * 3); j++) {
		i = journal->j_list_bitmap_index;
		journal->j_list_bitmap_index = (i + 1) % JOURNAL_NUM_BITMAPS;
		jb = journal->j_list_bitmap + i;
		if (journal->j_list_bitmap[i].journal_list) {
			flush_commit_list(sb,
					  journal->j_list_bitmap[i].
					  journal_list, 1);
			if (!journal->j_list_bitmap[i].journal_list) {
				break;
			}
		} else {
			break;
		}
	}
	if (jb->journal_list) {
		return NULL;
	}
	jb->journal_list = jl;
	return jb;
}