]> git.sesse.net Git - bcachefs-tools-debian/blobdiff - libbcachefs/checksum.c
Update bcachefs sources to 1e3ca87f7b bcachefs: bcachefs_metadata_version_major_minor
[bcachefs-tools-debian] / libbcachefs / checksum.c
index b5850a761b91037dbbffb56eb5a7e1ae37f7cde6..a08997a5bb67566f27abbcb5e7a85b61d8c48b19 100644 (file)
@@ -131,9 +131,9 @@ static inline int do_encrypt(struct crypto_sync_skcipher *tfm,
                size_t orig_len = len;
                int ret, i;
 
-               sg = kmalloc_array(sizeof(*sg), pages, GFP_KERNEL);
+               sg = kmalloc_array(pages, sizeof(*sg), GFP_KERNEL);
                if (!sg)
-                       return -ENOMEM;
+                       return -BCH_ERR_ENOMEM_do_encrypt;
 
                sg_init_table(sg, pages);
 
@@ -316,7 +316,7 @@ struct bch_csum bch2_checksum_bio(struct bch_fs *c, unsigned type,
        return __bch2_checksum_bio(c, type, nonce, bio, &iter);
 }
 
-int bch2_encrypt_bio(struct bch_fs *c, unsigned type,
+int __bch2_encrypt_bio(struct bch_fs *c, unsigned type,
                     struct nonce nonce, struct bio *bio)
 {
        struct bio_vec bv;
@@ -648,7 +648,7 @@ int bch2_enable_encryption(struct bch_fs *c, bool keyed)
 
        crypt = bch2_sb_resize_crypt(&c->disk_sb, sizeof(*crypt) / sizeof(u64));
        if (!crypt) {
-               ret = -ENOMEM; /* XXX this technically could be -ENOSPC */
+               ret = -BCH_ERR_ENOSPC_sb_crypt;
                goto err;
        }
 
@@ -680,8 +680,6 @@ int bch2_fs_encryption_init(struct bch_fs *c)
        struct bch_key key;
        int ret = 0;
 
-       pr_verbose_init(c->opts, "");
-
        c->sha256 = crypto_alloc_shash("sha256", 0, 0);
        ret = PTR_ERR_OR_ZERO(c->sha256);
        if (ret) {
@@ -707,6 +705,5 @@ int bch2_fs_encryption_init(struct bch_fs *c)
                goto out;
 out:
        memzero_explicit(&key, sizeof(key));
-       pr_verbose_init(c->opts, "ret %i", ret);
        return ret;
 }