Home
last modified time | relevance | path

Searched refs:bio (Results 1 – 25 of 154) sorted by relevance

1234567

/drivers/md/bcache/
Drequest.c40 static void bio_csum(struct bio *bio, struct bkey *k) in bio_csum() argument
46 bio_for_each_segment(bv, bio, iter) { in bio_csum()
111 struct bio *bio = op->bio; in bch_data_invalidate() local
114 bio_sectors(bio), (uint64_t) bio->bi_iter.bi_sector); in bch_data_invalidate()
116 while (bio_sectors(bio)) { in bch_data_invalidate()
117 unsigned int sectors = min(bio_sectors(bio), in bch_data_invalidate()
123 bio->bi_iter.bi_sector += sectors; in bch_data_invalidate()
124 bio->bi_iter.bi_size -= sectors << 9; in bch_data_invalidate()
128 bio->bi_iter.bi_sector, in bch_data_invalidate()
134 bio_put(bio); in bch_data_invalidate()
[all …]
Dio.c17 void bch_bbio_free(struct bio *bio, struct cache_set *c) in bch_bbio_free() argument
19 struct bbio *b = container_of(bio, struct bbio, bio); in bch_bbio_free()
24 struct bio *bch_bbio_alloc(struct cache_set *c) in bch_bbio_alloc()
27 struct bio *bio = &b->bio; in bch_bbio_alloc() local
29 bio_init(bio, bio->bi_inline_vecs, meta_bucket_pages(&c->cache->sb)); in bch_bbio_alloc()
31 return bio; in bch_bbio_alloc()
34 void __bch_submit_bbio(struct bio *bio, struct cache_set *c) in __bch_submit_bbio() argument
36 struct bbio *b = container_of(bio, struct bbio, bio); in __bch_submit_bbio()
38 bio->bi_iter.bi_sector = PTR_OFFSET(&b->key, 0); in __bch_submit_bbio()
39 bio_set_dev(bio, c->cache->bdev); in __bch_submit_bbio()
[all …]
Dmovinggc.c19 struct bbio bio; member
48 struct bio *bio = &io->bio.bio; in write_moving_finish() local
50 bio_free_pages(bio); in write_moving_finish()
62 static void read_moving_endio(struct bio *bio) in read_moving_endio() argument
64 struct bbio *b = container_of(bio, struct bbio, bio); in read_moving_endio()
65 struct moving_io *io = container_of(bio->bi_private, in read_moving_endio()
68 if (bio->bi_status) in read_moving_endio()
69 io->op.status = bio->bi_status; in read_moving_endio()
75 bch_bbio_endio(io->op.c, bio, bio->bi_status, "reading data to move"); in read_moving_endio()
80 struct bio *bio = &io->bio.bio; in moving_init() local
[all …]
/drivers/nvme/target/
Dio-cmd-bdev.c170 static void nvmet_bio_done(struct bio *bio) in nvmet_bio_done() argument
172 struct nvmet_req *req = bio->bi_private; in nvmet_bio_done()
174 nvmet_req_complete(req, blk_to_nvme_status(req, bio->bi_status)); in nvmet_bio_done()
175 nvmet_req_bio_put(req, bio); in nvmet_bio_done()
179 static int nvmet_bdev_alloc_bip(struct nvmet_req *req, struct bio *bio, in nvmet_bdev_alloc_bip() argument
193 bip = bio_integrity_alloc(bio, GFP_NOIO, in nvmet_bdev_alloc_bip()
200 bip->bip_iter.bi_size = bio_integrity_bytes(bi, bio_sectors(bio)); in nvmet_bdev_alloc_bip()
202 bip_set_seed(bip, bio->bi_iter.bi_sector >> in nvmet_bdev_alloc_bip()
208 rc = bio_integrity_add_page(bio, miter->page, len, in nvmet_bdev_alloc_bip()
225 static int nvmet_bdev_alloc_bip(struct nvmet_req *req, struct bio *bio, in nvmet_bdev_alloc_bip() argument
[all …]
/drivers/md/
Ddm-raid1.c121 static void queue_bio(struct mirror_set *ms, struct bio *bio, int rw) in queue_bio() argument
130 bio_list_add(bl, bio); in queue_bio()
140 struct bio *bio; in dispatch_bios() local
142 while ((bio = bio_list_pop(bio_list))) in dispatch_bios()
143 queue_bio(ms, bio, WRITE); in dispatch_bios()
163 static struct mirror *bio_get_m(struct bio *bio) in bio_get_m() argument
165 return (struct mirror *) bio->bi_next; in bio_get_m()
168 static void bio_set_m(struct bio *bio, struct mirror *m) in bio_set_m() argument
170 bio->bi_next = (struct bio *) m; in bio_set_m()
437 static int mirror_available(struct mirror_set *ms, struct bio *bio) in mirror_available() argument
[all …]
Ddm-ebs-target.c47 static inline unsigned int __nr_blocks(struct ebs_c *ec, struct bio *bio) in __nr_blocks() argument
49 sector_t end_sector = __block_mod(bio->bi_iter.bi_sector, ec->u_bs) + bio_sectors(bio); in __nr_blocks()
120 static int __ebs_rw_bio(struct ebs_c *ec, int rw, struct bio *bio) in __ebs_rw_bio() argument
126 bio_for_each_bvec(bv, bio, iter) { in __ebs_rw_bio()
141 static int __ebs_discard_bio(struct ebs_c *ec, struct bio *bio) in __ebs_discard_bio() argument
143 sector_t block, blocks, sector = bio->bi_iter.bi_sector; in __ebs_discard_bio()
146 blocks = __nr_blocks(ec, bio); in __ebs_discard_bio()
158 if (blocks && __block_mod(bio_end_sector(bio), ec->u_bs)) in __ebs_discard_bio()
165 static void __ebs_forget_bio(struct ebs_c *ec, struct bio *bio) in __ebs_forget_bio() argument
167 sector_t blocks, sector = bio->bi_iter.bi_sector; in __ebs_forget_bio()
[all …]
Ddm-thin.c223 typedef void (*process_bio_fn)(struct thin_c *tc, struct bio *bio);
286 struct bio flush_bio;
383 struct bio *parent_bio;
384 struct bio *bio; member
387 static void begin_discard(struct discard_op *op, struct thin_c *tc, struct bio *parent) in begin_discard()
394 op->bio = NULL; in begin_discard()
404 GFP_NOWAIT, 0, &op->bio); in issue_discard()
409 if (op->bio) { in end_discard()
414 bio_chain(op->bio, op->parent_bio); in end_discard()
415 bio_set_op_attrs(op->bio, REQ_OP_DISCARD, 0); in end_discard()
[all …]
Ddm-zoned-target.c22 struct bio *bio; member
75 static inline void dmz_bio_endio(struct bio *bio, blk_status_t status) in dmz_bio_endio() argument
78 dm_per_bio_data(bio, sizeof(struct dmz_bioctx)); in dmz_bio_endio()
80 if (status != BLK_STS_OK && bio->bi_status == BLK_STS_OK) in dmz_bio_endio()
81 bio->bi_status = status; in dmz_bio_endio()
82 if (bioctx->dev && bio->bi_status != BLK_STS_OK) in dmz_bio_endio()
89 if (bio->bi_status != BLK_STS_OK && in dmz_bio_endio()
90 bio_op(bio) == REQ_OP_WRITE && in dmz_bio_endio()
95 bio_endio(bio); in dmz_bio_endio()
103 static void dmz_clone_endio(struct bio *clone) in dmz_clone_endio()
[all …]
Ddm-bio-record.h31 static inline void dm_bio_record(struct dm_bio_details *bd, struct bio *bio) in dm_bio_record() argument
33 bd->bi_bdev = bio->bi_bdev; in dm_bio_record()
34 bd->bi_flags = bio->bi_flags; in dm_bio_record()
35 bd->bi_iter = bio->bi_iter; in dm_bio_record()
36 bd->__bi_remaining = atomic_read(&bio->__bi_remaining); in dm_bio_record()
37 bd->bi_end_io = bio->bi_end_io; in dm_bio_record()
39 bd->bi_integrity = bio_integrity(bio); in dm_bio_record()
43 static inline void dm_bio_restore(struct dm_bio_details *bd, struct bio *bio) in dm_bio_restore() argument
45 bio->bi_bdev = bd->bi_bdev; in dm_bio_restore()
46 bio->bi_flags = bd->bi_flags; in dm_bio_restore()
[all …]
Ddm-log-writes.c167 static void log_end_io(struct bio *bio) in log_end_io() argument
169 struct log_writes_c *lc = bio->bi_private; in log_end_io()
171 if (bio->bi_status) { in log_end_io()
174 DMERR("Error writing log block, error=%d", bio->bi_status); in log_end_io()
180 bio_free_pages(bio); in log_end_io()
182 bio_put(bio); in log_end_io()
185 static void log_end_super(struct bio *bio) in log_end_super() argument
187 struct log_writes_c *lc = bio->bi_private; in log_end_super()
190 log_end_io(bio); in log_end_super()
215 struct bio *bio; in write_metadata() local
[all …]
Ddm-cache-target.c82 void (*issue_op)(struct bio *bio, void *context);
105 struct bio *bio; in __commit() local
131 while ((bio = bio_list_pop(&bios))) { in __commit()
133 bio->bi_status = r; in __commit()
134 bio_endio(bio); in __commit()
136 b->issue_op(bio, b->issue_context); in __commit()
143 void (*issue_op)(struct bio *bio, void *), in batcher_init() argument
181 static void issue_after_commit(struct batcher *b, struct bio *bio) in issue_after_commit() argument
187 bio_list_add(&b->bios, bio); in issue_after_commit()
219 static void dm_hook_bio(struct dm_hook_info *h, struct bio *bio, in dm_hook_bio() argument
[all …]
Ddm-clone-target.c259 static inline void remap_to_source(struct clone *clone, struct bio *bio) in remap_to_source() argument
261 bio_set_dev(bio, clone->source_dev->bdev); in remap_to_source()
264 static inline void remap_to_dest(struct clone *clone, struct bio *bio) in remap_to_dest() argument
266 bio_set_dev(bio, clone->dest_dev->bdev); in remap_to_dest()
269 static bool bio_triggers_commit(struct clone *clone, struct bio *bio) in bio_triggers_commit() argument
271 return op_is_flush(bio->bi_opf) && in bio_triggers_commit()
282 static inline unsigned long bio_to_region(struct clone *clone, struct bio *bio) in bio_to_region() argument
284 return (bio->bi_iter.bi_sector >> clone->region_shift); in bio_to_region()
288 static void bio_region_range(struct clone *clone, struct bio *bio, in bio_region_range() argument
293 *rs = dm_sector_div_up(bio->bi_iter.bi_sector, clone->region_size); in bio_region_range()
[all …]
Dmd-multipath.c70 struct bio *bio = mp_bh->master_bio; in multipath_end_bh_io() local
73 bio->bi_status = status; in multipath_end_bh_io()
74 bio_endio(bio); in multipath_end_bh_io()
78 static void multipath_end_request(struct bio *bio) in multipath_end_request() argument
80 struct multipath_bh *mp_bh = bio->bi_private; in multipath_end_request()
84 if (!bio->bi_status) in multipath_end_request()
86 else if (!(bio->bi_opf & REQ_RAHEAD)) { in multipath_end_request()
94 (unsigned long long)bio->bi_iter.bi_sector); in multipath_end_request()
97 multipath_end_bh_io(mp_bh, bio->bi_status); in multipath_end_request()
101 static bool multipath_make_request(struct mddev *mddev, struct bio * bio) in multipath_make_request() argument
[all …]
Ddm-flakey.c18 #define all_corrupt_bio_flags_match(bio, fc) \ argument
19 (((bio)->bi_opf & (fc)->corrupt_bio_flags) == (fc)->corrupt_bio_flags)
278 static void flakey_map_bio(struct dm_target *ti, struct bio *bio) in flakey_map_bio() argument
282 bio_set_dev(bio, fc->dev->bdev); in flakey_map_bio()
283 if (bio_sectors(bio) || op_is_zone_mgmt(bio_op(bio))) in flakey_map_bio()
284 bio->bi_iter.bi_sector = in flakey_map_bio()
285 flakey_map_sector(ti, bio->bi_iter.bi_sector); in flakey_map_bio()
288 static void corrupt_bio_data(struct bio *bio, struct flakey_c *fc) in corrupt_bio_data() argument
295 if (!bio_has_data(bio)) in corrupt_bio_data()
302 bio_for_each_segment(bvec, bio, iter) { in corrupt_bio_data()
[all …]
Draid10.c74 static void end_reshape_write(struct bio *bio);
86 static inline struct r10bio *get_resync_r10bio(struct bio *bio) in get_resync_r10bio() argument
88 return get_resync_pages(bio)->raid_bio; in get_resync_r10bio()
120 struct bio *bio; in r10buf_pool_alloc() local
148 bio = bio_kmalloc(gfp_flags, RESYNC_PAGES); in r10buf_pool_alloc()
149 if (!bio) in r10buf_pool_alloc()
151 r10_bio->devs[j].bio = bio; in r10buf_pool_alloc()
154 bio = bio_kmalloc(gfp_flags, RESYNC_PAGES); in r10buf_pool_alloc()
155 if (!bio) in r10buf_pool_alloc()
157 r10_bio->devs[j].repl_bio = bio; in r10buf_pool_alloc()
[all …]
Ddm-snap.c148 struct bio flush_bio;
233 struct bio *full_bio;
249 static void init_tracked_chunk(struct bio *bio) in init_tracked_chunk() argument
251 struct dm_snap_tracked_chunk *c = dm_per_bio_data(bio, sizeof(struct dm_snap_tracked_chunk)); in init_tracked_chunk()
255 static bool is_bio_tracked(struct bio *bio) in is_bio_tracked() argument
257 struct dm_snap_tracked_chunk *c = dm_per_bio_data(bio, sizeof(struct dm_snap_tracked_chunk)); in is_bio_tracked()
261 static void track_chunk(struct dm_snapshot *s, struct bio *bio, chunk_t chunk) in track_chunk() argument
263 struct dm_snap_tracked_chunk *c = dm_per_bio_data(bio, sizeof(struct dm_snap_tracked_chunk)); in track_chunk()
273 static void stop_tracking_chunk(struct dm_snapshot *s, struct bio *bio) in stop_tracking_chunk() argument
275 struct dm_snap_tracked_chunk *c = dm_per_bio_data(bio, sizeof(struct dm_snap_tracked_chunk)); in stop_tracking_chunk()
[all …]
Ddm.c72 struct bio *bio; member
82 void *dm_per_bio_data(struct bio *bio, size_t data_size) in dm_per_bio_data() argument
84 struct dm_target_io *tio = container_of(bio, struct dm_target_io, clone); in dm_per_bio_data()
86 return (char *)bio - DM_TARGET_IO_BIO_OFFSET - data_size; in dm_per_bio_data()
87 return (char *)bio - DM_IO_BIO_OFFSET - data_size; in dm_per_bio_data()
91 struct bio *dm_bio_from_per_bio_data(void *data, size_t data_size) in dm_bio_from_per_bio_data()
95 return (struct bio *)((char *)io + DM_IO_BIO_OFFSET); in dm_bio_from_per_bio_data()
97 return (struct bio *)((char *)io + DM_TARGET_IO_BIO_OFFSET); in dm_bio_from_per_bio_data()
101 unsigned dm_bio_get_target_bio_nr(const struct bio *bio) in dm_bio_get_target_bio_nr() argument
103 return container_of(bio, struct dm_target_io, clone)->target_bio_nr; in dm_bio_get_target_bio_nr()
[all …]
Draid1.c125 static inline struct r1bio *get_resync_r1bio(struct bio *bio) in get_resync_r1bio() argument
127 return get_resync_pages(bio)->raid_bio; in get_resync_r1bio()
150 struct bio *bio; in r1buf_pool_alloc() local
168 bio = bio_kmalloc(gfp_flags, RESYNC_PAGES); in r1buf_pool_alloc()
169 if (!bio) in r1buf_pool_alloc()
171 r1_bio->bios[j] = bio; in r1buf_pool_alloc()
186 bio = r1_bio->bios[j]; in r1buf_pool_alloc()
197 bio->bi_private = rp; in r1buf_pool_alloc()
242 struct bio **bio = r1_bio->bios + i; in put_all_bios() local
243 if (!BIO_SPECIAL(*bio)) in put_all_bios()
[all …]
Dmd-linear.c216 static bool linear_make_request(struct mddev *mddev, struct bio *bio) in linear_make_request() argument
221 sector_t bio_sector = bio->bi_iter.bi_sector; in linear_make_request()
223 if (unlikely(bio->bi_opf & REQ_PREFLUSH) in linear_make_request()
224 && md_flush_request(mddev, bio)) in linear_make_request()
238 bio_io_error(bio); in linear_make_request()
242 if (unlikely(bio_end_sector(bio) > end_sector)) { in linear_make_request()
244 struct bio *split = bio_split(bio, end_sector - bio_sector, in linear_make_request()
246 bio_chain(split, bio); in linear_make_request()
247 submit_bio_noacct(bio); in linear_make_request()
248 bio = split; in linear_make_request()
[all …]
Ddm-user.c73 struct bio *bio; member
189 m->bio->bi_status = BLK_STS_IOERR; in message_kill()
190 bio_endio(m->bio); in message_kill()
222 msg->bio->bi_iter.bi_sector, in process_delayed_work()
295 static inline size_t bio_size(struct bio *bio) in bio_size() argument
301 bio_for_each_segment (bvec, bio, iter) in bio_size()
302 out += bio_iter_len(bio, iter); in bio_size()
306 static inline size_t bio_bytes_needed_to_user(struct bio *bio) in bio_bytes_needed_to_user() argument
308 switch (bio_op(bio)) { in bio_bytes_needed_to_user()
310 return sizeof(struct dm_user_message) + bio_size(bio); in bio_bytes_needed_to_user()
[all …]
Dmd-faulty.c64 static void faulty_fail(struct bio *bio) in faulty_fail() argument
66 struct bio *b = bio->bi_private; in faulty_fail()
68 b->bi_iter.bi_size = bio->bi_iter.bi_size; in faulty_fail()
69 b->bi_iter.bi_sector = bio->bi_iter.bi_sector; in faulty_fail()
71 bio_put(bio); in faulty_fail()
164 static bool faulty_make_request(struct mddev *mddev, struct bio *bio) in faulty_make_request() argument
169 if (bio_data_dir(bio) == WRITE) { in faulty_make_request()
175 bio_io_error(bio); in faulty_make_request()
179 if (check_sector(conf, bio->bi_iter.bi_sector, in faulty_make_request()
180 bio_end_sector(bio), WRITE)) in faulty_make_request()
[all …]
Ddm-io.c90 static void store_io_and_region_in_bio(struct bio *bio, struct io *io, in store_io_and_region_in_bio() argument
98 bio->bi_private = (void *)((unsigned long)io | region); in store_io_and_region_in_bio()
101 static void retrieve_io_and_region_from_bio(struct bio *bio, struct io **io, in retrieve_io_and_region_from_bio() argument
104 unsigned long val = (unsigned long)bio->bi_private; in retrieve_io_and_region_from_bio()
137 static void endio(struct bio *bio) in endio() argument
143 if (bio->bi_status && bio_data_dir(bio) == READ) in endio()
144 zero_fill_bio(bio); in endio()
149 retrieve_io_and_region_from_bio(bio, &io, &region); in endio()
151 error = bio->bi_status; in endio()
152 bio_put(bio); in endio()
[all …]
/drivers/target/
Dtarget_core_iblock.c325 static void iblock_bio_done(struct bio *bio) in iblock_bio_done() argument
327 struct se_cmd *cmd = bio->bi_private; in iblock_bio_done()
330 if (bio->bi_status) { in iblock_bio_done()
331 pr_err("bio error: %p, err: %d\n", bio, bio->bi_status); in iblock_bio_done()
339 bio_put(bio); in iblock_bio_done()
344 static struct bio *iblock_get_bio(struct se_cmd *cmd, sector_t lba, u32 sg_num, in iblock_get_bio()
348 struct bio *bio; in iblock_get_bio() local
354 bio = bio_alloc_bioset(GFP_NOIO, bio_max_segs(sg_num), in iblock_get_bio()
356 if (!bio) { in iblock_get_bio()
361 bio_set_dev(bio, ib_dev->ibd_bd); in iblock_get_bio()
[all …]
/drivers/block/rsxx/
Ddev.c45 struct bio *bio; member
53 static blk_qc_t rsxx_submit_bio(struct bio *bio);
113 bio_end_io_acct(meta->bio, meta->start_time); in bio_dma_done_cb()
116 bio_io_error(meta->bio); in bio_dma_done_cb()
118 bio_endio(meta->bio); in bio_dma_done_cb()
123 static blk_qc_t rsxx_submit_bio(struct bio *bio) in rsxx_submit_bio() argument
125 struct rsxx_cardinfo *card = bio->bi_bdev->bd_disk->private_data; in rsxx_submit_bio()
129 blk_queue_split(&bio); in rsxx_submit_bio()
130 if (!bio) in rsxx_submit_bio()
138 if (bio_end_sector(bio) > get_capacity(card->gendisk)) in rsxx_submit_bio()
[all …]
/drivers/block/rnbd/
Drnbd-srv-dev.c48 void rnbd_dev_bi_end_io(struct bio *bio) in rnbd_dev_bi_end_io() argument
50 struct rnbd_dev_blk_io *io = bio->bi_private; in rnbd_dev_bi_end_io()
52 rnbd_endio(io->priv, blk_status_to_errno(bio->bi_status)); in rnbd_dev_bi_end_io()
53 bio_put(bio); in rnbd_dev_bi_end_io()
66 struct bio *rnbd_bio_map_kern(void *data, struct bio_set *bs, in rnbd_bio_map_kern()
74 struct bio *bio; in rnbd_bio_map_kern() local
76 bio = bio_alloc_bioset(gfp_mask, nr_pages, bs); in rnbd_bio_map_kern()
77 if (!bio) in rnbd_bio_map_kern()
90 if (bio_add_page(bio, virt_to_page(data), bytes, in rnbd_bio_map_kern()
93 bio_put(bio); in rnbd_bio_map_kern()
[all …]

1234567