/* Description: Allocate and initialize an sg table. If @nents@ is larger than SG_MAX_SINGLE_ALLOC a chained sg table will be setup.  */
int sg_alloc_table(struct sg_table *table, unsigned int nents, gfp_t gfp_mask)
/* Description: Allocate and initialize an sg table. If @nents@ is larger than SG_MAX_SINGLE_ALLOC a chained sg table will be setup.  */
int sg_alloc_table(struct sg_table *table, unsigned int nents, gfp_t gfp_mask)
{
	int ret;
	ret = __sg_alloc_table(table, nents, SG_MAX_SINGLE_ALLOC,
			       gfp_mask, sg_kmalloc);
	if (unlikely(ret))
		__sg_free_table(table, SG_MAX_SINGLE_ALLOC, sg_kfree);
	return ret;
}