aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/dm-snap-persistent.c
diff options
context:
space:
mode:
authorTomohiro Kusumi <kusumi.tomohiro@jp.fujitsu.com>2010-08-11 23:13:59 -0400
committerAlasdair G Kergon <agk@redhat.com>2010-08-11 23:13:59 -0400
commit87c961cb747fa55b664b76abfcb9d44c14ae851f (patch)
tree2aefac4f795bd211bb60c13c4ea401bd6a747e1b /drivers/md/dm-snap-persistent.c
parenta9c88f2ebc1a5937915cb3b89c9f03894134f39a (diff)
dm snapshot: persistent use define for disk header chunk size
This patch fixes hard-coded value for the size of a chunk that includes disk header for persistent snapshot. It should be changed to existing macro NUM_SNAPSHOT_HDR_CHUNKS instead of using hard-coded value 1. Signed-off-by: Tomohiro Kusumi <kusumi.tomohiro@jp.fujitsu.com> Signed-off-by: Mikulas Patocka <mpatocka@redhat.com> Signed-off-by: Alasdair G Kergon <agk@redhat.com>
Diffstat (limited to 'drivers/md/dm-snap-persistent.c')
-rw-r--r--drivers/md/dm-snap-persistent.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/md/dm-snap-persistent.c b/drivers/md/dm-snap-persistent.c
index c097d8a4823d..cc2bdb83f9ad 100644
--- a/drivers/md/dm-snap-persistent.c
+++ b/drivers/md/dm-snap-persistent.c
@@ -266,7 +266,7 @@ static int chunk_io(struct pstore *ps, void *area, chunk_t chunk, int rw,
266 */ 266 */
267static chunk_t area_location(struct pstore *ps, chunk_t area) 267static chunk_t area_location(struct pstore *ps, chunk_t area)
268{ 268{
269 return 1 + ((ps->exceptions_per_area + 1) * area); 269 return NUM_SNAPSHOT_HDR_CHUNKS + ((ps->exceptions_per_area + 1) * area);
270} 270}
271 271
272/* 272/*
@@ -780,8 +780,8 @@ static int persistent_commit_merge(struct dm_exception_store *store,
780 * ps->current_area does not get reduced by prepare_merge() until 780 * ps->current_area does not get reduced by prepare_merge() until
781 * after commit_merge() has removed the nr_merged previous exceptions. 781 * after commit_merge() has removed the nr_merged previous exceptions.
782 */ 782 */
783 ps->next_free = (area_location(ps, ps->current_area) - 1) + 783 ps->next_free = area_location(ps, ps->current_area) +
784 (ps->current_committed + 1) + NUM_SNAPSHOT_HDR_CHUNKS; 784 ps->current_committed + 1;
785 785
786 return 0; 786 return 0;
787} 787}