mem_map_reserve(virt_to_page(fb->desc_table.virtual[i])); 
SetPageReserved(virt_to_page(fb->desc_table.virtual[i])); 
static int vino_allocate_buffer(struct vino_framebuffer *fb,				unsigned int size){	unsigned int count, i, j;	int ret = 0;	dprintk("vino_allocate_buffer():\n");	if (size < 1)		return -EINVAL;	memset(fb, 0, sizeof(struct vino_framebuffer));	count = ((size / PAGE_SIZE) + 4) & ~3;	dprintk("vino_allocate_buffer(): size = %d, count = %d\n",		size, count);	/* allocate memory for table with virtual (page) addresses */	fb->desc_table.virtual = (unsigned long *)		kmalloc(count * sizeof(unsigned long), GFP_KERNEL);	if (!fb->desc_table.virtual)		return -ENOMEM;	/* allocate memory for table with dma addresses	 * (has space for four extra descriptors) */	fb->desc_table.dma_cpu =		dma_alloc_coherent(NULL, VINO_PAGE_RATIO * (count + 4) *				   sizeof(dma_addr_t), &fb->desc_table.dma,				   GFP_KERNEL | GFP_DMA);	if (!fb->desc_table.dma_cpu) {		ret = -ENOMEM;		goto out_free_virtual;	}	/* allocate pages for the buffer and acquire the according	 * dma addresses */	for (i = 0; i < count; i++) {		dma_addr_t dma_data_addr;		fb->desc_table.virtual[i] =			get_zeroed_page(GFP_KERNEL | GFP_DMA);		if (!fb->desc_table.virtual[i]) {			ret = -ENOBUFS;			break;		}		dma_data_addr =			dma_map_single(NULL,				       (void *)fb->desc_table.virtual[i],				       PAGE_SIZE, DMA_FROM_DEVICE);		for (j = 0; j < VINO_PAGE_RATIO; j++) {			fb->desc_table.dma_cpu[VINO_PAGE_RATIO * i + j] =				dma_data_addr + VINO_PAGE_SIZE * j;		}		mem_map_reserve(virt_to_page(fb->desc_table.virtual[i]));	}	/* page_count needs to be set anyway, because the descriptor table has	 * been allocated according to this number */	fb->desc_table.page_count = count;	if (ret) {		/* the descriptor with index i doesn't contain		 * a valid address yet */		vino_free_buffer_with_count(fb, i);		return ret;	}	//fb->size = size;	fb->size = count * PAGE_SIZE;	fb->data_format = VINO_DATA_FMT_NONE;	/* set the dma stop-bit for the last (count+1)th descriptor */	fb->desc_table.dma_cpu[VINO_PAGE_RATIO * count] = VINO_DESC_STOP;	return 0; out_free_virtual:	kfree(fb->desc_table.virtual);	return ret;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/a637a114f36b94a1ad8b9867f43bac0414958420/vino.c/buggy/drivers/media/video/vino.c