dm.c (040f04bd2e825f1d80b14a0e0ac3d830339eb779) | dm.c (47d951023a242bb159534573a4a76fef9a31dc9b) |
---|---|
1/* 2 * Copyright (C) 2001, 2002 Sistina Software (UK) Limited. 3 * Copyright (C) 2004-2008 Red Hat, Inc. All rights reserved. 4 * 5 * This file is released under the GPL. 6 */ 7 8#include "dm-core.h" --- 1408 unchanged lines hidden (view full) --- 1417 1418 /* 1419 * Use an on-stack bio for this, it's safe since we don't 1420 * need to reference it after submit. It's just used as 1421 * the basis for the clone(s). 1422 */ 1423 bio_init(&flush_bio, NULL, 0); 1424 flush_bio.bi_opf = REQ_OP_WRITE | REQ_PREFLUSH | REQ_SYNC; | 1/* 2 * Copyright (C) 2001, 2002 Sistina Software (UK) Limited. 3 * Copyright (C) 2004-2008 Red Hat, Inc. All rights reserved. 4 * 5 * This file is released under the GPL. 6 */ 7 8#include "dm-core.h" --- 1408 unchanged lines hidden (view full) --- 1417 1418 /* 1419 * Use an on-stack bio for this, it's safe since we don't 1420 * need to reference it after submit. It's just used as 1421 * the basis for the clone(s). 1422 */ 1423 bio_init(&flush_bio, NULL, 0); 1424 flush_bio.bi_opf = REQ_OP_WRITE | REQ_PREFLUSH | REQ_SYNC; |
1425 flush_bio.bi_disk = ci->io->md->disk; 1426 bio_associate_blkg(&flush_bio); 1427 |
|
1425 ci->bio = &flush_bio; 1426 ci->sector_count = 0; 1427 | 1428 ci->bio = &flush_bio; 1429 ci->sector_count = 0; 1430 |
1428 /* 1429 * Empty flush uses a statically initialized bio, as the base for 1430 * cloning. However, blkg association requires that a bdev is 1431 * associated with a gendisk, which doesn't happen until the bdev is 1432 * opened. So, blkg association is done at issue time of the flush 1433 * rather than when the device is created in alloc_dev(). 1434 */ 1435 bio_set_dev(ci->bio, ci->io->md->bdev); 1436 | |
1437 BUG_ON(bio_has_data(ci->bio)); 1438 while ((ti = dm_table_get_target(ci->map, target_nr++))) 1439 __send_duplicate_bios(ci, ti, ti->num_flush_bios, NULL); 1440 1441 bio_uninit(ci->bio); 1442 return 0; 1443} 1444 --- 1673 unchanged lines hidden --- | 1431 BUG_ON(bio_has_data(ci->bio)); 1432 while ((ti = dm_table_get_target(ci->map, target_nr++))) 1433 __send_duplicate_bios(ci, ti, ti->num_flush_bios, NULL); 1434 1435 bio_uninit(ci->bio); 1436 return 0; 1437} 1438 --- 1673 unchanged lines hidden --- |