]> git.sesse.net Git - bcachefs-tools-debian/blobdiff - cmd_migrate.c
Add a subcommand for resizing the journal
[bcachefs-tools-debian] / cmd_migrate.c
index 7d15a08eea5bb5782f4a72748a8248c494a2f2ac..42fbc2bc5feabb60b4907bff80941600c4dbee2b 100644 (file)
@@ -122,7 +122,7 @@ static void update_inode(struct bch_fs *c,
        struct bkey_inode_buf packed;
        int ret;
 
-       bch2_inode_pack(&packed, inode);
+       bch2_inode_pack(c, &packed, inode);
        ret = bch2_btree_insert(c, BTREE_ID_INODES, &packed.inode.k_i,
                                NULL, NULL, 0);
        if (ret)
@@ -134,11 +134,12 @@ static void create_link(struct bch_fs *c,
                        const char *name, u64 inum, mode_t mode)
 {
        struct qstr qstr = QSTR(name);
+       struct bch_inode_unpacked parent_u;
        struct bch_inode_unpacked inode;
 
-       int ret = bch2_trans_do(c, NULL, BTREE_INSERT_ATOMIC,
-               bch2_link_trans(&trans, parent->bi_inum,
-                               inum, &inode, &qstr));
+       int ret = bch2_trans_do(c, NULL, NULL, 0,
+               bch2_link_trans(&trans, parent->bi_inum, inum,
+                               &parent_u, &inode, &qstr));
        if (ret)
                die("error creating hardlink: %s", strerror(-ret));
 }
@@ -152,7 +153,7 @@ static struct bch_inode_unpacked create_file(struct bch_fs *c,
        struct qstr qstr = QSTR(name);
        struct bch_inode_unpacked new_inode;
 
-       int ret = bch2_trans_do(c, NULL, BTREE_INSERT_ATOMIC,
+       int ret = bch2_trans_do(c, NULL, NULL, 0,
                bch2_create_trans(&trans,
                                  parent->bi_inum, parent,
                                  &new_inode, &qstr,
@@ -223,7 +224,7 @@ static void copy_xattrs(struct bch_fs *c, struct bch_inode_unpacked *dst,
 
                const struct xattr_handler *h = xattr_resolve_name(&attr);
 
-               int ret = bch2_trans_do(c, NULL, BTREE_INSERT_ATOMIC,
+               int ret = bch2_trans_do(c, NULL, NULL, 0,
                                bch2_xattr_set(&trans, dst->bi_inum, &hash_info, attr,
                                               val, val_size, h->flags, 0));
                if (ret < 0)
@@ -595,8 +596,7 @@ static void copy_fs(struct bch_fs *c, int src_fd, const char *src_path,
        darray_free(s.extents);
        genradix_free(&s.hardlinks);
 
-       bool wrote;
-       bch2_alloc_write(c, false, &wrote);
+       bch2_alloc_write(c, false);
 }
 
 static void find_superblock_space(ranges extents, struct dev_opts *dev)