/* This function releases all the application virtual buffer physical pages, that were previously locked  */
static int sep_free_dma_pages(struct page **page_array_ptr, unsigned long num_pages, unsigned long dirtyFlag)
/* This function releases all the application virtual buffer physical pages, that were previously locked  */
static int sep_free_dma_pages(struct page **page_array_ptr, unsigned long num_pages, unsigned long dirtyFlag)
{
	unsigned long count;
	if (dirtyFlag) {
		for (count = 0; count < num_pages; count++) {
			if (!PageReserved(page_array_ptr[count]))
				SetPageDirty(page_array_ptr[count]);
			page_cache_release(page_array_ptr[count]);
		}
	} else {
		for (count = 0; count < num_pages; count++)
			page_cache_release(page_array_ptr[count]);
	}
	if (page_array_ptr)
		kfree(page_array_ptr);
	return 0;
}