Lines Matching refs:bvec
137 static inline bool is_partial_io(struct bio_vec *bvec) in is_partial_io() argument
139 return bvec->bv_len != PAGE_SIZE; in is_partial_io()
142 static inline bool is_partial_io(struct bio_vec *bvec) in is_partial_io() argument
172 static void update_position(u32 *index, int *offset, struct bio_vec *bvec) in update_position() argument
174 *index += (*offset + bvec->bv_len) / PAGE_SIZE; in update_position()
175 *offset = (*offset + bvec->bv_len) % PAGE_SIZE; in update_position()
484 static int read_from_bdev_async(struct zram *zram, struct bio_vec *bvec, in read_from_bdev_async() argument
495 if (!bio_add_page(bio, bvec->bv_page, bvec->bv_len, bvec->bv_offset)) { in read_from_bdev_async()
522 struct bio_vec bvec; in zram_sync_read() local
528 read_from_bdev_async(zram, &bvec, entry, bio); in zram_sync_read()
536 static int read_from_bdev_sync(struct zram *zram, struct bio_vec *bvec, in read_from_bdev_sync() argument
553 static int read_from_bdev_sync(struct zram *zram, struct bio_vec *bvec, in read_from_bdev_sync() argument
561 static int read_from_bdev(struct zram *zram, struct bio_vec *bvec, in read_from_bdev() argument
565 return read_from_bdev_sync(zram, bvec, entry, parent); in read_from_bdev()
567 return read_from_bdev_async(zram, bvec, entry, parent); in read_from_bdev()
570 static int write_to_bdev(struct zram *zram, struct bio_vec *bvec, in write_to_bdev() argument
589 if (!bio_add_page(bio, bvec->bv_page, bvec->bv_len, in write_to_bdev()
590 bvec->bv_offset)) { in write_to_bdev()
623 static int write_to_bdev(struct zram *zram, struct bio_vec *bvec, in write_to_bdev() argument
631 static int read_from_bdev(struct zram *zram, struct bio_vec *bvec, in read_from_bdev() argument
993 struct bio_vec bvec; in __zram_bvec_read() local
997 bvec.bv_page = page; in __zram_bvec_read()
998 bvec.bv_len = PAGE_SIZE; in __zram_bvec_read()
999 bvec.bv_offset = 0; in __zram_bvec_read()
1000 return read_from_bdev(zram, &bvec, in __zram_bvec_read()
1047 static int zram_bvec_read(struct zram *zram, struct bio_vec *bvec, in zram_bvec_read() argument
1053 page = bvec->bv_page; in zram_bvec_read()
1054 if (is_partial_io(bvec)) { in zram_bvec_read()
1061 ret = __zram_bvec_read(zram, page, index, bio, is_partial_io(bvec)); in zram_bvec_read()
1065 if (is_partial_io(bvec)) { in zram_bvec_read()
1066 void *dst = kmap_atomic(bvec->bv_page); in zram_bvec_read()
1069 memcpy(dst + bvec->bv_offset, src + offset, bvec->bv_len); in zram_bvec_read()
1074 if (is_partial_io(bvec)) in zram_bvec_read()
1080 static int __zram_bvec_write(struct zram *zram, struct bio_vec *bvec, in __zram_bvec_write() argument
1089 struct page *page = bvec->bv_page; in __zram_bvec_write()
1121 ret = write_to_bdev(zram, bvec, index, bio, &element); in __zram_bvec_write()
1210 static int zram_bvec_write(struct zram *zram, struct bio_vec *bvec, in zram_bvec_write() argument
1218 vec = *bvec; in zram_bvec_write()
1219 if (is_partial_io(bvec)) { in zram_bvec_write()
1233 src = kmap_atomic(bvec->bv_page); in zram_bvec_write()
1235 memcpy(dst + offset, src + bvec->bv_offset, bvec->bv_len); in zram_bvec_write()
1246 if (is_partial_io(bvec)) in zram_bvec_write()
1294 static int zram_bvec_rw(struct zram *zram, struct bio_vec *bvec, u32 index, in zram_bvec_rw() argument
1301 generic_start_io_acct(q, op, bvec->bv_len >> SECTOR_SHIFT, in zram_bvec_rw()
1306 ret = zram_bvec_read(zram, bvec, index, offset, bio); in zram_bvec_rw()
1307 flush_dcache_page(bvec->bv_page); in zram_bvec_rw()
1310 ret = zram_bvec_write(zram, bvec, index, offset, bio); in zram_bvec_rw()
1333 struct bio_vec bvec; in __zram_make_request() local
1350 bio_for_each_segment(bvec, bio, iter) { in __zram_make_request()
1351 struct bio_vec bv = bvec; in __zram_make_request()
1352 unsigned int unwritten = bvec.bv_len; in __zram_make_request()