From: NeilBrown <neilb@suse.com>
To: Shaohua Li <shli@kernel.org>
Cc: linux-raid@vger.kernel.org
Subject: [md PATCH 03/10] Revert "block: introduce bio_copy_data_partial"
Date: Wed, 05 Apr 2017 14:05:50 +1000 [thread overview]
Message-ID: <149136515062.25893.13013004998471117345.stgit@noble> (raw)
In-Reply-To: <149136485390.25893.1797855041954158826.stgit@noble>
This reverts commit 6f8802852f7e58a12177a86179803b9efaad98e2.
bio_copy_data_partial() is no longer needed.
Signed-off-by: NeilBrown <neilb@suse.com>
---
block/bio.c | 60 +++++++++++----------------------------------------
include/linux/bio.h | 2 --
2 files changed, 13 insertions(+), 49 deletions(-)
diff --git a/block/bio.c b/block/bio.c
index 036435995c55..12c2837c4277 100644
--- a/block/bio.c
+++ b/block/bio.c
@@ -990,8 +990,19 @@ int bio_alloc_pages(struct bio *bio, gfp_t gfp_mask)
}
EXPORT_SYMBOL(bio_alloc_pages);
-static void __bio_copy_data(struct bio *dst, struct bio *src,
- int offset, int size)
+/**
+ * bio_copy_data - copy contents of data buffers from one chain of bios to
+ * another
+ * @src: source bio list
+ * @dst: destination bio list
+ *
+ * If @src and @dst are single bios, bi_next must be NULL - otherwise, treats
+ * @src and @dst as linked lists of bios.
+ *
+ * Stops when it reaches the end of either @src or @dst - that is, copies
+ * min(src->bi_size, dst->bi_size) bytes (or the equivalent for lists of bios).
+ */
+void bio_copy_data(struct bio *dst, struct bio *src)
{
struct bvec_iter src_iter, dst_iter;
struct bio_vec src_bv, dst_bv;
@@ -1001,12 +1012,6 @@ static void __bio_copy_data(struct bio *dst, struct bio *src,
src_iter = src->bi_iter;
dst_iter = dst->bi_iter;
- /* for supporting partial copy */
- if (offset || size != src->bi_iter.bi_size) {
- bio_advance_iter(src, &src_iter, offset);
- src_iter.bi_size = size;
- }
-
while (1) {
if (!src_iter.bi_size) {
src = src->bi_next;
@@ -1043,47 +1048,8 @@ static void __bio_copy_data(struct bio *dst, struct bio *src,
bio_advance_iter(dst, &dst_iter, bytes);
}
}
-
-/**
- * bio_copy_data - copy contents of data buffers from one chain of bios to
- * another
- * @src: source bio list
- * @dst: destination bio list
- *
- * If @src and @dst are single bios, bi_next must be NULL - otherwise, treats
- * @src and @dst as linked lists of bios.
- *
- * Stops when it reaches the end of either @src or @dst - that is, copies
- * min(src->bi_size, dst->bi_size) bytes (or the equivalent for lists of bios).
- */
-void bio_copy_data(struct bio *dst, struct bio *src)
-{
- __bio_copy_data(dst, src, 0, src->bi_iter.bi_size);
-}
EXPORT_SYMBOL(bio_copy_data);
-/**
- * bio_copy_data_partial - copy partial contents of data buffers from one
- * chain of bios to another
- * @dst: destination bio list
- * @src: source bio list
- * @offset: starting copy from the offset
- * @size: how many bytes to copy
- *
- * If @src and @dst are single bios, bi_next must be NULL - otherwise, treats
- * @src and @dst as linked lists of bios.
- *
- * Stops when it reaches the end of either @src or @dst - that is, copies
- * min(src->bi_size, dst->bi_size) bytes (or the equivalent for lists of bios).
- */
-void bio_copy_data_partial(struct bio *dst, struct bio *src,
- int offset, int size)
-{
- __bio_copy_data(dst, src, offset, size);
-
-}
-EXPORT_SYMBOL(bio_copy_data_partial);
-
struct bio_map_data {
int is_our_pages;
struct iov_iter iter;
diff --git a/include/linux/bio.h b/include/linux/bio.h
index fafef6343d1b..7cf8a6c70a3f 100644
--- a/include/linux/bio.h
+++ b/include/linux/bio.h
@@ -461,8 +461,6 @@ static inline void bio_flush_dcache_pages(struct bio *bi)
#endif
extern void bio_copy_data(struct bio *dst, struct bio *src);
-extern void bio_copy_data_partial(struct bio *dst, struct bio *src,
- int offset, int size);
extern int bio_alloc_pages(struct bio *bio, gfp_t gfp);
extern void bio_free_pages(struct bio *bio);
next prev parent reply other threads:[~2017-04-05 4:05 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-04-05 4:05 [md PATCH 00/10] Simplify bio splitting and related code NeilBrown
2017-04-05 4:05 ` [md PATCH 04/10] md/raid1: simplify handle_read_error() NeilBrown
2017-04-05 4:05 ` [md PATCH 01/10] md/raid1: simplify the splitting of requests NeilBrown
2017-04-05 4:05 ` NeilBrown [this message]
2017-04-05 4:05 ` [md PATCH 02/10] md/raid1: simplify alloc_behind_master_bio() NeilBrown
2017-04-05 4:05 ` [md PATCH 09/10] md/linear: improve bio splitting NeilBrown
2017-04-05 4:05 ` [md PATCH 07/10] md/raid10: simplify handle_read_error() NeilBrown
2017-04-05 4:05 ` [md PATCH 06/10] md/raid10: simplify the splitting of requests NeilBrown
2017-04-05 4:05 ` [md PATCH 05/10] md/raid1: factor out flush_bio_list() NeilBrown
2017-04-05 4:05 ` [md PATCH 10/10] md/raid0: fix up bio splitting NeilBrown
2017-04-05 4:05 ` [md PATCH 08/10] md/raid5: make chunk_aligned_read() split bios more cleanly NeilBrown
2017-04-05 22:15 ` kbuild test robot
2017-04-06 0:13 ` NeilBrown
2017-04-11 17:01 ` [md PATCH 00/10] Simplify bio splitting and related code Shaohua Li
2017-04-11 23:27 ` NeilBrown
2017-04-12 2:51 ` Shaohua Li
2017-04-20 1:37 ` NeilBrown
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=149136515062.25893.13013004998471117345.stgit@noble \
--to=neilb@suse.com \
--cc=linux-raid@vger.kernel.org \
--cc=shli@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