Re: [PATCH] mtd: fix mtd_blkdevs problem with caches on somearchitectures (2.6.31)

From: Andrew Morton
Date: Tue Nov 24 2009 - 15:49:33 EST


On Sun, 22 Nov 2009 23:55:39 +0300
Ilya Loginov <isloginov@xxxxxxxxx> 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@xxxxxxxxx>

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.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/