Lines Matching refs:bvec
59 static int zram_bvec_read(struct zram *zram, struct bio_vec *bvec,
149 static inline bool is_partial_io(struct bio_vec *bvec) in is_partial_io() argument
151 return bvec->bv_len != PAGE_SIZE; in is_partial_io()
154 static inline bool is_partial_io(struct bio_vec *bvec) in is_partial_io() argument
184 static void update_position(u32 *index, int *offset, struct bio_vec *bvec) in update_position() argument
186 *index += (*offset + bvec->bv_len) / PAGE_SIZE; in update_position()
187 *offset = (*offset + bvec->bv_len) % PAGE_SIZE; in update_position()
595 static int read_from_bdev_async(struct zram *zram, struct bio_vec *bvec, in read_from_bdev_async() argument
606 if (!bio_add_page(bio, bvec->bv_page, bvec->bv_len, bvec->bv_offset)) { in read_from_bdev_async()
677 struct bio_vec bvec; in writeback_store() local
679 bvec.bv_page = page; in writeback_store()
680 bvec.bv_len = PAGE_SIZE; in writeback_store()
681 bvec.bv_offset = 0; in writeback_store()
722 if (zram_bvec_read(zram, &bvec, index, 0, NULL)) { in writeback_store()
735 bio_add_page(&bio, bvec.bv_page, bvec.bv_len, in writeback_store()
736 bvec.bv_offset); in writeback_store()
801 struct bio_vec bvec; member
812 read_from_bdev_async(zram, &zw->bvec, entry, bio); in zram_sync_read()
820 static int read_from_bdev_sync(struct zram *zram, struct bio_vec *bvec, in read_from_bdev_sync() argument
825 work.bvec = *bvec; in read_from_bdev_sync()
838 static int read_from_bdev_sync(struct zram *zram, struct bio_vec *bvec, in read_from_bdev_sync() argument
846 static int read_from_bdev(struct zram *zram, struct bio_vec *bvec, in read_from_bdev() argument
851 return read_from_bdev_sync(zram, bvec, entry, parent); in read_from_bdev()
853 return read_from_bdev_async(zram, bvec, entry, parent); in read_from_bdev()
857 static int read_from_bdev(struct zram *zram, struct bio_vec *bvec, in read_from_bdev() argument
1247 struct bio_vec bvec; in __zram_bvec_read() local
1251 bvec.bv_page = page; in __zram_bvec_read()
1252 bvec.bv_len = PAGE_SIZE; in __zram_bvec_read()
1253 bvec.bv_offset = 0; in __zram_bvec_read()
1254 return read_from_bdev(zram, &bvec, in __zram_bvec_read()
1299 static int zram_bvec_read(struct zram *zram, struct bio_vec *bvec, in zram_bvec_read() argument
1305 page = bvec->bv_page; in zram_bvec_read()
1306 if (is_partial_io(bvec)) { in zram_bvec_read()
1313 ret = __zram_bvec_read(zram, page, index, bio, is_partial_io(bvec)); in zram_bvec_read()
1317 if (is_partial_io(bvec)) { in zram_bvec_read()
1318 void *dst = kmap_atomic(bvec->bv_page); in zram_bvec_read()
1321 memcpy(dst + bvec->bv_offset, src + offset, bvec->bv_len); in zram_bvec_read()
1326 if (is_partial_io(bvec)) in zram_bvec_read()
1332 static int __zram_bvec_write(struct zram *zram, struct bio_vec *bvec, in __zram_bvec_write() argument
1341 struct page *page = bvec->bv_page; in __zram_bvec_write()
1449 static int zram_bvec_write(struct zram *zram, struct bio_vec *bvec, in zram_bvec_write() argument
1457 vec = *bvec; in zram_bvec_write()
1458 if (is_partial_io(bvec)) { in zram_bvec_write()
1472 src = kmap_atomic(bvec->bv_page); in zram_bvec_write()
1474 memcpy(dst + offset, src + bvec->bv_offset, bvec->bv_len); in zram_bvec_write()
1485 if (is_partial_io(bvec)) in zram_bvec_write()
1533 static int zram_bvec_rw(struct zram *zram, struct bio_vec *bvec, u32 index, in zram_bvec_rw() argument
1540 ret = zram_bvec_read(zram, bvec, index, offset, bio); in zram_bvec_rw()
1541 flush_dcache_page(bvec->bv_page); in zram_bvec_rw()
1544 ret = zram_bvec_write(zram, bvec, index, offset, bio); in zram_bvec_rw()
1565 struct bio_vec bvec; in __zram_make_request() local
1584 bio_for_each_segment(bvec, bio, iter) { in __zram_make_request()
1585 struct bio_vec bv = bvec; in __zram_make_request()
1586 unsigned int unwritten = bvec.bv_len; in __zram_make_request()