Merge tag 'ext4_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso...
[platform/kernel/linux-rpi.git] / fs / ext4 / super.c
index 5308f0d..0337347 100644 (file)
@@ -1286,7 +1286,7 @@ static void ext4_put_super(struct super_block *sb)
                crypto_free_shash(sbi->s_chksum_driver);
        kfree(sbi->s_blockgroup_lock);
        fs_put_dax(sbi->s_daxdev);
-       fscrypt_free_dummy_context(&sbi->s_dummy_enc_ctx);
+       fscrypt_free_dummy_policy(&sbi->s_dummy_enc_policy);
 #ifdef CONFIG_UNICODE
        utf8_unload(sbi->s_encoding);
 #endif
@@ -1582,10 +1582,9 @@ retry:
        return res;
 }
 
-static const union fscrypt_context *
-ext4_get_dummy_context(struct super_block *sb)
+static const union fscrypt_policy *ext4_get_dummy_policy(struct super_block *sb)
 {
-       return EXT4_SB(sb)->s_dummy_enc_ctx.ctx;
+       return EXT4_SB(sb)->s_dummy_enc_policy.policy;
 }
 
 static bool ext4_has_stable_inodes(struct super_block *sb)
@@ -1604,7 +1603,7 @@ static const struct fscrypt_operations ext4_cryptops = {
        .key_prefix             = "ext4:",
        .get_context            = ext4_get_context,
        .set_context            = ext4_set_context,
-       .get_dummy_context      = ext4_get_dummy_context,
+       .get_dummy_policy       = ext4_get_dummy_policy,
        .empty_dir              = ext4_empty_dir,
        .max_namelen            = EXT4_NAME_LEN,
        .has_stable_inodes      = ext4_has_stable_inodes,
@@ -2095,12 +2094,13 @@ static int ext4_set_test_dummy_encryption(struct super_block *sb,
         * needed to allow it to be set or changed during remount.  We do allow
         * it to be specified during remount, but only if there is no change.
         */
-       if (is_remount && !sbi->s_dummy_enc_ctx.ctx) {
+       if (is_remount && !sbi->s_dummy_enc_policy.policy) {
                ext4_msg(sb, KERN_WARNING,
                         "Can't set test_dummy_encryption on remount");
                return -1;
        }
-       err = fscrypt_set_test_dummy_encryption(sb, arg, &sbi->s_dummy_enc_ctx);
+       err = fscrypt_set_test_dummy_encryption(sb, arg->from,
+                                               &sbi->s_dummy_enc_policy);
        if (err) {
                if (err == -EEXIST)
                        ext4_msg(sb, KERN_WARNING,
@@ -5191,7 +5191,7 @@ failed_mount:
        for (i = 0; i < EXT4_MAXQUOTAS; i++)
                kfree(get_qf_name(sb, sbi, i));
 #endif
-       fscrypt_free_dummy_context(&sbi->s_dummy_enc_ctx);
+       fscrypt_free_dummy_policy(&sbi->s_dummy_enc_policy);
        ext4_blkdev_remove(sbi);
        brelse(bh);
 out_fail: