diff options
author | Richard Weinberger <richard@nod.at> | 2018-07-12 07:01:57 -0400 |
---|---|---|
committer | Richard Weinberger <richard@nod.at> | 2018-08-14 18:25:21 -0400 |
commit | 6eb61d587f4515e4be5669eff383c0185009954f (patch) | |
tree | a5d3183e104338319152a888e0ff980c2546e6e1 /fs/ubifs/replay.c | |
parent | 54169ddd382d461f7c01cc5a5182a4b4bc539489 (diff) |
ubifs: Pass struct ubifs_info to ubifs_assert()
This allows us to have more context in ubifs_assert()
and take different actions depending on the configuration.
Signed-off-by: Richard Weinberger <richard@nod.at>
Diffstat (limited to 'fs/ubifs/replay.c')
-rw-r--r-- | fs/ubifs/replay.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/fs/ubifs/replay.c b/fs/ubifs/replay.c index 85c2a43082b7..4844538eb926 100644 --- a/fs/ubifs/replay.c +++ b/fs/ubifs/replay.c | |||
@@ -273,6 +273,7 @@ static int apply_replay_entry(struct ubifs_info *c, struct replay_entry *r) | |||
273 | static int replay_entries_cmp(void *priv, struct list_head *a, | 273 | static int replay_entries_cmp(void *priv, struct list_head *a, |
274 | struct list_head *b) | 274 | struct list_head *b) |
275 | { | 275 | { |
276 | struct ubifs_info *c = priv; | ||
276 | struct replay_entry *ra, *rb; | 277 | struct replay_entry *ra, *rb; |
277 | 278 | ||
278 | cond_resched(); | 279 | cond_resched(); |
@@ -281,7 +282,7 @@ static int replay_entries_cmp(void *priv, struct list_head *a, | |||
281 | 282 | ||
282 | ra = list_entry(a, struct replay_entry, list); | 283 | ra = list_entry(a, struct replay_entry, list); |
283 | rb = list_entry(b, struct replay_entry, list); | 284 | rb = list_entry(b, struct replay_entry, list); |
284 | ubifs_assert(ra->sqnum != rb->sqnum); | 285 | ubifs_assert(c, ra->sqnum != rb->sqnum); |
285 | if (ra->sqnum > rb->sqnum) | 286 | if (ra->sqnum > rb->sqnum) |
286 | return 1; | 287 | return 1; |
287 | return -1; | 288 | return -1; |
@@ -668,9 +669,9 @@ static int replay_bud(struct ubifs_info *c, struct bud_entry *b) | |||
668 | goto out; | 669 | goto out; |
669 | } | 670 | } |
670 | 671 | ||
671 | ubifs_assert(ubifs_search_bud(c, lnum)); | 672 | ubifs_assert(c, ubifs_search_bud(c, lnum)); |
672 | ubifs_assert(sleb->endpt - offs >= used); | 673 | ubifs_assert(c, sleb->endpt - offs >= used); |
673 | ubifs_assert(sleb->endpt % c->min_io_size == 0); | 674 | ubifs_assert(c, sleb->endpt % c->min_io_size == 0); |
674 | 675 | ||
675 | b->dirty = sleb->endpt - offs - used; | 676 | b->dirty = sleb->endpt - offs - used; |
676 | b->free = c->leb_size - sleb->endpt; | 677 | b->free = c->leb_size - sleb->endpt; |
@@ -706,7 +707,7 @@ static int replay_buds(struct ubifs_info *c) | |||
706 | if (err) | 707 | if (err) |
707 | return err; | 708 | return err; |
708 | 709 | ||
709 | ubifs_assert(b->sqnum > prev_sqnum); | 710 | ubifs_assert(c, b->sqnum > prev_sqnum); |
710 | prev_sqnum = b->sqnum; | 711 | prev_sqnum = b->sqnum; |
711 | } | 712 | } |
712 | 713 | ||
@@ -1067,7 +1068,7 @@ int ubifs_replay_journal(struct ubifs_info *c) | |||
1067 | c->bi.uncommitted_idx = atomic_long_read(&c->dirty_zn_cnt); | 1068 | c->bi.uncommitted_idx = atomic_long_read(&c->dirty_zn_cnt); |
1068 | c->bi.uncommitted_idx *= c->max_idx_node_sz; | 1069 | c->bi.uncommitted_idx *= c->max_idx_node_sz; |
1069 | 1070 | ||
1070 | ubifs_assert(c->bud_bytes <= c->max_bud_bytes || c->need_recovery); | 1071 | ubifs_assert(c, c->bud_bytes <= c->max_bud_bytes || c->need_recovery); |
1071 | dbg_mnt("finished, log head LEB %d:%d, max_sqnum %llu, highest_inum %lu", | 1072 | dbg_mnt("finished, log head LEB %d:%d, max_sqnum %llu, highest_inum %lu", |
1072 | c->lhead_lnum, c->lhead_offs, c->max_sqnum, | 1073 | c->lhead_lnum, c->lhead_offs, c->max_sqnum, |
1073 | (unsigned long)c->highest_inum); | 1074 | (unsigned long)c->highest_inum); |