diff options
Diffstat (limited to 'drivers/md/dm-exception-store.h')
-rw-r--r-- | drivers/md/dm-exception-store.h | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/drivers/md/dm-exception-store.h b/drivers/md/dm-exception-store.h index 4dbf3577408e..835f402d9470 100644 --- a/drivers/md/dm-exception-store.h +++ b/drivers/md/dm-exception-store.h | |||
@@ -97,8 +97,6 @@ struct dm_exception_store { | |||
97 | struct dm_exception_store_type *type; | 97 | struct dm_exception_store_type *type; |
98 | struct dm_target *ti; | 98 | struct dm_target *ti; |
99 | 99 | ||
100 | struct dm_snapshot *snap; | ||
101 | |||
102 | struct dm_dev *cow; | 100 | struct dm_dev *cow; |
103 | 101 | ||
104 | /* Size of data blocks saved - must be a power of 2 */ | 102 | /* Size of data blocks saved - must be a power of 2 */ |
@@ -152,6 +150,20 @@ static inline void dm_consecutive_chunk_count_inc(struct dm_snap_exception *e) | |||
152 | 150 | ||
153 | # endif | 151 | # endif |
154 | 152 | ||
153 | /* | ||
154 | * Return the number of sectors in the device. | ||
155 | */ | ||
156 | static inline sector_t get_dev_size(struct block_device *bdev) | ||
157 | { | ||
158 | return bdev->bd_inode->i_size >> SECTOR_SHIFT; | ||
159 | } | ||
160 | |||
161 | static inline chunk_t sector_to_chunk(struct dm_exception_store *store, | ||
162 | sector_t sector) | ||
163 | { | ||
164 | return (sector & ~store->chunk_mask) >> store->chunk_shift; | ||
165 | } | ||
166 | |||
155 | int dm_exception_store_type_register(struct dm_exception_store_type *type); | 167 | int dm_exception_store_type_register(struct dm_exception_store_type *type); |
156 | int dm_exception_store_type_unregister(struct dm_exception_store_type *type); | 168 | int dm_exception_store_type_unregister(struct dm_exception_store_type *type); |
157 | 169 | ||