diff options
author | Richard Weinberger <richard@nod.at> | 2018-07-12 13:01:57 +0200 |
---|---|---|
committer | Richard Weinberger <richard@nod.at> | 2018-08-15 00:25:21 +0200 |
commit | 6eb61d587f4515e4be5669eff383c0185009954f (patch) | |
tree | a5d3183e104338319152a888e0ff980c2546e6e1 /fs/ubifs/orphan.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/orphan.c')
-rw-r--r-- | fs/ubifs/orphan.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/fs/ubifs/orphan.c b/fs/ubifs/orphan.c index caf2d123e9ee..8f70494efb0c 100644 --- a/fs/ubifs/orphan.c +++ b/fs/ubifs/orphan.c @@ -172,8 +172,8 @@ int ubifs_orphan_start_commit(struct ubifs_info *c) spin_lock(&c->orphan_lock); last = &c->orph_cnext; list_for_each_entry(orphan, &c->orph_new, new_list) { - ubifs_assert(orphan->new); - ubifs_assert(!orphan->cmt); + ubifs_assert(c, orphan->new); + ubifs_assert(c, !orphan->cmt); orphan->new = 0; orphan->cmt = 1; *last = orphan; @@ -244,7 +244,7 @@ static int do_write_orph_node(struct ubifs_info *c, int len, int atomic) int err = 0; if (atomic) { - ubifs_assert(c->ohead_offs == 0); + ubifs_assert(c, c->ohead_offs == 0); ubifs_prepare_node(c, c->orph_buf, len, 1); len = ALIGN(len, c->min_io_size); err = ubifs_leb_change(c, c->ohead_lnum, c->orph_buf, len); @@ -276,7 +276,7 @@ static int write_orph_node(struct ubifs_info *c, int atomic) struct ubifs_orph_node *orph; int gap, err, len, cnt, i; - ubifs_assert(c->cmt_orphans > 0); + ubifs_assert(c, c->cmt_orphans > 0); gap = c->leb_size - c->ohead_offs; if (gap < UBIFS_ORPH_NODE_SZ + sizeof(__le64)) { c->ohead_lnum += 1; @@ -295,14 +295,14 @@ static int write_orph_node(struct ubifs_info *c, int atomic) if (cnt > c->cmt_orphans) cnt = c->cmt_orphans; len = UBIFS_ORPH_NODE_SZ + cnt * sizeof(__le64); - ubifs_assert(c->orph_buf); + ubifs_assert(c, c->orph_buf); orph = c->orph_buf; orph->ch.node_type = UBIFS_ORPH_NODE; spin_lock(&c->orphan_lock); cnext = c->orph_cnext; for (i = 0; i < cnt; i++) { orphan = cnext; - ubifs_assert(orphan->cmt); + ubifs_assert(c, orphan->cmt); orph->inos[i] = cpu_to_le64(orphan->inum); orphan->cmt = 0; cnext = orphan->cnext; @@ -316,9 +316,9 @@ static int write_orph_node(struct ubifs_info *c, int atomic) else /* Mark the last node of the commit */ orph->cmt_no = cpu_to_le64((c->cmt_no) | (1ULL << 63)); - ubifs_assert(c->ohead_offs + len <= c->leb_size); - ubifs_assert(c->ohead_lnum >= c->orph_first); - ubifs_assert(c->ohead_lnum <= c->orph_last); + ubifs_assert(c, c->ohead_offs + len <= c->leb_size); + ubifs_assert(c, c->ohead_lnum >= c->orph_first); + ubifs_assert(c, c->ohead_lnum <= c->orph_last); err = do_write_orph_node(c, len, atomic); c->ohead_offs += ALIGN(len, c->min_io_size); c->ohead_offs = ALIGN(c->ohead_offs, 8); @@ -388,7 +388,7 @@ static int consolidate(struct ubifs_info *c) cnt += 1; } *last = NULL; - ubifs_assert(cnt == c->tot_orphans - c->new_orphans); + ubifs_assert(c, cnt == c->tot_orphans - c->new_orphans); c->cmt_orphans = cnt; c->ohead_lnum = c->orph_first; c->ohead_offs = 0; @@ -415,7 +415,7 @@ static int commit_orphans(struct ubifs_info *c) { int avail, atomic = 0, err; - ubifs_assert(c->cmt_orphans > 0); + ubifs_assert(c, c->cmt_orphans > 0); avail = avail_orphs(c); if (avail < c->cmt_orphans) { /* Not enough space to write new orphans, so consolidate */ @@ -446,8 +446,8 @@ static void erase_deleted(struct ubifs_info *c) while (dnext) { orphan = dnext; dnext = orphan->dnext; - ubifs_assert(!orphan->new); - ubifs_assert(orphan->del); + ubifs_assert(c, !orphan->new); + ubifs_assert(c, orphan->del); rb_erase(&orphan->rb, &c->orph_tree); list_del(&orphan->list); c->tot_orphans -= 1; |