Merge tag 'for-5.11/block-2020-12-14' of git://git.kernel.dk/linux-block
[linux-2.6-microblaze.git] / fs / f2fs / dir.c
index 4b9ef8b..049500f 100644 (file)
@@ -1022,7 +1022,7 @@ static int f2fs_readdir(struct file *file, struct dir_context *ctx)
        int err = 0;
 
        if (IS_ENCRYPTED(inode)) {
-               err = fscrypt_get_encryption_info(inode);
+               err = fscrypt_prepare_readdir(inode);
                if (err)
                        goto out;
 
@@ -1081,19 +1081,11 @@ out:
        return err < 0 ? err : 0;
 }
 
-static int f2fs_dir_open(struct inode *inode, struct file *filp)
-{
-       if (IS_ENCRYPTED(inode))
-               return fscrypt_get_encryption_info(inode) ? -EACCES : 0;
-       return 0;
-}
-
 const struct file_operations f2fs_dir_operations = {
        .llseek         = generic_file_llseek,
        .read           = generic_read_dir,
        .iterate_shared = f2fs_readdir,
        .fsync          = f2fs_sync_file,
-       .open           = f2fs_dir_open,
        .unlocked_ioctl = f2fs_ioctl,
 #ifdef CONFIG_COMPAT
        .compat_ioctl   = f2fs_compat_ioctl,