Merge branch 'v4.4/topic/coresight' into linux-linaro-lsk-v4.4
[firefly-linux-kernel-4.4.55.git] / drivers / md / bcache / extents.c
index 3a0de4cf9771031e9d4707fc49f356aee48b50e7..243de0bf15cdbf359965dff55cac4762b804362f 100644 (file)
@@ -474,9 +474,8 @@ out:
        return false;
 }
 
-static bool bch_extent_invalid(struct btree_keys *bk, const struct bkey *k)
+bool __bch_extent_invalid(struct cache_set *c, const struct bkey *k)
 {
-       struct btree *b = container_of(bk, struct btree, keys);
        char buf[80];
 
        if (!KEY_SIZE(k))
@@ -485,16 +484,22 @@ static bool bch_extent_invalid(struct btree_keys *bk, const struct bkey *k)
        if (KEY_SIZE(k) > KEY_OFFSET(k))
                goto bad;
 
-       if (__ptr_invalid(b->c, k))
+       if (__ptr_invalid(c, k))
                goto bad;
 
        return false;
 bad:
        bch_extent_to_text(buf, sizeof(buf), k);
-       cache_bug(b->c, "spotted extent %s: %s", buf, bch_ptr_status(b->c, k));
+       cache_bug(c, "spotted extent %s: %s", buf, bch_ptr_status(c, k));
        return true;
 }
 
+static bool bch_extent_invalid(struct btree_keys *bk, const struct bkey *k)
+{
+       struct btree *b = container_of(bk, struct btree, keys);
+       return __bch_extent_invalid(b->c, k);
+}
+
 static bool bch_extent_bad_expensive(struct btree *b, const struct bkey *k,
                                     unsigned ptr)
 {