mirror of
https://github.com/torvalds/linux.git
synced 2024-11-21 19:41:42 +00:00
nfsd: Simplify the allocation of slab caches in nfsd_file_cache_init
Use the new KMEM_CACHE() macro instead of direct kmem_cache_create to simplify the creation of SLAB caches. Signed-off-by: Kunwu Chan <chentao@kylinos.cn> Acked-by: Jeff Layton <jlayton@kernel.org> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
This commit is contained in:
parent
10bcc2f1c8
commit
2f74991a49
@ -722,15 +722,13 @@ nfsd_file_cache_init(void)
|
||||
return ret;
|
||||
|
||||
ret = -ENOMEM;
|
||||
nfsd_file_slab = kmem_cache_create("nfsd_file",
|
||||
sizeof(struct nfsd_file), 0, 0, NULL);
|
||||
nfsd_file_slab = KMEM_CACHE(nfsd_file, 0);
|
||||
if (!nfsd_file_slab) {
|
||||
pr_err("nfsd: unable to create nfsd_file_slab\n");
|
||||
goto out_err;
|
||||
}
|
||||
|
||||
nfsd_file_mark_slab = kmem_cache_create("nfsd_file_mark",
|
||||
sizeof(struct nfsd_file_mark), 0, 0, NULL);
|
||||
nfsd_file_mark_slab = KMEM_CACHE(nfsd_file_mark, 0);
|
||||
if (!nfsd_file_mark_slab) {
|
||||
pr_err("nfsd: unable to create nfsd_file_mark_slab\n");
|
||||
goto out_err;
|
||||
|
Loading…
Reference in New Issue
Block a user