Lines Matching refs:block

42  * The block size of the device holding pool data must be
64 * When we get a write in we decide if it's to a shared data block using
67 * Let's say we write to a shared block in what was the origin. The
70 * i) plug io further to this physical block. (see bio_prison code).
72 * ii) quiesce any read io to that shared data block. Obviously
73 * including all devices that share this block. (see dm_deferred_set code)
75 * iii) copy the data block to a newly allocate block. This step can be
76 * missed out if the io covers the block. (schedule_copy).
82 * devices that share the block never change. The btree for the origin
86 * v) unplug io to this physical block, including the io that triggered
92 * get away with this because the io is always written to a _new_ block.
95 * - The origin mapping will point to the old origin block (the shared
99 * - The snap mapping still points to the old block. As it would after
103 * will continue to think that data block in the snapshot device is shared
107 * devices that reference this data block. At the moment I think the
451 * This might block but it can't fail.
706 /* Can happen if the bio is within a single block. */
714 static void remap(struct thin_c *tc, struct bio *bio, dm_block_t block)
722 (block << pool->sectors_per_block_shift) |
725 bio->bi_iter.bi_sector = (block * pool->sectors_per_block) +
787 dm_block_t block)
789 remap(tc, bio, block);
806 * counter hits zero the block is prepared and can be inserted into the
818 * If the bio covers the whole area of a block then we can avoid
929 dm_block_t block)
950 remap_and_issue(info.tc, bio, block);
1005 * Commit the prepared block into the mapping btree.
1006 * Any I/O for this block arriving after this point will get
1017 * Release any bios held while the block was being provisioned.
1018 * If we are processing a write bio that completely covers the block,
1337 * If the whole block of data is being overwritten, we can issue the
1394 * If the whole block of data is being overwritten or we are not
1713 * IO may still be going to the destination block. We must
1775 * The discard covers less than a block.
1801 static void break_sharing(struct thin_c *tc, struct bio *bio, dm_block_t block,
1813 schedule_internal_copy(tc, block, lookup_result->block,
1851 dm_block_t block)
1867 remap_and_issue(tc, bio, block);
1871 dm_block_t block,
1883 build_data_key(tc->td, lookup_result->block, &key);
1890 break_sharing(tc, bio, block, &key, lookup_result, data_cell);
1897 remap_and_issue(tc, bio, lookup_result->block);
1899 remap_and_issue_shared_cell(tc, data_cell, lookup_result->block);
1900 remap_and_issue_shared_cell(tc, virt_cell, lookup_result->block);
1904 static void provision_block(struct thin_c *tc, struct bio *bio, dm_block_t block,
1936 schedule_external_copy(tc, block, data_block, cell, bio);
1938 schedule_zero(tc, block, data_block, cell, bio);
1958 dm_block_t block = get_bio_block(tc, bio);
1966 r = dm_thin_find_block(tc->td, block, 1, &lookup_result);
1970 process_shared_bio(tc, bio, block, &lookup_result, cell);
1973 remap_and_issue(tc, bio, lookup_result.block);
1974 inc_remap_and_issue_cell(tc, cell, lookup_result.block);
1996 provision_block(tc, bio, block, cell);
2011 dm_block_t block = get_bio_block(tc, bio);
2016 * If cell is already occupied, then the block is already
2019 build_virtual_key(tc->td, block, &key);
2031 dm_block_t block = get_bio_block(tc, bio);
2034 r = dm_thin_find_block(tc->td, block, 1, &lookup_result);
2043 remap_and_issue(tc, bio, lookup_result.block);
2045 inc_remap_and_issue_cell(tc, cell, lookup_result.block);
2326 * We can't hold rcu_read_lock() around code that can block. So we
2725 dm_block_t block = get_bio_block(tc, bio);
2753 build_virtual_key(tc->td, block, &key);
2757 r = dm_thin_find_block(td, block, 0, &result);
2783 build_data_key(tc->td, result.block, &key);
2793 remap(tc, bio, result.block);
2855 reason = "max discard sectors smaller than a block";
3211 * external snapshots and in the case of newly provisioned blocks, when block
3274 * <data block size (sectors)>
3333 ti->error = "Error opening metadata block device";
3348 ti->error = "Invalid block size";
4105 * block layer will stack them if pool's data device has support.