- bch2_inode_pack(&packed, inode);
- ret = bch2_btree_insert(c, BTREE_ID_INODES, &packed.inode.k_i,
- NULL, NULL, NULL, 0);
- if (ret)
- die("error creating file: %s", strerror(-ret));
-}
-
-static void create_dirent(struct bch_fs *c,
- struct bch_inode_unpacked *parent,
- const char *name, u64 inum, mode_t mode)
-{
- struct bch_hash_info parent_hash_info = bch2_hash_info_init(c, parent);
- struct qstr qname = { { { .len = strlen(name), } }, .name = name };
-
- int ret = bch2_dirent_create(c, parent->bi_inum, &parent_hash_info,
- mode_to_type(mode), &qname,
- inum, NULL, BCH_HASH_SET_MUST_CREATE);
+ bch2_inode_pack(c, &packed, inode);
+ ret = bch2_btree_insert(c, BTREE_ID_inodes, &packed.inode.k_i,
+ NULL, NULL, 0);