]> git.sesse.net Git - bcachefs-tools-debian/blobdiff - libbcachefs/super.c
Update bcachefs sources to 0342eebf85 bcachefs: Improve the backpointer to missing...
[bcachefs-tools-debian] / libbcachefs / super.c
index 3a7f4e295cbd2840ca27fddcf9f8ccb983f15778..8a269b680295f4ae7da7de1a81713a49db797bbb 100644 (file)
@@ -647,7 +647,7 @@ static struct bch_fs *bch2_fs_alloc(struct bch_sb *sb, struct bch_opts opts)
 
        c = kvpmalloc(sizeof(struct bch_fs), GFP_KERNEL|__GFP_ZERO);
        if (!c) {
-               c = ERR_PTR(-ENOMEM);
+               c = ERR_PTR(-BCH_ERR_ENOMEM_fs_alloc);
                goto out;
        }
 
@@ -737,7 +737,7 @@ static struct bch_fs *bch2_fs_alloc(struct bch_sb *sb, struct bch_opts opts)
        strscpy(c->name, name.buf, sizeof(c->name));
        printbuf_exit(&name);
 
-       ret = name.allocation_failure ? -ENOMEM : 0;
+       ret = name.allocation_failure ? -BCH_ERR_ENOMEM_fs_name_alloc : 0;
        if (ret)
                goto err;
 
@@ -801,7 +801,7 @@ static struct bch_fs *bch2_fs_alloc(struct bch_sb *sb, struct bch_opts opts)
            mempool_init_kmalloc_pool(&c->large_bkey_pool, 1, 2048) ||
            !(c->unused_inode_hints = kcalloc(1U << c->inode_shard_bits,
                                              sizeof(u64), GFP_KERNEL))) {
-               ret = -ENOMEM;
+               ret = -BCH_ERR_ENOMEM_fs_other_alloc;
                goto err;
        }
 
@@ -1182,7 +1182,7 @@ out:
 err:
        if (ca)
                bch2_dev_free(ca);
-       ret = -ENOMEM;
+       ret = -BCH_ERR_ENOMEM_dev_alloc;
        goto out;
 }