if ((rsv_copy._rsv_start >= group_first_block + EXT3_BLOCKS_PER_GROUP(sb)) || (rsv_copy._rsv_end < group_first_block)) 
if ((my_rsv->rsv_start >= group_first_block + EXT3_BLOCKS_PER_GROUP(sb)) || (my_rsv->rsv_end < group_first_block)) 
ext3_try_to_allocate_with_rsv(struct super_block *sb, handle_t *handle,			unsigned int group, struct buffer_head *bitmap_bh,			int goal, struct ext3_reserve_window_node * my_rsv,			int *errp){	spinlock_t *rsv_lock;	unsigned long group_first_block;	int ret = 0;	int fatal;	*errp = 0;	/*	 * Make sure we use undo access for the bitmap, because it is critical	 * that we do the frozen_data COW on bitmap buffers in all cases even	 * if the buffer is in BJ_Forget state in the committing transaction.	 */	BUFFER_TRACE(bitmap_bh, "get undo access for new block");	fatal = ext3_journal_get_undo_access(handle, bitmap_bh);	if (fatal) {		*errp = fatal;		return -1;	}	/*	 * we don't deal with reservation when	 * filesystem is mounted without reservation	 * or the file is not a regular file	 * or last attempt to allocate a block with reservation turned on failed	 */	if (my_rsv == NULL ) {		ret = ext3_try_to_allocate(sb, handle, group, bitmap_bh, goal, NULL);		goto out;	}	rsv_lock = &EXT3_SB(sb)->s_rsv_window_lock;	/*	 * goal is a group relative block number (if there is a goal)	 * 0 < goal < EXT3_BLOCKS_PER_GROUP(sb)	 * first block is a filesystem wide block number	 * first block is the block number of the first block in this group	 */	group_first_block = le32_to_cpu(EXT3_SB(sb)->s_es->s_first_data_block) +			group * EXT3_BLOCKS_PER_GROUP(sb);	/*	 * Basically we will allocate a new block from inode's reservation	 * window.	 *	 * We need to allocate a new reservation window, if:	 * a) inode does not have a reservation window; or	 * b) last attempt to allocate a block from existing reservation	 *    failed; or	 * c) we come here with a goal and with a reservation window	 *	 * We do not need to allocate a new reservation window if we come here	 * at the beginning with a goal and the goal is inside the window, or	 * we don't have a goal but already have a reservation window.	 * then we could go to allocate from the reservation window directly.	 */	while (1) {		struct ext3_reserve_window rsv_copy;		rsv_copy._rsv_start = my_rsv->rsv_start;		rsv_copy._rsv_end = my_rsv->rsv_end;		if (rsv_is_empty(&rsv_copy) || (ret < 0) ||			!goal_in_my_reservation(&rsv_copy, goal, group, sb)) {			spin_lock(rsv_lock);			ret = alloc_new_reservation(my_rsv, goal, sb,							group, bitmap_bh);			rsv_copy._rsv_start = my_rsv->rsv_start;			rsv_copy._rsv_end = my_rsv->rsv_end;			spin_unlock(rsv_lock);			if (ret < 0)				break;			/* failed */			if (!goal_in_my_reservation(&rsv_copy, goal, group, sb))				goal = -1;		}		if ((rsv_copy._rsv_start >= group_first_block + EXT3_BLOCKS_PER_GROUP(sb))		    || (rsv_copy._rsv_end < group_first_block))			BUG();		ret = ext3_try_to_allocate(sb, handle, group, bitmap_bh, goal,					   &rsv_copy);		if (ret >= 0) {			my_rsv->rsv_alloc_hit++;			break;				/* succeed */		}	}out:	if (ret >= 0) {		BUFFER_TRACE(bitmap_bh, "journal_dirty_metadata for "					"bitmap block");		fatal = ext3_journal_dirty_metadata(handle, bitmap_bh);		if (fatal) {			*errp = fatal;			return -1;		}		return ret;	}	BUFFER_TRACE(bitmap_bh, "journal_release_buffer");	ext3_journal_release_buffer(handle, bitmap_bh);	return ret;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/21fe3471c3aaa5c489c5d3a4d705291eb7511248/balloc.c/buggy/fs/ext3/balloc.c