File tree Expand file tree Collapse file tree 2 files changed +17
-9
lines changed Expand file tree Collapse file tree 2 files changed +17
-9
lines changed Original file line number Diff line number Diff line change @@ -457,11 +457,6 @@ static inline bool bio_zone_write_plugging(struct bio *bio)
457
457
{
458
458
return bio_flagged (bio , BIO_ZONE_WRITE_PLUGGING );
459
459
}
460
- static inline bool bio_is_zone_append (struct bio * bio )
461
- {
462
- return bio_op (bio ) == REQ_OP_ZONE_APPEND ||
463
- bio_flagged (bio , BIO_EMULATES_ZONE_APPEND );
464
- }
465
460
void blk_zone_write_plug_bio_merged (struct bio * bio );
466
461
void blk_zone_write_plug_init_request (struct request * rq );
467
462
static inline void blk_zone_update_request_bio (struct request * rq ,
@@ -510,10 +505,6 @@ static inline bool bio_zone_write_plugging(struct bio *bio)
510
505
{
511
506
return false;
512
507
}
513
- static inline bool bio_is_zone_append (struct bio * bio )
514
- {
515
- return false;
516
- }
517
508
static inline void blk_zone_write_plug_bio_merged (struct bio * bio )
518
509
{
519
510
}
Original file line number Diff line number Diff line change @@ -675,6 +675,23 @@ static inline void bio_clear_polled(struct bio *bio)
675
675
bio -> bi_opf &= ~REQ_POLLED ;
676
676
}
677
677
678
+ /**
679
+ * bio_is_zone_append - is this a zone append bio?
680
+ * @bio: bio to check
681
+ *
682
+ * Check if @bio is a zone append operation. Core block layer code and end_io
683
+ * handlers must use this instead of an open coded REQ_OP_ZONE_APPEND check
684
+ * because the block layer can rewrite REQ_OP_ZONE_APPEND to REQ_OP_WRITE if
685
+ * it is not natively supported.
686
+ */
687
+ static inline bool bio_is_zone_append (struct bio * bio )
688
+ {
689
+ if (!IS_ENABLED (CONFIG_BLK_DEV_ZONED ))
690
+ return false;
691
+ return bio_op (bio ) == REQ_OP_ZONE_APPEND ||
692
+ bio_flagged (bio , BIO_EMULATES_ZONE_APPEND );
693
+ }
694
+
678
695
struct bio * blk_next_bio (struct bio * bio , struct block_device * bdev ,
679
696
unsigned int nr_pages , blk_opf_t opf , gfp_t gfp );
680
697
struct bio * bio_chain_and_submit (struct bio * prev , struct bio * new );
You can’t perform that action at this time.
0 commit comments