Lines Matching refs:dip
8215 struct btrfs_dio_private *dip = bio->bi_private; in btrfs_endio_direct_read() local
8216 struct inode *inode = dip->inode; in btrfs_endio_direct_read()
8221 if (dip->flags & BTRFS_DIO_ORIG_BIO_SUBMITTED) in btrfs_endio_direct_read()
8224 unlock_extent(&BTRFS_I(inode)->io_tree, dip->logical_offset, in btrfs_endio_direct_read()
8225 dip->logical_offset + dip->bytes - 1); in btrfs_endio_direct_read()
8226 dio_bio = dip->dio_bio; in btrfs_endio_direct_read()
8228 kfree(dip); in btrfs_endio_direct_read()
8288 struct btrfs_dio_private *dip = bio->bi_private; in btrfs_endio_direct_write() local
8289 struct bio *dio_bio = dip->dio_bio; in btrfs_endio_direct_write()
8291 __endio_write_update_ordered(dip->inode, dip->logical_offset, in btrfs_endio_direct_write()
8292 dip->bytes, !bio->bi_status); in btrfs_endio_direct_write()
8294 kfree(dip); in btrfs_endio_direct_write()
8313 struct btrfs_dio_private *dip = bio->bi_private; in btrfs_end_dio_bio() local
8317 btrfs_warn(BTRFS_I(dip->inode)->root->fs_info, in btrfs_end_dio_bio()
8319 btrfs_ino(BTRFS_I(dip->inode)), bio_op(bio), in btrfs_end_dio_bio()
8324 if (dip->subio_endio) in btrfs_end_dio_bio()
8325 err = dip->subio_endio(dip->inode, btrfs_io_bio(bio), err); in btrfs_end_dio_bio()
8334 dip->errors = 1; in btrfs_end_dio_bio()
8338 if (!atomic_dec_and_test(&dip->pending_bios)) in btrfs_end_dio_bio()
8341 if (dip->errors) { in btrfs_end_dio_bio()
8342 bio_io_error(dip->orig_bio); in btrfs_end_dio_bio()
8344 dip->dio_bio->bi_status = BLK_STS_OK; in btrfs_end_dio_bio()
8345 bio_endio(dip->orig_bio); in btrfs_end_dio_bio()
8352 struct btrfs_dio_private *dip, in btrfs_lookup_and_bind_dio_csum() argument
8357 struct btrfs_io_bio *orig_io_bio = btrfs_io_bio(dip->orig_bio); in btrfs_lookup_and_bind_dio_csum()
8365 if (dip->logical_offset == file_offset) { in btrfs_lookup_and_bind_dio_csum()
8366 ret = btrfs_lookup_bio_sums_dio(inode, dip->orig_bio, in btrfs_lookup_and_bind_dio_csum()
8372 if (bio == dip->orig_bio) in btrfs_lookup_and_bind_dio_csum()
8375 file_offset -= dip->logical_offset; in btrfs_lookup_and_bind_dio_csum()
8386 struct btrfs_dio_private *dip = bio->bi_private; in btrfs_submit_dio_bio() local
8417 ret = btrfs_lookup_and_bind_dio_csum(inode, dip, bio, in btrfs_submit_dio_bio()
8428 static int btrfs_submit_direct_hook(struct btrfs_dio_private *dip) in btrfs_submit_direct_hook() argument
8430 struct inode *inode = dip->inode; in btrfs_submit_direct_hook()
8433 struct bio *orig_bio = dip->orig_bio; in btrfs_submit_direct_hook()
8435 u64 file_offset = dip->logical_offset; in btrfs_submit_direct_hook()
8453 dip->flags |= BTRFS_DIO_ORIG_BIO_SUBMITTED; in btrfs_submit_direct_hook()
8474 bio->bi_private = dip; in btrfs_submit_direct_hook()
8489 atomic_inc(&dip->pending_bios); in btrfs_submit_direct_hook()
8495 atomic_dec(&dip->pending_bios); in btrfs_submit_direct_hook()
8518 dip->errors = 1; in btrfs_submit_direct_hook()
8525 if (atomic_dec_and_test(&dip->pending_bios)) in btrfs_submit_direct_hook()
8526 bio_io_error(dip->orig_bio); in btrfs_submit_direct_hook()
8535 struct btrfs_dio_private *dip = NULL; in btrfs_submit_direct() local
8543 dip = kzalloc(sizeof(*dip), GFP_NOFS); in btrfs_submit_direct()
8544 if (!dip) { in btrfs_submit_direct()
8549 dip->private = dio_bio->bi_private; in btrfs_submit_direct()
8550 dip->inode = inode; in btrfs_submit_direct()
8551 dip->logical_offset = file_offset; in btrfs_submit_direct()
8552 dip->bytes = dio_bio->bi_iter.bi_size; in btrfs_submit_direct()
8553 dip->disk_bytenr = (u64)dio_bio->bi_iter.bi_sector << 9; in btrfs_submit_direct()
8554 bio->bi_private = dip; in btrfs_submit_direct()
8555 dip->orig_bio = bio; in btrfs_submit_direct()
8556 dip->dio_bio = dio_bio; in btrfs_submit_direct()
8557 atomic_set(&dip->pending_bios, 1); in btrfs_submit_direct()
8565 dip->subio_endio = btrfs_subio_endio_read; in btrfs_submit_direct()
8577 dio_data->unsubmitted_oe_range_end = dip->logical_offset + in btrfs_submit_direct()
8578 dip->bytes; in btrfs_submit_direct()
8583 ret = btrfs_submit_direct_hook(dip); in btrfs_submit_direct()
8600 if (bio && dip) { in btrfs_submit_direct()
8607 dip = NULL; in btrfs_submit_direct()
8628 kfree(dip); in btrfs_submit_direct()