Lines Matching defs:bio
12 #include <linux/bio.h>
17 * fscrypt_decrypt_bio() - decrypt the contents of a bio
18 * @bio: the bio to decrypt
20 * Decrypt the contents of a "read" bio following successful completion of the
21 * underlying disk read. The bio must be reading a whole number of blocks of an
22 * encrypted file directly into the page cache. If the bio is reading the
26 * called from a workqueue rather than from the bio's bi_end_io callback.
28 * Return: %true on success; %false on failure. On failure, bio->bi_status is
31 bool fscrypt_decrypt_bio(struct bio *bio)
35 bio_for_each_folio_all(fi, bio) {
40 bio->bi_status = errno_to_blk_status(err);
54 struct bio *bio;
59 bio = bio_alloc(inode->i_sb->s_bdev, BIO_MAX_VECS, REQ_OP_WRITE,
67 fscrypt_set_bio_crypt_ctx(bio, inode, lblk, GFP_NOFS);
68 bio->bi_iter.bi_sector =
71 ret = bio_add_page(bio, ZERO_PAGE(0), bytes_this_page, 0);
81 !fscrypt_mergeable_bio(bio, inode, lblk)) {
82 err = submit_bio_wait(bio);
85 bio_reset(bio, inode->i_sb->s_bdev, REQ_OP_WRITE);
90 bio_put(bio);
122 struct bio *bio;
154 bio = bio_alloc(inode->i_sb->s_bdev, nr_pages, REQ_OP_WRITE, GFP_NOFS);
157 bio->bi_iter.bi_sector = pblk << (blockbits - 9);
172 ret = bio_add_page(bio, pages[i++], offset, 0);
181 err = submit_bio_wait(bio);
184 bio_reset(bio, inode->i_sb->s_bdev, REQ_OP_WRITE);
188 bio_put(bio);