]> git.sur5r.net Git - u-boot/blobdiff - fs/ubifs/orphan.c
Merge git://git.denx.de/u-boot-usb
[u-boot] / fs / ubifs / orphan.c
index 4e42879b5d6bc7513f45230447b163829b827951..f5c8e23d0b39e75b0043971dda1e105f81d0dac3 100644 (file)
@@ -78,7 +78,7 @@ int ubifs_add_orphan(struct ubifs_info *c, ino_t inum)
                else if (inum > o->inum)
                        p = &(*p)->rb_right;
                else {
-                       ubifs_err("orphaned twice");
+                       ubifs_err(c, "orphaned twice");
                        spin_unlock(&c->orphan_lock);
                        kfree(orphan);
                        return 0;
@@ -145,7 +145,7 @@ void ubifs_delete_orphan(struct ubifs_info *c, ino_t inum)
                }
        }
        spin_unlock(&c->orphan_lock);
-       ubifs_err("missing orphan ino %lu", (unsigned long)inum);
+       ubifs_err(c, "missing orphan ino %lu", (unsigned long)inum);
        dump_stack();
 }
 
@@ -277,7 +277,7 @@ static int write_orph_node(struct ubifs_info *c, int atomic)
                         * We limit the number of orphans so that this should
                         * never happen.
                         */
-                       ubifs_err("out of space in orphan area");
+                       ubifs_err(c, "out of space in orphan area");
                        return -EINVAL;
                }
        }
@@ -336,7 +336,6 @@ static int write_orph_nodes(struct ubifs_info *c, int atomic)
                int lnum;
 
                /* Unmap any unused LEBs after consolidation */
-               lnum = c->ohead_lnum + 1;
                for (lnum = c->ohead_lnum + 1; lnum <= c->orph_last; lnum++) {
                        err = ubifs_leb_unmap(c, lnum);
                        if (err)
@@ -388,7 +387,7 @@ static int consolidate(struct ubifs_info *c)
                 * We limit the number of orphans so that this should
                 * never happen.
                 */
-               ubifs_err("out of space in orphan area");
+               ubifs_err(c, "out of space in orphan area");
                err = -EINVAL;
        }
        spin_unlock(&c->orphan_lock);
@@ -560,7 +559,7 @@ static int do_kill_orphans(struct ubifs_info *c, struct ubifs_scan_leb *sleb,
 
        list_for_each_entry(snod, &sleb->nodes, list) {
                if (snod->type != UBIFS_ORPH_NODE) {
-                       ubifs_err("invalid node type %d in orphan area at %d:%d",
+                       ubifs_err(c, "invalid node type %d in orphan area at %d:%d",
                                  snod->type, sleb->lnum, snod->offs);
                        ubifs_dump_node(c, snod->node);
                        return -EINVAL;
@@ -587,7 +586,7 @@ static int do_kill_orphans(struct ubifs_info *c, struct ubifs_scan_leb *sleb,
                         * number. That makes this orphan node, out of date.
                         */
                        if (!first) {
-                               ubifs_err("out of order commit number %llu in orphan node at %d:%d",
+                               ubifs_err(c, "out of order commit number %llu in orphan node at %d:%d",
                                          cmt_no, sleb->lnum, snod->offs);
                                ubifs_dump_node(c, snod->node);
                                return -EINVAL;
@@ -822,20 +821,20 @@ static int dbg_orphan_check(struct ubifs_info *c, struct ubifs_zbranch *zbr,
        if (inum != ci->last_ino) {
                /* Lowest node type is the inode node, so it comes first */
                if (key_type(c, &zbr->key) != UBIFS_INO_KEY)
-                       ubifs_err("found orphan node ino %lu, type %d",
+                       ubifs_err(c, "found orphan node ino %lu, type %d",
                                  (unsigned long)inum, key_type(c, &zbr->key));
                ci->last_ino = inum;
                ci->tot_inos += 1;
                err = ubifs_tnc_read_node(c, zbr, ci->node);
                if (err) {
-                       ubifs_err("node read failed, error %d", err);
+                       ubifs_err(c, "node read failed, error %d", err);
                        return err;
                }
                if (ci->node->nlink == 0)
                        /* Must be recorded as an orphan */
                        if (!dbg_find_check_orphan(&ci->root, inum) &&
                            !dbg_find_orphan(c, inum)) {
-                               ubifs_err("missing orphan, ino %lu",
+                               ubifs_err(c, "missing orphan, ino %lu",
                                          (unsigned long)inum);
                                ci->missing += 1;
                        }
@@ -878,7 +877,7 @@ static int dbg_scan_orphans(struct ubifs_info *c, struct check_info *ci)
 
        buf = __vmalloc(c->leb_size, GFP_NOFS, PAGE_KERNEL);
        if (!buf) {
-               ubifs_err("cannot allocate memory to check orphans");
+               ubifs_err(c, "cannot allocate memory to check orphans");
                return 0;
        }
 
@@ -916,7 +915,7 @@ static int dbg_check_orphans(struct ubifs_info *c)
        ci.root = RB_ROOT;
        ci.node = kmalloc(UBIFS_MAX_INO_NODE_SZ, GFP_NOFS);
        if (!ci.node) {
-               ubifs_err("out of memory");
+               ubifs_err(c, "out of memory");
                return -ENOMEM;
        }
 
@@ -926,12 +925,12 @@ static int dbg_check_orphans(struct ubifs_info *c)
 
        err = dbg_walk_index(c, &dbg_orphan_check, NULL, &ci);
        if (err) {
-               ubifs_err("cannot scan TNC, error %d", err);
+               ubifs_err(c, "cannot scan TNC, error %d", err);
                goto out;
        }
 
        if (ci.missing) {
-               ubifs_err("%lu missing orphan(s)", ci.missing);
+               ubifs_err(c, "%lu missing orphan(s)", ci.missing);
                err = -EINVAL;
                goto out;
        }