From 11407737f7b8335c52a000ea15cd3b3b4821f9bd Mon Sep 17 00:00:00 2001 From: Simon Wilkinson Date: Sun, 17 Apr 2011 21:41:15 +0100 Subject: [PATCH] Linux CM: Files don't need a page We were using osi_AllocLargeSpace to allocate our files. This gives a page to every struct osi_file we create, which seems a little bit excessive. Just use kmalloc directly instead, and let the kernel's allocator deal with the slabbing. Change-Id: I40d32ad0d7090e2b3b60be983d4f441968dc69dc Reviewed-on: http://gerrit.openafs.org/4750 Reviewed-by: Marc Dionne Tested-by: BuildBot Reviewed-by: Derrick Brashear --- src/afs/LINUX/osi_file.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/afs/LINUX/osi_file.c b/src/afs/LINUX/osi_file.c index 3c20fd9..843ce7a 100644 --- a/src/afs/LINUX/osi_file.c +++ b/src/afs/LINUX/osi_file.c @@ -83,8 +83,8 @@ osi_UFSOpen(afs_dcache_id_t *ainode) crhold(&afs_osi_cred); /* don't let it evaporate, since it is static */ afs_osicred_initialized = 1; } - afile = (struct osi_file *)osi_AllocLargeSpace(sizeof(struct osi_file)); AFS_GUNLOCK(); + afile = kmalloc(sizeof(struct osi_file), GFP_NOFS); if (!afile) { osi_Panic("osi_UFSOpen: Failed to allocate %d bytes for osi_file.\n", (int)sizeof(struct osi_file)); @@ -149,8 +149,7 @@ osi_UFSClose(struct osi_file *afile) filp_close(afile->filp, NULL); } } - - osi_FreeLargeSpace(afile); + kfree(afile); return 0; } -- 1.9.4