Lines Matching defs:bio

215 	struct bio *bio;
230 while ((bio = bio_list_pop(&bios)))
231 submit_bio(bio);
237 * When a shared kthread issues a bio for a cgroup, doing so synchronously can
242 void blkcg_punt_bio_submit(struct bio *bio)
244 struct blkcg_gq *blkg = bio->bi_blkg;
248 bio_list_add(&blkg->async_bios, bio);
253 submit_bio(bio);
271 * bio_blkcg_css - return the blkcg CSS associated with a bio
272 * @bio: target bio
274 * This returns the CSS for the blkcg associated with a bio, or %NULL if not
278 struct cgroup_subsys_state *bio_blkcg_css(struct bio *bio)
280 if (!bio || !bio->bi_blkg)
282 return &bio->bi_blkg->blkcg->css;
1999 * @bio: target bio
2006 static inline struct blkcg_gq *blkg_tryget_closest(struct bio *bio,
2012 blkg = blkg_lookup_create(css_to_blkcg(css), bio->bi_bdev->bd_disk);
2026 * bio_associate_blkg_from_css - associate a bio with a specified css
2027 * @bio: target bio
2030 * Associate @bio with the blkg found by combining the css's blkg and the
2031 * request_queue of the @bio. An association failure is handled by walking up
2036 * A reference will be taken on the blkg and will be released when @bio is
2039 void bio_associate_blkg_from_css(struct bio *bio,
2042 if (bio->bi_blkg)
2043 blkg_put(bio->bi_blkg);
2046 bio->bi_blkg = blkg_tryget_closest(bio, css);
2048 blkg_get(bdev_get_queue(bio->bi_bdev)->root_blkg);
2049 bio->bi_blkg = bdev_get_queue(bio->bi_bdev)->root_blkg;
2055 * bio_associate_blkg - associate a bio with a blkg
2056 * @bio: target bio
2058 * Associate @bio with the blkg found from the bio's css and request_queue.
2063 void bio_associate_blkg(struct bio *bio)
2069 if (bio->bi_blkg)
2070 css = bio_blkcg_css(bio);
2074 bio_associate_blkg_from_css(bio, css);
2081 * bio_clone_blkg_association - clone blkg association from src to dst bio
2082 * @dst: destination bio
2083 * @src: source bio
2085 void bio_clone_blkg_association(struct bio *dst, struct bio *src)
2092 static int blk_cgroup_io_type(struct bio *bio)
2094 if (op_is_discard(bio->bi_opf))
2096 if (op_is_write(bio->bi_opf))
2101 void blk_cgroup_bio_start(struct bio *bio)
2103 struct blkcg *blkcg = bio->bi_blkg->blkcg;
2104 int rwd = blk_cgroup_io_type(bio), cpu;
2116 bis = per_cpu_ptr(bio->bi_blkg->iostat_cpu, cpu);
2120 * If the bio is flagged with BIO_CGROUP_ACCT it means this is a split
2121 * bio and we would have already accounted for the size of the bio.
2123 if (!bio_flagged(bio, BIO_CGROUP_ACCT)) {
2124 bio_set_flag(bio, BIO_CGROUP_ACCT);
2125 bis->cur.bytes[rwd] += bio->bi_iter.bi_size;