summaryrefslogtreecommitdiff
path: root/fs/f2fs/dir.c
diff options
context:
space:
mode:
authorChao Yu <yuchao0@huawei.com>2016-08-28 17:00:12 +0300
committerJaegeuk Kim <jaegeuk@kernel.org>2016-09-08 03:27:36 +0300
commite06f86e61d7a67fe6e826010f57aa39c674f4b1b (patch)
tree5f58117677c9badb7416822464f19354fdc2553d /fs/f2fs/dir.c
parent9421d57051c534c7477f98d0576b876237fbbc4c (diff)
downloadlinux-e06f86e61d7a67fe6e826010f57aa39c674f4b1b.tar.xz
f2fs crypto: avoid unneeded memory allocation in ->readdir
When decrypting dirents in ->readdir, fscrypt_fname_disk_to_usr won't change content of original encrypted dirent, we don't need to allocate additional buffer for storing mirror of it, so get rid of it. Signed-off-by: Chao Yu <yuchao0@huawei.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/dir.c')
-rw-r--r--fs/f2fs/dir.c7
1 files changed, 0 insertions, 7 deletions
diff --git a/fs/f2fs/dir.c b/fs/f2fs/dir.c
index 3522f6f20897..fbc8ede062bf 100644
--- a/fs/f2fs/dir.c
+++ b/fs/f2fs/dir.c
@@ -796,16 +796,9 @@ bool f2fs_fill_dentries(struct dir_context *ctx, struct f2fs_dentry_ptr *d,
int save_len = fstr->len;
int ret;
- de_name.name = f2fs_kmalloc(de_name.len, GFP_NOFS);
- if (!de_name.name)
- return false;
-
- memcpy(de_name.name, d->filename[bit_pos], de_name.len);
-
ret = fscrypt_fname_disk_to_usr(d->inode,
(u32)de->hash_code, 0,
&de_name, fstr);
- kfree(de_name.name);
if (ret < 0)
return true;