Re: [PATCH 04/13] blkcg: introduce common blkg association logic
From: Christoph Hellwig <hch@infradead.org>
Date: 2018-11-30 09:52:24
Also in:
cgroups, lkml
From: Christoph Hellwig <hch@infradead.org>
Date: 2018-11-30 09:52:24
Also in:
cgroups, lkml
EXPORT_SYMBOL_GPL(bio_associate_blkcg);
/**
- * bio_associate_blkg - associate a bio with the a blkg
+ * bio_has_queue - required check for blkg association
+ * @bio: target bio
+ *
+ * A blkg represents the relationship between a blkcg and a request_queue.
+ * If there is no request_queue, there is no blkg and therefore nothing to
+ * associate with.
+ */
+static inline bool bio_has_queue(struct bio *bio)
+{
+ return bio->bi_disk && bio->bi_disk->queue;
+}How do you ever see a bio without a queue? We can't even do I/O in that case.