[V2,1/2] block: export blk_should_abort()
diff mbox series

Message ID 20191111211844.5922-2-chaitanya.kulkarni@wdc.com
State New
Headers show
Series
  • block: allow zone_mgmt_ops to bail out on SIGKILL
Related show

Commit Message

Chaitanya Kulkarni Nov. 11, 2019, 9:18 p.m. UTC
This patch exports blk_should_abort() function to avoid dulicate code.

Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
---
 block/blk-lib.c | 3 ++-
 block/blk.h     | 2 ++
 2 files changed, 4 insertions(+), 1 deletion(-)

Comments

Damien Le Moal Nov. 12, 2019, 12:01 a.m. UTC | #1
On 2019/11/12 6:18, Chaitanya Kulkarni wrote:
> This patch exports blk_should_abort() function to avoid dulicate code.

s/dulicate/duplicate

And why export this symbol ? It is not used in kernel modules so I do
not see the need for it.

In any case, the export should be EXPORT_SYMBOL_GPL().

> 
> Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
> ---
>  block/blk-lib.c | 3 ++-
>  block/blk.h     | 2 ++
>  2 files changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/block/blk-lib.c b/block/blk-lib.c
> index 6ca7cae62876..c0afddb2a67b 100644
> --- a/block/blk-lib.c
> +++ b/block/blk-lib.c
> @@ -11,7 +11,7 @@
>  
>  #include "blk.h"
>  
> -static int blk_should_abort(struct bio *bio)
> +int blk_should_abort(struct bio *bio)
>  {
>  	int ret;
>  
> @@ -22,6 +22,7 @@ static int blk_should_abort(struct bio *bio)
>  	bio_put(bio);
>  	return ret ? ret : -EINTR;
>  }
> +EXPORT_SYMBOL(blk_should_abort);
>  
>  struct bio *blk_next_bio(struct bio *bio, unsigned int nr_pages, gfp_t gfp)
>  {
> diff --git a/block/blk.h b/block/blk.h
> index 2bea40180b6f..63fa4694d333 100644
> --- a/block/blk.h
> +++ b/block/blk.h
> @@ -297,6 +297,8 @@ static inline struct io_context *create_io_context(gfp_t gfp_mask, int node)
>  	return current->io_context;
>  }
>  
> +int blk_should_abort(struct bio *bio);
> +
>  /*
>   * Internal throttling interface
>   */
>
Chaitanya Kulkarni Nov. 12, 2019, 3:59 a.m. UTC | #2
On 11/11/2019 04:01 PM, Damien Le Moal wrote:
> On 2019/11/12 6:18, Chaitanya Kulkarni wrote:
>> >This patch exports blk_should_abort() function to avoid dulicate code.
> s/dulicate/duplicate
>

> And why export this symbol ? It is not used in kernel modules so I do
> not see the need for it.
Yes we don't have any user for this function outside of block layer yet.
I'll remove this in next version.
>
> In any case, the export should be EXPORT_SYMBOL_GPL().
blk-lib.c has EXPORT_SYMBOL() so I kept the same pattern.
I'll update this in the next version.
>

Patch
diff mbox series

diff --git a/block/blk-lib.c b/block/blk-lib.c
index 6ca7cae62876..c0afddb2a67b 100644
--- a/block/blk-lib.c
+++ b/block/blk-lib.c
@@ -11,7 +11,7 @@ 
 
 #include "blk.h"
 
-static int blk_should_abort(struct bio *bio)
+int blk_should_abort(struct bio *bio)
 {
 	int ret;
 
@@ -22,6 +22,7 @@  static int blk_should_abort(struct bio *bio)
 	bio_put(bio);
 	return ret ? ret : -EINTR;
 }
+EXPORT_SYMBOL(blk_should_abort);
 
 struct bio *blk_next_bio(struct bio *bio, unsigned int nr_pages, gfp_t gfp)
 {
diff --git a/block/blk.h b/block/blk.h
index 2bea40180b6f..63fa4694d333 100644
--- a/block/blk.h
+++ b/block/blk.h
@@ -297,6 +297,8 @@  static inline struct io_context *create_io_context(gfp_t gfp_mask, int node)
 	return current->io_context;
 }
 
+int blk_should_abort(struct bio *bio);
+
 /*
  * Internal throttling interface
  */