/* This is called via ext4_da_writepages() to calulate the total number of credits to reserve to fit a single extent allocation into a single transaction, ext4_da_writpeages() will loop calling this before the block allocation.  */
static int ext4_da_writepages_trans_blocks(struct inode *inode)
/* This is called via ext4_da_writepages() to calulate the total number of credits to reserve to fit a single extent allocation into a single transaction, ext4_da_writpeages() will loop calling this before the block allocation.  */
static int ext4_da_writepages_trans_blocks(struct inode *inode)
{
	int max_blocks = EXT4_I(inode)->i_reserved_data_blocks;
	if (!(EXT4_I(inode)->i_flags & EXT4_EXTENTS_FL) &&
	    (max_blocks > EXT4_MAX_TRANS_DATA))
		max_blocks = EXT4_MAX_TRANS_DATA;
	return ext4_chunk_trans_blocks(inode, max_blocks);
}