Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 110629
b: refs/heads/master
c: a481db7
h: refs/heads/master
i:
  110627: 643842a
v: v3
  • Loading branch information
Mikulas Patocka authored and Alasdair G Kergon committed Oct 10, 2008
1 parent 7eade6a commit 60a5597
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f7c83e2e4783c4f7abe6f3a85a8c5e210f98bc7b
refs/heads/master: a481db784682b33d078c7bf8a1d0581dc09946c1
11 changes: 9 additions & 2 deletions trunk/drivers/md/dm-exception-store.c
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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)
Expand Down

0 comments on commit 60a5597

Please sign in to comment.