super.c (c9a78332b42cbdcdd386a95192a716b67d1711a4) | super.c (2452cc89063a2a6890368f185c4b6d7d8802179e) |
---|---|
1/* 2 * bcache setup/teardown code, and some metadata io - read a superblock and 3 * figure out what to do with it. 4 * 5 * Copyright 2010, 2011 Kent Overstreet <kent.overstreet@gmail.com> 6 * Copyright 2012 Google, Inc. 7 */ 8 --- 1587 unchanged lines hidden (view full) --- 1596 1597 k = &j->btree_root; 1598 1599 err = "bad btree root"; 1600 if (__bch_btree_ptr_invalid(c, k)) 1601 goto err; 1602 1603 err = "error reading btree root"; | 1/* 2 * bcache setup/teardown code, and some metadata io - read a superblock and 3 * figure out what to do with it. 4 * 5 * Copyright 2010, 2011 Kent Overstreet <kent.overstreet@gmail.com> 6 * Copyright 2012 Google, Inc. 7 */ 8 --- 1587 unchanged lines hidden (view full) --- 1596 1597 k = &j->btree_root; 1598 1599 err = "bad btree root"; 1600 if (__bch_btree_ptr_invalid(c, k)) 1601 goto err; 1602 1603 err = "error reading btree root"; |
1604 c->root = bch_btree_node_get(c, NULL, k, j->btree_level, true); | 1604 c->root = bch_btree_node_get(c, NULL, k, j->btree_level, true, NULL); |
1605 if (IS_ERR_OR_NULL(c->root)) 1606 goto err; 1607 1608 list_del_init(&c->root->list); 1609 rw_unlock(true, c->root); 1610 1611 err = uuid_read(c, j, &cl); 1612 if (err) --- 58 unchanged lines hidden (view full) --- 1671 bch_prio_write(ca); 1672 mutex_unlock(&c->bucket_lock); 1673 1674 err = "cannot allocate new UUID bucket"; 1675 if (__uuid_write(c)) 1676 goto err; 1677 1678 err = "cannot allocate new btree root"; | 1605 if (IS_ERR_OR_NULL(c->root)) 1606 goto err; 1607 1608 list_del_init(&c->root->list); 1609 rw_unlock(true, c->root); 1610 1611 err = uuid_read(c, j, &cl); 1612 if (err) --- 58 unchanged lines hidden (view full) --- 1671 bch_prio_write(ca); 1672 mutex_unlock(&c->bucket_lock); 1673 1674 err = "cannot allocate new UUID bucket"; 1675 if (__uuid_write(c)) 1676 goto err; 1677 1678 err = "cannot allocate new btree root"; |
1679 c->root = __bch_btree_node_alloc(c, NULL, 0, true); | 1679 c->root = __bch_btree_node_alloc(c, NULL, 0, true, NULL); |
1680 if (IS_ERR_OR_NULL(c->root)) 1681 goto err; 1682 1683 mutex_lock(&c->root->write_lock); 1684 bkey_copy_key(&c->root->key, &MAX_KEY); 1685 bch_btree_node_write(c->root, &cl); 1686 mutex_unlock(&c->root->write_lock); 1687 --- 436 unchanged lines hidden --- | 1680 if (IS_ERR_OR_NULL(c->root)) 1681 goto err; 1682 1683 mutex_lock(&c->root->write_lock); 1684 bkey_copy_key(&c->root->key, &MAX_KEY); 1685 bch_btree_node_write(c->root, &cl); 1686 mutex_unlock(&c->root->write_lock); 1687 --- 436 unchanged lines hidden --- |