X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=include%2Flinux%2Fbio.h;h=9faebf7f9a33c04a73506e7e379432ce1cce93bf;hb=f89eae4ee7e075e576bd4b4d2db901023421a3be;hp=6b7481f62218895945ba6dcd1b7df2e49268d552;hpb=b340941af9d85ca74d3efacb7210e95296c484aa;p=deliverable%2Flinux.git diff --git a/include/linux/bio.h b/include/linux/bio.h index 6b7481f62218..9faebf7f9a33 100644 --- a/include/linux/bio.h +++ b/include/linux/bio.h @@ -702,6 +702,17 @@ static inline struct bio *bio_list_get(struct bio_list *bl) return bio; } +/* + * Increment chain count for the bio. Make sure the CHAIN flag update + * is visible before the raised count. + */ +static inline void bio_inc_remaining(struct bio *bio) +{ + bio_set_flag(bio, BIO_CHAIN); + smp_mb__before_atomic(); + atomic_inc(&bio->__bi_remaining); +} + /* * bio_set is used to allow other portions of the IO system to * allocate their own private memory pools for bio and iovec structures.