public inbox for linux-block@vger.kernel.org
 help / color / mirror / Atom feed
* misc block cleanups
@ 2018-12-13 20:32 Christoph Hellwig
  2018-12-13 20:32 ` [PATCH 1/7] block: remove bio_set_prio and bio_prio Christoph Hellwig
                   ` (7 more replies)
  0 siblings, 8 replies; 12+ messages in thread
From: Christoph Hellwig @ 2018-12-13 20:32 UTC (permalink / raw)
  To: axboe; +Cc: linux-block

Remove a few pointless helpers and unused exports.



^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH 1/7] block: remove bio_set_prio and bio_prio
  2018-12-13 20:32 misc block cleanups Christoph Hellwig
@ 2018-12-13 20:32 ` Christoph Hellwig
  2018-12-13 20:32 ` [PATCH 2/7] block: remove the bio_phys_segments export Christoph Hellwig
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 12+ messages in thread
From: Christoph Hellwig @ 2018-12-13 20:32 UTC (permalink / raw)
  To: axboe; +Cc: linux-block

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

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 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(-)

diff --git a/block/blk-core.c b/block/blk-core.c
index 268d2b8e9843..34619001a5dd 100644
--- a/block/blk-core.c
+++ b/block/blk-core.c
@@ -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);
 }
diff --git a/block/blk-merge.c b/block/blk-merge.c
index 9da5629d0887..09591daf4993 100644
--- a/block/blk-merge.c
+++ b/block/blk-merge.c
@@ -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;
diff --git a/drivers/md/bcache/movinggc.c b/drivers/md/bcache/movinggc.c
index 7891fb512736..3bc85277e284 100644
--- a/drivers/md/bcache/movinggc.c
+++ b/drivers/md/bcache/movinggc.c
@@ -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;
diff --git a/drivers/md/bcache/writeback.c b/drivers/md/bcache/writeback.c
index 73f0efac2b9f..09620652c786 100644
--- a/drivers/md/bcache/writeback.c
+++ b/drivers/md/bcache/writeback.c
@@ -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;
diff --git a/include/linux/bio.h b/include/linux/bio.h
index 7380b094dcca..261b15483c69 100644
--- a/include/linux/bio.h
+++ b/include/linux/bio.h
@@ -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))
 
