Skip to contentSkip to conversation

misc block cleanups

PATCH In review Christoph Hellwig 2 participants 12 messages Dec 13, 2018 – Dec 14, 2018

Subsystems (2)
lore
Share & tools
lore
#1 lore raw

PATCH 1/7 block: remove bio_set_prio and bio_prio

There is no good reason to not just use the fields directly.

---
 block/blk-core.c              | 2 +-
 block/blk-merge.c             | 2 +-
 drivers/md/bcache/movinggc.c  | 2 +-
 drivers/md/bcache/writeback.c | 2 +-
 include/linux/bio.h           | 3 ---
 5 files changed, 4 insertions(+), 7 deletions(-)
block/blk-core.c +1 -1
index 268d2b8e9843..34619001a5dd 100644
@@ -734,7 +734,7 @@ void blk_init_request_from_bio(struct request *req, struct bio *bio)
 		req->cmd_flags |= REQ_FAILFAST_MASK;
 
 	req->__sector = bio->bi_iter.bi_sector;
-	req->ioprio = bio_prio(bio);
+	req->ioprio = bio->bi_ioprio;
 	req->write_hint = bio->bi_write_hint;
 	blk_rq_bio_prep(req->q, req, bio);
 }
block/blk-merge.c +1 -1
index 9da5629d0887..09591daf4993 100644
@@ -882,7 +882,7 @@ bool blk_rq_merge_ok(struct request *rq, struct bio *bio)
 	if (rq->write_hint != bio->bi_write_hint)
 		return false;
 
-	if (rq->ioprio != bio_prio(bio))
+	if (rq->ioprio != bio->bi_ioprio)
 		return false;
 
 	return true;
drivers/md/bcache/movinggc.c +1 -1
index 7891fb512736..3bc85277e284 100644
@@ -82,7 +82,7 @@ static void moving_init(struct moving_io *io)
 	bio_init(bio, bio->bi_inline_vecs,
 		 DIV_ROUND_UP(KEY_SIZE(&io->w->key), PAGE_SECTORS));
 	bio_get(bio);
-	bio_set_prio(bio, IOPRIO_PRIO_VALUE(IOPRIO_CLASS_IDLE, 0));
+	bio->bi_ioprio = IOPRIO_PRIO_VALUE(IOPRIO_CLASS_IDLE, 0);
 
 	bio->bi_iter.bi_size	= KEY_SIZE(&io->w->key) << 9;
 	bio->bi_private		= &io->cl;
drivers/md/bcache/writeback.c +1 -1
index 73f0efac2b9f..09620652c786 100644
@@ -250,7 +250,7 @@ static void dirty_init(struct keybuf_key *w)
 	bio_init(bio, bio->bi_inline_vecs,
 		 DIV_ROUND_UP(KEY_SIZE(&w->key), PAGE_SECTORS));
 	if (!io->dc->writeback_percent)
-		bio_set_prio(bio, IOPRIO_PRIO_VALUE(IOPRIO_CLASS_IDLE, 0));
+		bio->bi_ioprio = IOPRIO_PRIO_VALUE(IOPRIO_CLASS_IDLE, 0);
 
 	bio->bi_iter.bi_size	= KEY_SIZE(&w->key) << 9;
 	bio->bi_private		= w;
include/linux/bio.h +0 -3
index 7380b094dcca..261b15483c69 100644
@@ -44,9 +44,6 @@
 #define BIO_MAX_PAGES		256
 #endif
 
-#define bio_prio(bio)			(bio)->bi_ioprio
-#define bio_set_prio(bio, prio)		((bio)->bi_ioprio = prio)
-
 #define bio_iter_iovec(bio, iter)				\
 	bvec_iter_bvec((bio)->bi_io_vec, (iter))
 
Signature · 1 line
2.19.2
#2 lore raw

PATCH 2/7 block: remove the bio_phys_segments export

In reply to Christoph Hellwig
---
 block/bio.c       | 3 +--
 block/blk-merge.c | 6 +++++-
 2 files changed, 6 insertions(+), 3 deletions(-)
