/* Returns: 1 if the EA should be stuffed  */
static int ea_calc_size(struct gfs2_sbd *sdp, unsigned int nsize, size_t dsize, unsigned int *size)
/* Returns: 1 if the EA should be stuffed  */
static int ea_calc_size(struct gfs2_sbd *sdp, unsigned int nsize, size_t dsize, unsigned int *size)
{
	unsigned int jbsize = sdp->sd_jbsize;
	*size = ALIGN(sizeof(struct gfs2_ea_header) + nsize + dsize, 8);
	if (*size <= jbsize)
		return 1;
	*size = ALIGN(sizeof(struct gfs2_ea_header) + nsize +
		      (sizeof(__be64) * DIV_ROUND_UP(dsize, jbsize)), 8);
	return 0;
}