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)
457457{
458458 return bio_flagged (bio , BIO_ZONE_WRITE_PLUGGING );
459459}
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- }
465460void blk_zone_write_plug_bio_merged (struct bio * bio );
466461void blk_zone_write_plug_init_request (struct request * rq );
467462static inline void blk_zone_update_request_bio (struct request * rq ,
@@ -510,10 +505,6 @@ static inline bool bio_zone_write_plugging(struct bio *bio)
510505{
511506 return false;
512507}
513- static inline bool bio_is_zone_append (struct bio * bio )
514- {
515- return false;
516- }
517508static inline void blk_zone_write_plug_bio_merged (struct bio * bio )
518509{
519510}
Original file line number Diff line number Diff line change @@ -675,6 +675,23 @@ static inline void bio_clear_polled(struct bio *bio)
675675 bio -> bi_opf &= ~REQ_POLLED ;
676676}
677677
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+
678695struct bio * blk_next_bio (struct bio * bio , struct block_device * bdev ,
679696 unsigned int nr_pages , blk_opf_t opf , gfp_t gfp );
680697struct bio * bio_chain_and_submit (struct bio * prev , struct bio * new );
You can’t perform that action at this time.
0 commit comments