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 <marc.c.dionne@gmail.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
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));
filp_close(afile->filp, NULL);
}
}
-
- osi_FreeLargeSpace(afile);
+ kfree(afile);
return 0;
}