Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 38089
b: refs/heads/master
c: e4ff496
h: refs/heads/master
i:
  38087: 6ea0a31
v: v3
  • Loading branch information
Mark McLoughlin authored and Linus Torvalds committed Oct 3, 2006
1 parent 114962c commit 50372a5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 25 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: f9cea4f70734f743e0beb55552a9794fa5032645
refs/heads/master: e4ff496db72473949ddfe29a37471969d2f1d4ee
32 changes: 8 additions & 24 deletions trunk/drivers/md/dm-exception-store.c
Original file line number Diff line number Diff line change
Expand Up @@ -296,42 +296,29 @@ static int write_header(struct pstore *ps)
*/
static struct disk_exception *get_exception(struct pstore *ps, uint32_t index)
{
if (index >= ps->exceptions_per_area)
return NULL;
BUG_ON(index >= ps->exceptions_per_area);

return ((struct disk_exception *) ps->area) + index;
}

static int read_exception(struct pstore *ps,
uint32_t index, struct disk_exception *result)
static void read_exception(struct pstore *ps,
uint32_t index, struct disk_exception *result)
{
struct disk_exception *e;

e = get_exception(ps, index);
if (!e)
return -EINVAL;
struct disk_exception *e = get_exception(ps, index);

/* copy it */
result->old_chunk = le64_to_cpu(e->old_chunk);
result->new_chunk = le64_to_cpu(e->new_chunk);

return 0;
}

static int write_exception(struct pstore *ps,
uint32_t index, struct disk_exception *de)
static void write_exception(struct pstore *ps,
uint32_t index, struct disk_exception *de)
{
struct disk_exception *e;

e = get_exception(ps, index);
if (!e)
return -EINVAL;
struct disk_exception *e = get_exception(ps, index);

/* copy it */
e->old_chunk = cpu_to_le64(de->old_chunk);
e->new_chunk = cpu_to_le64(de->new_chunk);

return 0;
}

/*
Expand All @@ -349,10 +336,7 @@ static int insert_exceptions(struct pstore *ps, int *full)
*full = 1;

for (i = 0; i < ps->exceptions_per_area; i++) {
r = read_exception(ps, i, &de);

if (r)
return r;
read_exception(ps, i, &de);

/*
* If the new_chunk is pointing at the start of
Expand Down

0 comments on commit 50372a5

Please sign in to comment.