struct btree_iter *inode_iter = NULL;
        struct bch_hash_info hash = bch2_hash_info_init(c, new_inode);
        u64 now = bch2_current_time(c);
+       u64 cpu = raw_smp_processor_id();
        u64 dir_offset = 0;
        int ret;
 
        if (!name)
                new_inode->bi_flags |= BCH_INODE_UNLINKED;
 
-       inode_iter = bch2_inode_create(trans, new_inode, U32_MAX);
+       inode_iter = bch2_inode_create(trans, new_inode, U32_MAX, cpu);
        ret = PTR_ERR_OR_ZERO(inode_iter);
        if (ret)
                goto err;
 
 
 struct btree_iter *bch2_inode_create(struct btree_trans *trans,
                                     struct bch_inode_unpacked *inode_u,
-                                    u32 snapshot)
+                                    u32 snapshot, u64 cpu)
 {
        struct bch_fs *c = trans->c;
        struct btree_iter *iter = NULL;
        unsigned bits = (c->opts.inodes_32bit ? 31 : 63);
 
        if (c->opts.shard_inode_numbers) {
-               u64 cpu = raw_smp_processor_id();
-
                bits -= c->inode_shard_bits;
 
                min = (cpu << bits);
 
                     struct bch_inode_unpacked *);
 
 struct btree_iter *bch2_inode_create(struct btree_trans *,
-                                    struct bch_inode_unpacked *, u32);
+                                    struct bch_inode_unpacked *, u32, u64);
 
 int bch2_inode_rm(struct bch_fs *, u64, bool);