block: don't call should_fail_request() for !CONFIG_FAIL_MAKE_REQUEST
Jens Axboe
maintainerPATCH 1/1 block: don't call should_fail_request() for !CONFIG_FAIL_MAKE_REQUEST
Unnecessary function call, if we don't have that specific configuration option enabled.
---
block/blk-core.c +2 -0
@@ -697,8 +697,10 @@ static inline bool bio_check_ro(struct bio *bio) static noinline int should_fail_bio(struct bio *bio) { +#ifdef CONFIG_FAIL_MAKE_REQUEST if (should_fail_request (bdev_whole (bio->bi_bdev), bio->bi_iter.bi_size))return -EIO ; +#endif return 0 ; }ALLOW_ERROR_INJECTION (should_fail_bio,ERRNO );
Signature · 1 line
Jens Axboe
Quoted 12 lines · Jens Axboe
Unnecessary function call, if we don't have that specific configuration option enabled.
Signed-off-by Jens Axboe <[email protected]>---
block/blk-core.c +0
-0
block/blk-core.c static inline bool bio_check_ro(struct bio *bio) · line 706
Quoted 10 lines
block/blk-core.c +2
-0@@ -697,8 +697,10 @@ static inline bool bio_check_ro(struct bio *bio) static noinline int should_fail_bio(struct bio *bio) { +#ifdef CONFIG_FAIL_MAKE_REQUEST if (should_fail_request (bdev_whole (bio->bi_bdev), bio->bi_iter.bi_size))return -EIO ; +#endif return 0 ; }ALLOW_ERROR_INJECTION (should_fail_bio,ERRNO );
Has the performance impact of this patch been measured? I'm asking because I found the following in blk-core.c:
#ifdef CONFIG_FAIL_MAKE_REQUEST
[ ... ]
#else /* CONFIG_FAIL_MAKE_REQUEST */
static inline bool should_fail_request(struct block_device *part,
unsigned int bytes)
{
return false;
}#endif /* CONFIG_FAIL_MAKE_REQUEST */
Thanks,
Bart.
Jens Axboe
maintainerQuoted 32 lines · Bart Van Assche
Quoted 12 lines · Jens Axboe
Unnecessary function call, if we don't have that specific configuration option enabled.
Signed-off-by Jens Axboe <[email protected]>---
block/blk-core.c +0
-0block/blk-core.c static inline bool bio_check_ro(struct bio *bio) · line 706
Quoted 10 lines
block/blk-core.c +2
-0@@ -697,8 +697,10 @@ static inline bool bio_check_ro(struct bio *bio) static noinline int should_fail_bio(struct bio *bio) { +#ifdef CONFIG_FAIL_MAKE_REQUEST if (should_fail_request (bdev_whole (bio->bi_bdev), bio->bi_iter.bi_size))return -EIO ; +#endif return 0 ; }ALLOW_ERROR_INJECTION (should_fail_bio,ERRNO );Has the performance impact of this patch been measured? I'm asking because I found the following in
blk-core.c:#ifdef
CONFIG_FAIL_MAKE_REQUEST
[ ... ]
#else /*CONFIG_FAIL_MAKE_REQUEST*/
static inline bool should_fail_request(structblock_device*part,
unsigned int bytes)
Quoted 4 lines
{ return false; }#endif /*
CONFIG_FAIL_MAKE_REQUEST*/
True, might be a leftover from some other experimentation. Looks like we can just ignore that patch.
Signature · 1 line
Jens Axboe