提交 87c961cb 编写于 作者: T Tomohiro Kusumi 提交者: Alasdair G Kergon

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: NTomohiro Kusumi <kusumi.tomohiro@jp.fujitsu.com>
Signed-off-by: NMikulas Patocka <mpatocka@redhat.com>
Signed-off-by: NAlasdair G Kergon <agk@redhat.com>
上级 a9c88f2e
...@@ -266,7 +266,7 @@ static int chunk_io(struct pstore *ps, void *area, chunk_t chunk, int rw, ...@@ -266,7 +266,7 @@ static int chunk_io(struct pstore *ps, void *area, chunk_t chunk, int rw,
*/ */
static chunk_t area_location(struct pstore *ps, chunk_t area) static chunk_t area_location(struct pstore *ps, chunk_t area)
{ {
return 1 + ((ps->exceptions_per_area + 1) * area); return NUM_SNAPSHOT_HDR_CHUNKS + ((ps->exceptions_per_area + 1) * area);
} }
/* /*
...@@ -780,8 +780,8 @@ static int persistent_commit_merge(struct dm_exception_store *store, ...@@ -780,8 +780,8 @@ static int persistent_commit_merge(struct dm_exception_store *store,
* ps->current_area does not get reduced by prepare_merge() until * ps->current_area does not get reduced by prepare_merge() until
* after commit_merge() has removed the nr_merged previous exceptions. * after commit_merge() has removed the nr_merged previous exceptions.
*/ */
ps->next_free = (area_location(ps, ps->current_area) - 1) + ps->next_free = area_location(ps, ps->current_area) +
(ps->current_committed + 1) + NUM_SNAPSHOT_HDR_CHUNKS; ps->current_committed + 1;
return 0; return 0;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册