block/bio.c +1 -2
index 036e3f0cc736..fa1ea2ac66a8 100644
@@ -571,14 +571,13 @@ void bio_put(struct bio *bio)
 }
 EXPORT_SYMBOL(bio_put);
 
-inline int bio_phys_segments(struct request_queue *q, struct bio *bio)
+int bio_phys_segments(struct request_queue *q, struct bio *bio)
 {
 	if (unlikely(!bio_flagged(bio, BIO_SEG_VALID)))
 		blk_recount_segments(q, bio);
 
 	return bio->bi_phys_segments;
 }
-EXPORT_SYMBOL(bio_phys_segments);
 
 /**
  * 	__bio_clone_fast - clone a bio that shares the original bio's biovec
block/blk-merge.c +5 -1
index 09591daf4993..62e97ec92034 100644
@@ -264,7 +264,11 @@ void blk_queue_split(struct request_queue *q, struct bio **bio)
 	}
 
 	/* physical segments can be figured out during splitting */
-	res = split ? split : *bio;
+	if (split) {
+		res = split;
+	} else {
+		res = *bio;
+	}
 	res->bi_phys_segments = nsegs;
 	bio_set_flag(res, BIO_SEG_VALID);
 
Signature · 1 line
2.19.2
maintainer
#3 lore raw

Re: [PATCH 2/7] block: remove the bio_phys_segments export

Quoted 32 lines · Christoph Hellwig
---
 block/bio.c       | 3 +--
 block/blk-merge.c | 6 +++++-
 2 files changed, 6 insertions(+), 3 deletions(-)
block/bio.c +1 -2
index 036e3f0cc736..fa1ea2ac66a8 100644
@@ -571,14 +571,13 @@ void bio_put(struct bio *bio)
 }
 EXPORT_SYMBOL(bio_put);
 
-inline int bio_phys_segments(struct request_queue *q, struct bio *bio)
+int bio_phys_segments(struct request_queue *q, struct bio *bio)
 {
 	if (unlikely(!bio_flagged(bio, BIO_SEG_VALID)))
 		blk_recount_segments(q, bio);
 
 	return bio->bi_phys_segments;
 }
-EXPORT_SYMBOL(bio_phys_segments);
 
 /**
  * 	__bio_clone_fast - clone a bio that shares the original bio's biovec
block/blk-merge.c +0 -0
index 09591daf4993..62e97ec92034 100644
@@ -264,7 +264,11 @@ void blk_queue_split(struct request_queue *q, struct bio **bio)
 	}

block/blk-merge.c void blk_queue_split(struct request_queue *q, struct bio **bio) · line 273

Quoted 10 lines
block/blk-merge.c +5 -1
 
 	/* physical segments can be figured out during splitting */
-	res = split ? split : *bio;
+	if (split) {
+		res = split;
+	} else {
+		res = *bio;
+	}
 	res->bi_phys_segments = nsegs;
 	bio_set_flag(res, BIO_SEG_VALID);

Unrelated hunk in this patch.

Signature · 1 line
Jens Axboe
#4 lore raw

PATCH 3/7 block: remove the blk_recount_segments export

In reply to Christoph Hellwig
---
 block/blk-merge.c | 1 -
 1 file changed, 1 deletion(-)
block/blk-merge.c +0 -1
index 62e97ec92034..ae220312f0e8 100644
@@ -393,7 +393,6 @@ void blk_recount_segments(struct request_queue *q, struct bio *bio)
 
 	bio_set_flag(bio, BIO_SEG_VALID);
 }
-EXPORT_SYMBOL(blk_recount_segments);
 
 static int blk_phys_contig_segment(struct request_queue *q, struct bio *bio,
 				   struct bio *nxt)
Signature · 1 line
2.19.2
#5 lore raw

PATCH 4/7 block: remove the unused bio_iov_iter_get_pages export

In reply to Christoph Hellwig
---
 block/bio.c | 1 -
 1 file changed, 1 deletion(-)
