]> git.karo-electronics.de Git - mv-sheeva.git/commitdiff
nfs: Take advantage of kmem_cache_zalloc() in nfs_page_alloc()
authorJesper Juhl <jj@chaosbits.net>
Thu, 9 Dec 2010 22:17:15 +0000 (23:17 +0100)
committerTrond Myklebust <Trond.Myklebust@netapp.com>
Tue, 21 Dec 2010 16:51:24 +0000 (11:51 -0500)
Take advantage of kmem_cache_zalloc() in nfs_page_alloc(). Save a call to
memset() and a few bytes.

Before:
 [jj@dragon linux-2.6]$ size fs/nfs/pagelist.o
    text    data     bss     dec     hex filename
    1765       0       8    1773     6ed fs/nfs/pagelist.o
After:
 [jj@dragon linux-2.6]$ size fs/nfs/pagelist.o
    text    data     bss     dec     hex filename
    1749       0       8    1757     6dd fs/nfs/pagelist.o

Signed-off-by: Jesper Juhl <jj@chaosbits.net>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
fs/nfs/pagelist.c

index b68536cc9046ec937b9b4ccddb98b2acf468f1db..e1164e3f9e693a529eb8789f6c0defa28b92e688 100644 (file)
@@ -26,12 +26,9 @@ static struct kmem_cache *nfs_page_cachep;
 static inline struct nfs_page *
 nfs_page_alloc(void)
 {
-       struct nfs_page *p;
-       p = kmem_cache_alloc(nfs_page_cachep, GFP_KERNEL);
-       if (p) {
-               memset(p, 0, sizeof(*p));
+       struct nfs_page *p = kmem_cache_zalloc(nfs_page_cachep, GFP_KERNEL);
+       if (p)
                INIT_LIST_HEAD(&p->wb_list);
-       }
        return p;
 }