aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/dm-exception-store.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/md/dm-exception-store.c')
-rw-r--r--drivers/md/dm-exception-store.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/drivers/md/dm-exception-store.c b/drivers/md/dm-exception-store.c
index 41f408068a7c..824cf31967c5 100644
--- a/drivers/md/dm-exception-store.c
+++ b/drivers/md/dm-exception-store.c
@@ -209,6 +209,14 @@ static int chunk_io(struct pstore *ps, uint32_t chunk, int rw, int metadata)
209} 209}
210 210
211/* 211/*
212 * Convert a metadata area index to a chunk index.
213 */
214static chunk_t area_location(struct pstore *ps, chunk_t area)
215{
216 return 1 + ((ps->exceptions_per_area + 1) * area);
217}
218
219/*
212 * Read or write a metadata area. Remembering to skip the first 220 * Read or write a metadata area. Remembering to skip the first
213 * chunk which holds the header. 221 * chunk which holds the header.
214 */ 222 */
@@ -217,8 +225,7 @@ static int area_io(struct pstore *ps, uint32_t area, int rw)
217 int r; 225 int r;
218 uint32_t chunk; 226 uint32_t chunk;
219 227
220 /* convert a metadata area index to a chunk index */ 228 chunk = area_location(ps, area);
221 chunk = 1 + ((ps->exceptions_per_area + 1) * area);
222 229
223 r = chunk_io(ps, chunk, rw, 0); 230 r = chunk_io(ps, chunk, rw, 0);
224 if (r) 231 if (r)