/* The default behaviour of sg_alloc_table() is to use these kmalloc/kfree helpers.  */
static struct scatterlist* sg_kmalloc(unsigned int nents, gfp_t gfp_mask)
/* The default behaviour of sg_alloc_table() is to use these kmalloc/kfree helpers.  */
static struct scatterlist* sg_kmalloc(unsigned int nents, gfp_t gfp_mask)
{
	if (nents == SG_MAX_SINGLE_ALLOC)
		return (struct scatterlist *) __get_free_page(gfp_mask);
	else
		return kmalloc(nents * sizeof(struct scatterlist), gfp_mask);
}