All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] block: Add some exports for bcachefs
@ 2020-10-19 19:02 Kent Overstreet
  2020-10-19 19:02 ` [PATCH 2/2] block: Add blk_status_to_str() Kent Overstreet
  2020-10-19 20:11 ` [PATCH 1/2] block: Add some exports for bcachefs Jens Axboe
  0 siblings, 2 replies; 3+ messages in thread
From: Kent Overstreet @ 2020-10-19 19:02 UTC (permalink / raw)
  To: linux-kernel, linux-block, axboe; +Cc: Kent Overstreet

bcachefs has its own direct IO code.

Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
---
 block/bio.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/block/bio.c b/block/bio.c
index e865ea55b9..72a65c4113 100644
--- a/block/bio.c
+++ b/block/bio.c
@@ -1320,6 +1320,7 @@ void bio_set_pages_dirty(struct bio *bio)
 			set_page_dirty_lock(bvec->bv_page);
 	}
 }
+EXPORT_SYMBOL_GPL(bio_set_pages_dirty);
 
 /*
  * bio_check_pages_dirty() will check that all the BIO's pages are still dirty.
@@ -1379,6 +1380,7 @@ 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);
 
 static inline bool bio_remaining_done(struct bio *bio)
 {
-- 
2.28.0


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

* [PATCH 2/2] block: Add blk_status_to_str()
  2020-10-19 19:02 [PATCH 1/2] block: Add some exports for bcachefs Kent Overstreet
@ 2020-10-19 19:02 ` Kent Overstreet
  2020-10-19 20:11 ` [PATCH 1/2] block: Add some exports for bcachefs Jens Axboe
  1 sibling, 0 replies; 3+ messages in thread
From: Kent Overstreet @ 2020-10-19 19:02 UTC (permalink / raw)
  To: linux-kernel, linux-block, axboe; +Cc: Kent Overstreet

If we're going to the trouble of having these nice error strings, let's
make them available.

Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
---
 block/blk-core.c       | 13 +++++++++----
 include/linux/blkdev.h |  1 +
 2 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/block/blk-core.c b/block/blk-core.c
index 10c08ac506..d68f24a7ee 100644
--- a/block/blk-core.c
+++ b/block/blk-core.c
@@ -213,18 +213,23 @@ int blk_status_to_errno(blk_status_t status)
 }
 EXPORT_SYMBOL_GPL(blk_status_to_errno);
 
-static void print_req_error(struct request *req, blk_status_t status,
-		const char *caller)
+const char *blk_status_to_str(blk_status_t status)
 {
 	int idx = (__force int)status;
 
 	if (WARN_ON_ONCE(idx >= ARRAY_SIZE(blk_errors)))
-		return;
+		return "(invalid error)";
+	return blk_errors[idx].name;
+}
+EXPORT_SYMBOL_GPL(blk_status_to_str);
 
+static void print_req_error(struct request *req, blk_status_t status,
+		const char *caller)
+{
 	printk_ratelimited(KERN_ERR
 		"%s: %s error, dev %s, sector %llu op 0x%x:(%s) flags 0x%x "
 		"phys_seg %u prio class %u\n",
-		caller, blk_errors[idx].name,
+		caller, blk_status_to_str(status),
 		req->rq_disk ? req->rq_disk->disk_name : "?",
 		blk_rq_pos(req), req_op(req), blk_op_str(req_op(req)),
 		req->cmd_flags & ~REQ_OP_MASK,
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index 868e11face..d9e3b7b017 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -936,6 +936,7 @@ extern const char *blk_op_str(unsigned int op);
 
 int blk_status_to_errno(blk_status_t status);
 blk_status_t errno_to_blk_status(int errno);
+const char *blk_status_to_str(blk_status_t status);
 
 int blk_poll(struct request_queue *q, blk_qc_t cookie, bool spin);
 
-- 
2.28.0


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

* Re: [PATCH 1/2] block: Add some exports for bcachefs
  2020-10-19 19:02 [PATCH 1/2] block: Add some exports for bcachefs Kent Overstreet
  2020-10-19 19:02 ` [PATCH 2/2] block: Add blk_status_to_str() Kent Overstreet
@ 2020-10-19 20:11 ` Jens Axboe
  1 sibling, 0 replies; 3+ messages in thread
From: Jens Axboe @ 2020-10-19 20:11 UTC (permalink / raw)
  To: Kent Overstreet, linux-kernel, linux-block

On 10/19/20 1:02 PM, Kent Overstreet wrote:
> bcachefs has its own direct IO code.

I talked to Kent about this offline, but just for completeness sake,
my recommendation is to keep these as prep patches for the bcachefs
series so we avoid having modular exports of code that don't have
any in-kernel modular users.

-- 
Jens Axboe


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

end of thread, other threads:[~2020-10-19 20:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-19 19:02 [PATCH 1/2] block: Add some exports for bcachefs Kent Overstreet
2020-10-19 19:02 ` [PATCH 2/2] block: Add blk_status_to_str() Kent Overstreet
2020-10-19 20:11 ` [PATCH 1/2] block: Add some exports for bcachefs Jens Axboe

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.