dm-bufio.c (712cba5d87a6c0e980ee5fad45734e189c4d7151) | dm-bufio.c (3a83f4677539bce8eaa2bca9ee9c20e172d7ab04) |
---|---|
1/* 2 * Copyright (C) 2009-2011 Red Hat, Inc. 3 * 4 * Author: Mikulas Patocka <mpatocka@redhat.com> 5 * 6 * This file is released under the GPL. 7 */ 8 --- 597 unchanged lines hidden (view full) --- 606} 607 608static void use_inline_bio(struct dm_buffer *b, int rw, sector_t block, 609 bio_end_io_t *end_io) 610{ 611 char *ptr; 612 int len; 613 | 1/* 2 * Copyright (C) 2009-2011 Red Hat, Inc. 3 * 4 * Author: Mikulas Patocka <mpatocka@redhat.com> 5 * 6 * This file is released under the GPL. 7 */ 8 --- 597 unchanged lines hidden (view full) --- 606} 607 608static void use_inline_bio(struct dm_buffer *b, int rw, sector_t block, 609 bio_end_io_t *end_io) 610{ 611 char *ptr; 612 int len; 613 |
614 bio_init(&b->bio); 615 b->bio.bi_io_vec = b->bio_vec; 616 b->bio.bi_max_vecs = DM_BUFIO_INLINE_VECS; | 614 bio_init(&b->bio, b->bio_vec, DM_BUFIO_INLINE_VECS); |
617 b->bio.bi_iter.bi_sector = block << b->c->sectors_per_block_bits; 618 b->bio.bi_bdev = b->c->bdev; 619 b->bio.bi_end_io = inline_endio; 620 /* 621 * Use of .bi_private isn't a problem here because 622 * the dm_buffer's inline bio is local to bufio. 623 */ 624 b->bio.bi_private = end_io; --- 686 unchanged lines hidden (view full) --- 1311 1312/* 1313 * Use dm-io to send and empty barrier flush the device. 1314 */ 1315int dm_bufio_issue_flush(struct dm_bufio_client *c) 1316{ 1317 struct dm_io_request io_req = { 1318 .bi_op = REQ_OP_WRITE, | 615 b->bio.bi_iter.bi_sector = block << b->c->sectors_per_block_bits; 616 b->bio.bi_bdev = b->c->bdev; 617 b->bio.bi_end_io = inline_endio; 618 /* 619 * Use of .bi_private isn't a problem here because 620 * the dm_buffer's inline bio is local to bufio. 621 */ 622 b->bio.bi_private = end_io; --- 686 unchanged lines hidden (view full) --- 1309 1310/* 1311 * Use dm-io to send and empty barrier flush the device. 1312 */ 1313int dm_bufio_issue_flush(struct dm_bufio_client *c) 1314{ 1315 struct dm_io_request io_req = { 1316 .bi_op = REQ_OP_WRITE, |
1319 .bi_op_flags = WRITE_FLUSH, | 1317 .bi_op_flags = REQ_PREFLUSH, |
1320 .mem.type = DM_IO_KMEM, 1321 .mem.ptr.addr = NULL, 1322 .client = c->dm_io, 1323 }; 1324 struct dm_io_region io_reg = { 1325 .bdev = c->bdev, 1326 .sector = 0, 1327 .count = 0, --- 626 unchanged lines hidden --- | 1318 .mem.type = DM_IO_KMEM, 1319 .mem.ptr.addr = NULL, 1320 .client = c->dm_io, 1321 }; 1322 struct dm_io_region io_reg = { 1323 .bdev = c->bdev, 1324 .sector = 0, 1325 .count = 0, --- 626 unchanged lines hidden --- |