]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blobdiff - include/linux/bio.h
block: Clean up special command handling logic
[mirror_ubuntu-artful-kernel.git] / include / linux / bio.h
index 52b9cbc3e4dac80e2229a0d65be621b7b0f15ebc..e54305cacc9821e4ffbb40aebbd89ddb97401710 100644 (file)
@@ -386,9 +386,28 @@ static inline char *__bio_kmap_irq(struct bio *bio, unsigned short idx,
 /*
  * Check whether this bio carries any data or not. A NULL bio is allowed.
  */
-static inline int bio_has_data(struct bio *bio)
+static inline bool bio_has_data(struct bio *bio)
 {
-       return bio && bio->bi_io_vec != NULL;
+       if (bio && bio->bi_vcnt)
+               return true;
+
+       return false;
+}
+
+static inline bool bio_is_rw(struct bio *bio)
+{
+       if (!bio_has_data(bio))
+               return false;
+
+       return true;
+}
+
+static inline bool bio_mergeable(struct bio *bio)
+{
+       if (bio->bi_rw & REQ_NOMERGE_FLAGS)
+               return false;
+
+       return true;
 }
 
 /*