From 60a5597c148fce14857813e9482d08113b7d79a9 Mon Sep 17 00:00:00 2001 From: Mikulas Patocka Date: Fri, 10 Oct 2008 13:37:00 +0100 Subject: [PATCH] --- yaml --- r: 110629 b: refs/heads/master c: a481db784682b33d078c7bf8a1d0581dc09946c1 h: refs/heads/master i: 110627: 643842a2b355d192e2e2b69a63e635dcade46fbb v: v3 --- [refs] | 2 +- trunk/drivers/md/dm-exception-store.c | 11 +++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/[refs] b/[refs] index f585556b016d..bdd2fdb2c6e1 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: f7c83e2e4783c4f7abe6f3a85a8c5e210f98bc7b +refs/heads/master: a481db784682b33d078c7bf8a1d0581dc09946c1 diff --git a/trunk/drivers/md/dm-exception-store.c b/trunk/drivers/md/dm-exception-store.c index 41f408068a7c..824cf31967c5 100644 --- a/trunk/drivers/md/dm-exception-store.c +++ b/trunk/drivers/md/dm-exception-store.c @@ -208,6 +208,14 @@ static int chunk_io(struct pstore *ps, uint32_t chunk, int rw, int metadata) return req.result; } +/* + * Convert a metadata area index to a chunk index. + */ +static chunk_t area_location(struct pstore *ps, chunk_t area) +{ + return 1 + ((ps->exceptions_per_area + 1) * area); +} + /* * Read or write a metadata area. Remembering to skip the first * chunk which holds the header. @@ -217,8 +225,7 @@ static int area_io(struct pstore *ps, uint32_t area, int rw) int r; uint32_t chunk; - /* convert a metadata area index to a chunk index */ - chunk = 1 + ((ps->exceptions_per_area + 1) * area); + chunk = area_location(ps, area); r = chunk_io(ps, chunk, rw, 0); if (r)