block/bio.c +0 -1
index fa1ea2ac66a8..e9c6f1d6fcbd 100644
@@ -901,7 +901,6 @@ int bio_iov_iter_get_pages(struct bio *bio, struct iov_iter *iter)
 
 	return 0;
 }
-EXPORT_SYMBOL_GPL(bio_iov_iter_get_pages);
 
 static void submit_bio_wait_endio(struct bio *bio)
 {
Signature · 1 line
2.19.2
#6 lore raw

PATCH 5/7 block: remove the unused bio_set_pages_dirty and bio_check_pages_dirty exports

In reply to Christoph Hellwig
---
 block/bio.c | 2 --
 1 file changed, 2 deletions(-)
block/bio.c +0 -2
index e9c6f1d6fcbd..c288b9057042 100644
@@ -1590,7 +1590,6 @@ void bio_set_pages_dirty(struct bio *bio)
 			set_page_dirty_lock(bvec->bv_page);
 	}
 }
-EXPORT_SYMBOL_GPL(bio_set_pages_dirty);
 
 static void bio_release_pages(struct bio *bio)
 {
@@ -1660,7 +1659,6 @@ void bio_check_pages_dirty(struct bio *bio)
 	spin_unlock_irqrestore(&bio_dirty_lock, flags);
 	schedule_work(&bio_dirty_work);
 }
-EXPORT_SYMBOL_GPL(bio_check_pages_dirty);
 
 void update_io_ticks(struct hd_struct *part, unsigned long now)
 {
Signature · 1 line
2.19.2
#7 lore raw

PATCH 6/7 block: remove the bioset_integrity_free export

In reply to Christoph Hellwig
---
 block/bio-integrity.c | 1 -
 1 file changed, 1 deletion(-)
block/bio-integrity.c +0 -1
index 290af497997b..7b30ff5b3af4 100644
@@ -460,7 +460,6 @@ void bioset_integrity_free(struct bio_set *bs)
 	mempool_exit(&bs->bio_integrity_pool);
 	mempool_exit(&bs->bvec_integrity_pool);
 }
-EXPORT_SYMBOL(bioset_integrity_free);
 
 void __init bio_integrity_init(void)
 {
Signature · 1 line
2.19.2
#8 lore raw

PATCH 7/7 block: remove the bio_integrity_advance export

In reply to Christoph Hellwig
---
 block/bio-integrity.c | 1 -
 1 file changed, 1 deletion(-)
block/bio-integrity.c +0 -1
index 7b30ff5b3af4..1b633a3526d4 100644
@@ -390,7 +390,6 @@ void bio_integrity_advance(struct bio *bio, unsigned int bytes_done)
 	bip->bip_iter.bi_sector += bytes_done >> 9;
 	bvec_iter_advance(bip->bip_vec, &bip->bip_iter, bytes);
 }
-EXPORT_SYMBOL(bio_integrity_advance);
 
 /**
  * bio_integrity_trim - Trim integrity vector
Signature · 1 line
2.19.2
maintainer
#9 lore raw
In reply to Christoph Hellwig
Quoted 1 line · Christoph Hellwig

Remove a few pointless helpers and unused exports.

We've got quite a bit of churn this round, do you mind if we push #1 to next round? I'm fine with killing the exports, if they are not used, they should go.

Signature · 1 line
Jens Axboe
#10 lore raw
Quoted 6 lines · Jens Axboe
Quoted 1 line · Christoph Hellwig

Remove a few pointless helpers and unused exports.

We've got quite a bit of churn this round, do you mind if we push #1 to next round? I'm fine with killing the exports, if they are not used, they should go.

Sure, fine with me. Are you going to drop the accidental hunk yourself or should I resend?

maintainer
#11 lore raw
Quoted 10 lines · Christoph Hellwig
Quoted 6 lines · Jens Axboe
Quoted 1 line · Christoph Hellwig

Remove a few pointless helpers and unused exports.

We've got quite a bit of churn this round, do you mind if we push #1 to next round? I'm fine with killing the exports, if they are not used, they should go.

Sure, fine with me. Are you going to drop the accidental hunk yourself or should I resend?

I can drop it.

Signature · 1 line
Jens Axboe