Messages in this thread |  | | | Date | Tue, 24 Nov 2009 12:48:30 -0800 | | From | Andrew Morton <> | | Subject | Re: [PATCH] mtd: fix mtd_blkdevs problem with caches on some architectures (2.6.31) |
On Sun, 22 Nov 2009 23:55:39 +0300 Ilya Loginov <isloginov@gmail.com> wrote:
> > > I tried this way from the beginning, and to avoid redefinitions I enclose > > > everything in #if #endif in *.c files. I think it is not very good. > > > So there are two possibilities. > > > > > Ah. I think the first choice is always the best choise. =) > > > In .h: > > > > #if ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE > > extern void rq_flush_dcache_pages(struct request *rq); > > #else > > static inline void bio_flush_dcache_pages(struct bio *bi) > > { > > } > > #endif > > > > In .c: > > > > #if ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE > > void rq_flush_dcache_pages(struct request *rq) > > { > > struct req_iterator iter; > > struct bio_vec* bvec; > > > > rq_for_each_segment(bvec, rq, iter) > > flush_dcache_page(bvec->bv_page); > > } > > EXPORT_SYMBOL(rq_flush_dcache_pages); > > #endif > > This is 2) =) > > Thanks a lot for your help and comments! > > Signed-off-by: Ilya Loginov <isloginov@gmail.com>
Looks good to me, but...
Patch doesn't vaguely apply to linux-next because of arch/sh changes. I was going to fix that but afaict your assertion that sh doesn't implement flush_dcache_page() appears to be untrue in linux-next and a bit of thought is needed there.
Also, please provide a nice chagnelog whcih describes the change, and our reasons for making it.
|  |