aboutsummaryrefslogtreecommitdiffstats
path: root/fs/afs/file.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2019-07-10 20:55:33 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2019-07-10 20:55:33 -0700
commit8dda9957e3a1c871dfbabf84c4760f9b26032442 (patch)
treef627992d3b0638ab7541d25d60611b2ab3e18f18 /fs/afs/file.c
parent25cd6f355dab9d11b7c8a4005867d5a30b8b14ee (diff)
parent1eda8bab70ca7d353b4e865140eaec06fedbf871 (diff)
downloadlinux-8dda9957e3a1c871dfbabf84c4760f9b26032442.tar.gz
Merge tag 'afs-next-20190628' of git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs
Pull afs updates from David Howells: "A set of minor changes for AFS: - Remove an unnecessary check in afs_unlink() - Add a tracepoint for tracking callback management - Add a tracepoint for afs_server object usage - Use struct_size() - Add mappings for AFS UAE abort codes to Linux error codes, using symbolic names rather than hex numbers in the .c file" * tag 'afs-next-20190628' of git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs: afs: Add support for the UAE error table fs/afs: use struct_size() in kzalloc() afs: Trace afs_server usage afs: Add some callback management tracepoints afs: afs_unlink() doesn't need to check dentry->d_inode
Diffstat (limited to 'fs/afs/file.c')
-rw-r--r--fs/afs/file.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/fs/afs/file.c b/fs/afs/file.c
index 8fd7d3b9a1b1fa..56b69576274d5b 100644
--- a/fs/afs/file.c
+++ b/fs/afs/file.c
@@ -310,8 +310,7 @@ int afs_page_filler(void *data, struct page *page)
/* fall through */
default:
go_on:
- req = kzalloc(sizeof(struct afs_read) + sizeof(struct page *),
- GFP_KERNEL);
+ req = kzalloc(struct_size(req, array, 1), GFP_KERNEL);
if (!req)
goto enomem;
@@ -461,8 +460,7 @@ static int afs_readpages_one(struct file *file, struct address_space *mapping,
n++;
}
- req = kzalloc(sizeof(struct afs_read) + sizeof(struct page *) * n,
- GFP_NOFS);
+ req = kzalloc(struct_size(req, array, n), GFP_NOFS);
if (!req)
return -ENOMEM;