diff options
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 4409f486ecef..caf2d123e9ee 100644 --- a/fs/ubifs/orphan.c +++ b/fs/ubifs/orphan.c | |||
@@ -88,7 +88,7 @@ int ubifs_add_orphan(struct ubifs_info *c, ino_t inum) | |||
88 | else if (inum > o->inum) | 88 | else if (inum > o->inum) |
89 | p = &(*p)->rb_right; | 89 | p = &(*p)->rb_right; |
90 | else { | 90 | else { |
91 | ubifs_err("orphaned twice"); | 91 | ubifs_err(c, "orphaned twice"); |
92 | spin_unlock(&c->orphan_lock); | 92 | spin_unlock(&c->orphan_lock); |
93 | kfree(orphan); | 93 | kfree(orphan); |
94 | return 0; | 94 | return 0; |
@@ -155,7 +155,7 @@ void ubifs_delete_orphan(struct ubifs_info *c, ino_t inum) | |||
155 | } | 155 | } |
156 | } | 156 | } |
157 | spin_unlock(&c->orphan_lock); | 157 | spin_unlock(&c->orphan_lock); |
158 | ubifs_err("missing orphan ino %lu", (unsigned long)inum); | 158 | ubifs_err(c, "missing orphan ino %lu", (unsigned long)inum); |
159 | dump_stack(); | 159 | dump_stack(); |
160 | } | 160 | } |
161 | 161 | ||
@@ -287,7 +287,7 @@ static int write_orph_node(struct ubifs_info *c, int atomic) | |||
287 | * We limit the number of orphans so that this should | 287 | * We limit the number of orphans so that this should |
288 | * never happen. | 288 | * never happen. |
289 | */ | 289 | */ |
290 | ubifs_err("out of space in orphan area"); | 290 | ubifs_err(c, "out of space in orphan area"); |
291 | return -EINVAL; | 291 | return -EINVAL; |
292 | } | 292 | } |
293 | } | 293 | } |
@@ -397,7 +397,7 @@ static int consolidate(struct ubifs_info *c) | |||
397 | * We limit the number of orphans so that this should | 397 | * We limit the number of orphans so that this should |
398 | * never happen. | 398 | * never happen. |
399 | */ | 399 | */ |
400 | ubifs_err("out of space in orphan area"); | 400 | ubifs_err(c, "out of space in orphan area"); |
401 | err = -EINVAL; | 401 | err = -EINVAL; |
402 | } | 402 | } |
403 | spin_unlock(&c->orphan_lock); | 403 | spin_unlock(&c->orphan_lock); |
@@ -569,7 +569,7 @@ static int do_kill_orphans(struct ubifs_info *c, struct ubifs_scan_leb *sleb, | |||
569 | 569 | ||
570 | list_for_each_entry(snod, &sleb->nodes, list) { | 570 | list_for_each_entry(snod, &sleb->nodes, list) { |
571 | if (snod->type != UBIFS_ORPH_NODE) { | 571 | if (snod->type != UBIFS_ORPH_NODE) { |
572 | ubifs_err("invalid node type %d in orphan area at %d:%d", | 572 | ubifs_err(c, "invalid node type %d in orphan area at %d:%d", |
573 | snod->type, sleb->lnum, snod->offs); | 573 | snod->type, sleb->lnum, snod->offs); |
574 | ubifs_dump_node(c, snod->node); | 574 | ubifs_dump_node(c, snod->node); |
575 | return -EINVAL; | 575 | return -EINVAL; |
@@ -596,7 +596,7 @@ static int do_kill_orphans(struct ubifs_info *c, struct ubifs_scan_leb *sleb, | |||
596 | * number. That makes this orphan node, out of date. | 596 | * number. That makes this orphan node, out of date. |
597 | */ | 597 | */ |
598 | if (!first) { | 598 | if (!first) { |
599 | ubifs_err("out of order commit number %llu in orphan node at %d:%d", | 599 | ubifs_err(c, "out of order commit number %llu in orphan node at %d:%d", |
600 | cmt_no, sleb->lnum, snod->offs); | 600 | cmt_no, sleb->lnum, snod->offs); |
601 | ubifs_dump_node(c, snod->node); | 601 | ubifs_dump_node(c, snod->node); |
602 | return -EINVAL; | 602 | return -EINVAL; |
@@ -831,20 +831,20 @@ static int dbg_orphan_check(struct ubifs_info *c, struct ubifs_zbranch *zbr, | |||
831 | if (inum != ci->last_ino) { | 831 | if (inum != ci->last_ino) { |
832 | /* Lowest node type is the inode node, so it comes first */ | 832 | /* Lowest node type is the inode node, so it comes first */ |
833 | if (key_type(c, &zbr->key) != UBIFS_INO_KEY) | 833 | if (key_type(c, &zbr->key) != UBIFS_INO_KEY) |
834 | ubifs_err("found orphan node ino %lu, type %d", | 834 | ubifs_err(c, "found orphan node ino %lu, type %d", |
835 | (unsigned long)inum, key_type(c, &zbr->key)); | 835 | (unsigned long)inum, key_type(c, &zbr->key)); |
836 | ci->last_ino = inum; | 836 | ci->last_ino = inum; |
837 | ci->tot_inos += 1; | 837 | ci->tot_inos += 1; |
838 | err = ubifs_tnc_read_node(c, zbr, ci->node); | 838 | err = ubifs_tnc_read_node(c, zbr, ci->node); |
839 | if (err) { | 839 | if (err) { |
840 | ubifs_err("node read failed, error %d", err); | 840 | ubifs_err(c, "node read failed, error %d", err); |
841 | return err; | 841 | return err; |
842 | } | 842 | } |
843 | if (ci->node->nlink == 0) | 843 | if (ci->node->nlink == 0) |
844 | /* Must be recorded as an orphan */ | 844 | /* Must be recorded as an orphan */ |
845 | if (!dbg_find_check_orphan(&ci->root, inum) && | 845 | if (!dbg_find_check_orphan(&ci->root, inum) && |
846 | !dbg_find_orphan(c, inum)) { | 846 | !dbg_find_orphan(c, inum)) { |
847 | ubifs_err("missing orphan, ino %lu", | 847 | ubifs_err(c, "missing orphan, ino %lu", |
848 | (unsigned long)inum); | 848 | (unsigned long)inum); |
849 | ci->missing += 1; | 849 | ci->missing += 1; |
850 | } | 850 | } |
@@ -887,7 +887,7 @@ static int dbg_scan_orphans(struct ubifs_info *c, struct check_info *ci) | |||
887 | 887 | ||
888 | buf = __vmalloc(c->leb_size, GFP_NOFS, PAGE_KERNEL); | 888 | buf = __vmalloc(c->leb_size, GFP_NOFS, PAGE_KERNEL); |
889 | if (!buf) { | 889 | if (!buf) { |
890 | ubifs_err("cannot allocate memory to check orphans"); | 890 | ubifs_err(c, "cannot allocate memory to check orphans"); |
891 | return 0; | 891 | return 0; |
892 | } | 892 | } |
893 | 893 | ||
@@ -925,7 +925,7 @@ static int dbg_check_orphans(struct ubifs_info *c) | |||
925 | ci.root = RB_ROOT; | 925 | ci.root = RB_ROOT; |
926 | ci.node = kmalloc(UBIFS_MAX_INO_NODE_SZ, GFP_NOFS); | 926 | ci.node = kmalloc(UBIFS_MAX_INO_NODE_SZ, GFP_NOFS); |
927 | if (!ci.node) { | 927 | if (!ci.node) { |
928 | ubifs_err("out of memory"); | 928 | ubifs_err(c, "out of memory"); |
929 | return -ENOMEM; | 929 | return -ENOMEM; |
930 | } | 930 | } |
931 | 931 | ||
@@ -935,12 +935,12 @@ static int dbg_check_orphans(struct ubifs_info *c) | |||
935 | 935 | ||
936 | err = dbg_walk_index(c, &dbg_orphan_check, NULL, &ci); | 936 | err = dbg_walk_index(c, &dbg_orphan_check, NULL, &ci); |
937 | if (err) { | 937 | if (err) { |
938 | ubifs_err("cannot scan TNC, error %d", err); | 938 | ubifs_err(c, "cannot scan TNC, error %d", err); |
939 | goto out; | 939 | goto out; |
940 | } | 940 | } |
941 | 941 | ||
942 | if (ci.missing) { | 942 | if (ci.missing) { |
943 | ubifs_err("%lu missing orphan(s)", ci.missing); | 943 | ubifs_err(c, "%lu missing orphan(s)", ci.missing); |
944 | err = -EINVAL; | 944 | err = -EINVAL; |
945 | goto out; | 945 | goto out; |
946 | } | 946 | } |