diff options
Diffstat (limited to 'drivers/md/dm-snap.h')
-rw-r--r-- | drivers/md/dm-snap.h | 18 |
1 files changed, 3 insertions, 15 deletions
diff --git a/drivers/md/dm-snap.h b/drivers/md/dm-snap.h index c8a486e0ea2c..4f61bc4c14f6 100644 --- a/drivers/md/dm-snap.h +++ b/drivers/md/dm-snap.h | |||
@@ -68,22 +68,10 @@ struct dm_snapshot { | |||
68 | struct hlist_head tracked_chunk_hash[DM_TRACKED_CHUNK_HASH_SIZE]; | 68 | struct hlist_head tracked_chunk_hash[DM_TRACKED_CHUNK_HASH_SIZE]; |
69 | }; | 69 | }; |
70 | 70 | ||
71 | /* | 71 | static inline sector_t chunk_to_sector(struct dm_exception_store *store, |
72 | * Return the number of sectors in the device. | 72 | chunk_t chunk) |
73 | */ | ||
74 | static inline sector_t get_dev_size(struct block_device *bdev) | ||
75 | { | ||
76 | return bdev->bd_inode->i_size >> SECTOR_SHIFT; | ||
77 | } | ||
78 | |||
79 | static inline chunk_t sector_to_chunk(struct dm_snapshot *s, sector_t sector) | ||
80 | { | ||
81 | return (sector & ~s->store->chunk_mask) >> s->store->chunk_shift; | ||
82 | } | ||
83 | |||
84 | static inline sector_t chunk_to_sector(struct dm_snapshot *s, chunk_t chunk) | ||
85 | { | 73 | { |
86 | return chunk << s->store->chunk_shift; | 74 | return chunk << store->chunk_shift; |
87 | } | 75 | } |
88 | 76 | ||
89 | static inline int bdev_equal(struct block_device *lhs, struct block_device *rhs) | 77 | static inline int bdev_equal(struct block_device *lhs, struct block_device *rhs) |