[patch 02/13] jffs2 summary allocation: don't use vmalloc()

Artem Bityutskiy dedekind at infradead.org
Thu Jul 31 01:37:41 EDT 2008


On Wed, 2008-07-30 at 22:10 -0700, David Brownell wrote:
> -	int (*read) (struct mtd_info *mtd, loff_t from, size_t len, size_t *retlen, u_char *buf);
> -	int (*write) (struct mtd_info *mtd, loff_t to, size_t len, size_t *retlen, const u_char *buf);
> +	/*
> +	 * Read/write operations are given *VIRTUAL* addresses, which
> +	 * must not be passed as-is to dma mapping operations.
> +	 */
> +	int (*read) (struct mtd_info *mtd, loff_t from,
> +			size_t len, size_t *retlen, u_char *virt);
> +	int (*write) (struct mtd_info *mtd, loff_t to,
> +			size_t len, size_t *retlen, const u_char *virt);
>  
>  	/* In blackbox flight recorder like scenarios we want to make successful
>  	   writes in interrupt context. panic_write() is only intended to be

Can SPI driver detect if the memory was kmalloc()'ed or vmalloc()'ed? Or
if not, we could add one more argument to read()/write() which tells
whether the memory is contiguous or not. Then the driver would chose how
to deal with the buffer.

-- 
Best regards,
Artem Bityutskiy (Битюцкий Артём)




More information about the linux-mtd mailing list