diff options
author | Jonathan Brassow <jbrassow@redhat.com> | 2009-04-02 14:55:33 -0400 |
---|---|---|
committer | Alasdair G Kergon <agk@redhat.com> | 2009-04-02 14:55:33 -0400 |
commit | 71fab00a6bef7fb53119271a8abdbaf40970d28a (patch) | |
tree | 4881f8f6d1b1c42528889d7a56fb8674d2aa7723 /drivers/md/dm-snap.h | |
parent | 49beb2b87a972a994ff77633234ca3bf0d30a1d8 (diff) |
dm snapshot: remove dm_snap header use
Move useful functions out of dm-snap.h and stop using dm-snap.h.
Signed-off-by: Jonathan Brassow <jbrassow@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
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) |