-- 
2.19.2


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 2/7] block: remove the bio_phys_segments export
  2018-12-13 20:32 misc block cleanups Christoph Hellwig
  2018-12-13 20:32 ` [PATCH 1/7] block: remove bio_set_prio and bio_prio Christoph Hellwig
@ 2018-12-13 20:32 ` Christoph Hellwig
  2018-12-14  4:27   ` Jens Axboe
  2018-12-13 20:32 ` [PATCH 3/7] block: remove the blk_recount_segments export Christoph Hellwig
                   ` (5 subsequent siblings)
  7 siblings, 1 reply; 12+ messages in thread
From: Christoph Hellwig @ 2018-12-13 20:32 UTC (permalink / raw)
  To: axboe; +Cc: linux-block

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 block/bio.c       | 3 +--
 block/blk-merge.c | 6 +++++-
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/block/bio.c b/block/bio.c
index 036e3f0cc736..fa1ea2ac66a8 100644
--- a/block/bio.c
+++ b/block/bio.c
@@ -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
diff --git a/block/blk-merge.c b/block/blk-merge.c
index 09591daf4993..62e97ec92034 100644
--- a/block/blk-merge.c
+++ b/block/blk-merge.c
@@ -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);
 
-- 
2.19.2


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 3/7] block: remove the blk_recount_segments export
  2018-12-13 20:32 misc block cleanups Christoph Hellwig
  2018-12-13 20:32 ` [PATCH 1/7] block: remove bio_set_prio and bio_prio Christoph Hellwig
  2018-12-13 20:32 ` [PATCH 2/7] block: remove the bio_phys_segments export Christoph Hellwig
@ 2018-12-13 20:32 ` Christoph Hellwig
  2018-12-13 20:32 ` [PATCH 4/7] block: remove the unused bio_iov_iter_get_pages export Christoph Hellwig
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 12+ messages in thread
From: Christoph Hellwig @ 2018-12-13 20:32 UTC (permalink / raw)
  To: axboe; +Cc: linux-block

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 block/blk-merge.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/block/blk-merge.c b/block/blk-merge.c
index 62e97ec92034..ae220312f0e8 100644
--- a/block/blk-merge.c
+++ b/block/blk-merge.c
@@ -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)
-- 
2.19.2


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 4/7] block: remove the unused bio_iov_iter_get_pages export
  2018-12-13 20:32 misc block cleanups Christoph Hellwig
                   ` (2 preceding siblings ...)
  2018-12-13 20:32 ` [PATCH 3/7] block: remove the blk_recount_segments export Christoph Hellwig
@ 2018-12-13 20:32 ` Christoph Hellwig
  2018-12-13 20:32 ` [PATCH 5/7] block: remove the unused bio_set_pages_dirty and bio_check_pages_dirty exports Christoph Hellwig
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 12+ messages in thread
From: Christoph Hellwig @ 2018-12-13 20:32 UTC (permalink / raw)
  To: axboe; +Cc: linux-block

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 block/bio.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/block/bio.c b/block/bio.c
index fa1ea2ac66a8..e9c6f1d6fcbd 100644
--- a/block/bio.c
+++ b/block/bio.c
@@ -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)
 {
-- 
2.19.2


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 5/7] block: remove the unused bio_set_pages_dirty and bio_check_pages_dirty exports
  2018-12-13 20:32 misc block cleanups Christoph Hellwig
                   ` (3 preceding siblings ...)
  2018-12-13 20:32 ` [PATCH 4/7] block: remove the unused bio_iov_iter_get_pages export Christoph Hellwig
@ 2018-12-13 20:32 ` Christoph Hellwig
  2018-12-13 20:32 ` [PATCH 6/7] block: remove the bioset_integrity_free export Christoph Hellwig
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 12+ messages in thread
From: Christoph Hellwig @ 2018-12-13 20:32 UTC (permalink / raw)
  To: axboe; +Cc: linux-block

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 block/bio.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/block/bio.c b/block/bio.c
index e9c6f1d6fcbd..c288b9057042 100644
--- a/block/bio.c
+++ b/block/bio.c
@@ -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)
 {
-- 
2.19.2


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 6/7] block: remove the bioset_integrity_free export
  2018-12-13 20:32 misc block cleanups Christoph Hellwig
                   ` (4 preceding siblings ...)
  2018-12-13 20:32 ` [PATCH 5/7] block: remove the unused bio_set_pages_dirty and bio_check_pages_dirty exports Christoph Hellwig
@ 2018-12-13 20:32 ` Christoph Hellwig
  2018-12-13 20:32 ` [PATCH 7/7] block: remove the bio_integrity_advance export Christoph Hellwig
  2018-12-14  4:28 ` misc block cleanups Jens Axboe
  7 siblings, 0 replies; 12+ messages in thread
From: Christoph Hellwig @ 2018-12-13 20:32 UTC (permalink / raw)
  To: axboe; +Cc: linux-block

Reviewed-by: Christoph Hellwig <hch@lst.de>
---
 block/bio-integrity.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/block/bio-integrity.c b/block/bio-integrity.c
index 290af497997b..7b30ff5b3af4 100644
--- a/block/bio-integrity.c
+++ b/block/bio-integrity.c
@@ -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)
 {
-- 
2.19.2


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 7/7] block: remove the bio_integrity_advance export
  2018-12-13 20:32 misc block cleanups Christoph Hellwig
                   ` (5 preceding siblings ...)
  2018-12-13 20:32 ` [PATCH 6/7] block: remove the bioset_integrity_free export Christoph Hellwig
@ 2018-12-13 20:32 ` Christoph Hellwig
  2018-12-14  4:28 ` misc block cleanups Jens Axboe
  7 siblings, 0 replies; 12+ messages in thread
From: Christoph Hellwig @ 2018-12-13 20:32 UTC (permalink / raw)
  To: axboe; +Cc: linux-block

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 block/bio-integrity.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/block/bio-integrity.c b/block/bio-integrity.c
index 7b30ff5b3af4..1b633a3526d4 100644
--- a/block/bio-integrity.c
+++ b/block/bio-integrity.c
@@ -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
-- 
2.19.2


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* Re: [PATCH 2/7] block: remove the bio_phys_segments export
  2018-12-13 20:32 ` [PATCH 2/7] block: remove the bio_phys_segments export Christoph Hellwig
@ 2018-12-14  4:27   ` Jens Axboe
  0 siblings, 0 replies; 12+ messages in thread
