mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@osdl.org>
To: Dave Olien <dmo@osdl.org>
Cc: axboe@suse.de, linux-kernel@vger.kernel.org, agk@sourceware.org,
	dm-devel@redhat.com
Subject: Re: [PATCH] add local bio pool support and modify dm
Date: Wed, 2 Feb 2005 18:19:24 -0800	[thread overview]
Message-ID: <20050202181924.395165fe.akpm@osdl.org> (raw)
In-Reply-To: <20050202064720.GA7436@osdl.org>

Dave Olien <dmo@osdl.org> wrote:
>
>  +extern inline void zero_fill_bio(struct bio *bio)
>  +{
>  +	unsigned long flags;
>  +	struct bio_vec *bv;
>  +	int i;
>  +
>  +	bio_for_each_segment(bv, bio, i) {
>  +		char *data = bvec_kmap_irq(bv, &flags);
>  +		memset(data, 0, bv->bv_len);
>  +		flush_dcache_page(bv->bv_page);
>  +		bvec_kunmap_irq(data, &flags);
>  +	}
>  +}

heavens.  Why was this made inline?  And extern inline?

It's too big for inlining (and is super-slow anyway) and will cause all
sorts of unpleasant header file dependencies for all architectures.  bio.h
now needs to see the implementation of everyone's flush_dcache_page(), for
example.


Something like this?

--- 25/include/linux/bio.h~add-local-bio-pool-support-and-modify-dm-uninline-zero_fill_bio	2005-02-02 18:17:18.225901376 -0800
+++ 25-akpm/include/linux/bio.h	2005-02-02 18:17:18.230900616 -0800
@@ -286,6 +286,7 @@ extern void bio_set_pages_dirty(struct b
 extern void bio_check_pages_dirty(struct bio *bio);
 extern struct bio *bio_copy_user(struct request_queue *, unsigned long, unsigned int, int);
 extern int bio_uncopy_user(struct bio *);
+void zero_fill_bio(struct bio *bio);
 
 #ifdef CONFIG_HIGHMEM
 /*
@@ -335,18 +336,4 @@ extern inline char *__bio_kmap_irq(struc
 	__bio_kmap_irq((bio), (bio)->bi_idx, (flags))
 #define bio_kunmap_irq(buf,flags)	__bio_kunmap_irq(buf, flags)
 
-extern inline void zero_fill_bio(struct bio *bio)
-{
-	unsigned long flags;
-	struct bio_vec *bv;
-	int i;
-
-	bio_for_each_segment(bv, bio, i) {
-		char *data = bvec_kmap_irq(bv, &flags);
-		memset(data, 0, bv->bv_len);
-		flush_dcache_page(bv->bv_page);
-		bvec_kunmap_irq(data, &flags);
-	}
-}
-
 #endif /* __LINUX_BIO_H */
diff -puN fs/bio.c~add-local-bio-pool-support-and-modify-dm-uninline-zero_fill_bio fs/bio.c
--- 25/fs/bio.c~add-local-bio-pool-support-and-modify-dm-uninline-zero_fill_bio	2005-02-02 18:17:18.227901072 -0800
+++ 25-akpm/fs/bio.c	2005-02-02 18:17:18.231900464 -0800
@@ -182,6 +182,21 @@ struct bio *bio_alloc(int gfp_mask, int 
 	return bio_alloc_bioset(gfp_mask, nr_iovecs, fs_bio_set);
 }
 
+void zero_fill_bio(struct bio *bio)
+{
+	unsigned long flags;
+	struct bio_vec *bv;
+	int i;
+
+	bio_for_each_segment(bv, bio, i) {
+		char *data = bvec_kmap_irq(bv, &flags);
+		memset(data, 0, bv->bv_len);
+		flush_dcache_page(bv->bv_page);
+		bvec_kunmap_irq(data, &flags);
+	}
+}
+EXPORT_SYMBOL(zero_fill_bio);
+
 /**
  * bio_put - release a reference to a bio
  * @bio:   bio to release reference to
_


  reply	other threads:[~2005-02-03  2:21 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-02-02  6:47 Dave Olien
2005-02-03  2:19 ` Andrew Morton [this message]
2005-02-03  7:08   ` Jens Axboe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20050202181924.395165fe.akpm@osdl.org \
    --to=akpm@osdl.org \
    --cc=agk@sourceware.org \
    --cc=axboe@suse.de \
    --cc=dm-devel@redhat.com \
    --cc=dmo@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®