lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20091122104816.b6920ede.akpm@linux-foundation.org>
Date:	Sun, 22 Nov 2009 10:48:16 -0800
From:	Andrew Morton <akpm@...ux-foundation.org>
To:	Ilya Loginov <isloginov@...il.com>
Cc:	Ingo Molnar <mingo@...e.hu>, David Woodhouse <dwmw2@...radead.org>,
	linux-kernel@...r.kernel.org, Peter Horton <phorton@...box.co.uk>,
	"Ed L. Cashin" <ecashin@...aid.com>,
	Jens Axboe <jens.axboe@...cle.com>
Subject: Re: [PATCH] mtd: fix mtd_blkdevs problem with caches on some
 architectures (2.6.31)

On Sun, 22 Nov 2009 16:55:21 +0300 Ilya Loginov <isloginov@...il.com> wrote:

> +#ifndef ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE
> +# error	"You should to define ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE for your platform."
> +#endif
> +#if ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE
> +static inline void bio_flush_dcache_pages(struct bio *bi)
> +{
> +	int i;
> +	struct bio_vec* bvec;
> +
> +	bio_for_each_segment(bvec, bi, i)
> +		flush_dcache_page(bvec->bv_page);
> +}
> +#else
> +static inline void bio_flush_dcache_pages(struct bio *bi)
> +{
> +}
> +#endif
> +
>  extern struct bio *bio_copy_user(struct request_queue *, struct rq_map_data *,
>  				 unsigned long, unsigned int, int, gfp_t);
>  extern struct bio *bio_copy_user_iov(struct request_queue *,
> diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
> index 69103e0..9b5214c 100644
> --- a/include/linux/blkdev.h
> +++ b/include/linux/blkdev.h
> @@ -740,6 +740,24 @@ struct req_iterator {
>  #define rq_iter_last(rq, _iter)					\
>  		(_iter.bio->bi_next == NULL && _iter.i == _iter.bio->bi_vcnt-1)
>  
> +#ifndef ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE
> +# error	"You should to define ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE for your platform."
> +#endif
> +#if ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE
> +static inline 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);
> +}
> +#else
> +static inline void rq_flush_dcache_pages(struct request *rq)
> +{
> +}
> +#endif

I don't think the non-stub versions of these should be inlined.  They
will generate quite a lot of code and they're pretty heavyweight. 
Better to implement them in block/ somewhere, and EXPORT_SYMBOL().

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