From: Jens Axboe @ 2018-12-14  4:27 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: linux-block

On 12/13/18 1:32 PM, Christoph Hellwig wrote:
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> ---
>  block/bio.c       | 3 +--
>  block/blk-merge.c | 6 +++++-
>  2 files changed, 6 insertions(+), 3 deletions(-)
> 
> diff --git a/block/bio.c b/block/bio.c
> index 036e3f0cc736..fa1ea2ac66a8 100644
> --- a/block/bio.c
> +++ b/block/bio.c
> @@ -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
> diff --git a/block/blk-merge.c b/block/blk-merge.c
> index 09591daf4993..62e97ec92034 100644
> --- a/block/blk-merge.c
> +++ b/block/blk-merge.c
> @@ -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);

Unrelated hunk in this patch.

-- 
Jens Axboe


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: misc block cleanups
  2018-12-13 20:32 misc block cleanups Christoph Hellwig
                   ` (6 preceding siblings ...)
  2018-12-13 20:32 ` [PATCH 7/7] block: remove the bio_integrity_advance export Christoph Hellwig
@ 2018-12-14  4:28 ` Jens Axboe
  2018-12-14 13:00   ` Christoph Hellwig
  7 siblings, 1 reply; 12+ messages in thread
From: Jens Axboe @ 2018-12-14  4:28 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: linux-block

On 12/13/18 1:32 PM, Christoph Hellwig wrote:
> 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.

-- 
Jens Axboe


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: misc block cleanups
  2018-12-14  4:28 ` misc block cleanups Jens Axboe
@ 2018-12-14 13:00   ` Christoph Hellwig
  2018-12-14 13:02     ` Jens Axboe
  0 siblings, 1 reply; 12+ messages in thread
From: Christoph Hellwig @ 2018-12-14 13:00 UTC (permalink / raw)
  To: Jens Axboe; +Cc: Christoph Hellwig, linux-block

On Thu, Dec 13, 2018 at 09:28:33PM -0700, Jens Axboe wrote:
> On 12/13/18 1:32 PM, Christoph Hellwig wrote:
> > 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?

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: misc block cleanups
  2018-12-14 13:00   ` Christoph Hellwig
@ 2018-12-14 13:02     ` Jens Axboe
  0 siblings, 0 replies; 12+ messages in thread
From: Jens Axboe @ 2018-12-14 13:02 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: linux-block

On 12/14/18 6:00 AM, Christoph Hellwig wrote:
> On Thu, Dec 13, 2018 at 09:28:33PM -0700, Jens Axboe wrote:
>> On 12/13/18 1:32 PM, Christoph Hellwig wrote:
>>> 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.

-- 
Jens Axboe


^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2018-12-14 13:02 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-12-13 20:32 misc block cleanups Christoph Hellwig
2018-12-13 20:32 ` [PATCH 1/7] block: remove bio_set_prio and bio_prio Christoph Hellwig
2018-12-13 20:32 ` [PATCH 2/7] block: remove the bio_phys_segments export Christoph Hellwig
2018-12-14  4:27   ` Jens Axboe
2018-12-13 20:32 ` [PATCH 3/7] block: remove the blk_recount_segments export Christoph Hellwig
2018-12-13 20:32 ` [PATCH 4/7] block: remove the unused bio_iov_iter_get_pages export Christoph Hellwig
2018-12-13 20:32 ` [PATCH 5/7] block: remove the unused bio_set_pages_dirty and bio_check_pages_dirty exports Christoph Hellwig
2018-12-13 20:32 ` [PATCH 6/7] block: remove the bioset_integrity_free export Christoph Hellwig
2018-12-13 20:32 ` [PATCH 7/7] block: remove the bio_integrity_advance export Christoph Hellwig
2018-12-14  4:28 ` misc block cleanups Jens Axboe
2018-12-14 13:00   ` Christoph Hellwig
2018-12-14 13:02     ` Jens Axboe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox