block: Implement zone append emulation
[linux-2.6-block.git] / block / blk.h
index 4df969f8fa288a561c1b40474da8c82833aa51cb..1140c4a0be03d4997f7376612bb053b99d7dd7c9 100644 (file)
@@ -421,6 +421,11 @@ static inline bool bio_zone_write_plugging(struct bio *bio)
 {
        return bio_flagged(bio, BIO_ZONE_WRITE_PLUGGING);
 }
+static inline bool bio_is_zone_append(struct bio *bio)
+{
+       return bio_op(bio) == REQ_OP_ZONE_APPEND ||
+               bio_flagged(bio, BIO_EMULATES_ZONE_APPEND);
+}
 void blk_zone_write_plug_bio_merged(struct bio *bio);
 void blk_zone_write_plug_attempt_merge(struct request *rq);
 static inline void blk_zone_update_request_bio(struct request *rq,
@@ -430,8 +435,9 @@ static inline void blk_zone_update_request_bio(struct request *rq,
         * For zone append requests, the request sector indicates the location
         * at which the BIO data was written. Return this value to the BIO
         * issuer through the BIO iter sector.
-        * For plugged zone writes, we need the original BIO sector so
-        * that blk_zone_write_plug_bio_endio() can lookup the zone write plug.
+        * For plugged zone writes, which include emulated zone append, we need
+        * the original BIO sector so that blk_zone_write_plug_bio_endio() can
+        * lookup the zone write plug.
         */
        if (req_op(rq) == REQ_OP_ZONE_APPEND || bio_zone_write_plugging(bio))
                bio->bi_iter.bi_sector = rq->__sector;
@@ -468,6 +474,10 @@ static inline bool bio_zone_write_plugging(struct bio *bio)
 {
        return false;
 }
+static inline bool bio_is_zone_append(struct bio *bio)
+{
+       return false;
+}
 static inline void blk_zone_write_plug_bio_merged(struct bio *bio)
 {
 }