X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=fs%2Fntfs%2Fmalloc.h;h=fac5944df6d80a2657191eae0aee6128827adb70;hb=6a77f38946aaee1cd85eeec6cf4229b204c15071;hp=af1a1cbfe41c357dcf81f75dd8c72e93569f5438;hpb=5273a3df6485dc2ad6aa7ddd441b9a21970f003b;p=linux-2.6.git diff --git a/fs/ntfs/malloc.h b/fs/ntfs/malloc.h index af1a1cbfe..fac5944df 100644 --- a/fs/ntfs/malloc.h +++ b/fs/ntfs/malloc.h @@ -1,7 +1,7 @@ /* * malloc.h - NTFS kernel memory handling. Part of the Linux-NTFS project. * - * Copyright (c) 2001-2004 Anton Altaparmakov. + * Copyright (c) 2001-2004 Anton Altaparmakov * * This program/include file is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as published @@ -24,6 +24,7 @@ #include #include +#include /** * ntfs_malloc_nofs - allocate memory in multiples of pages @@ -37,13 +38,10 @@ static inline void *ntfs_malloc_nofs(unsigned long size) { if (likely(size <= PAGE_SIZE)) { - if (likely(size)) { - /* kmalloc() has per-CPU caches so is faster for now. */ - return kmalloc(PAGE_SIZE, GFP_NOFS); - /* return (void *)__get_free_page(GFP_NOFS | - __GFP_HIGHMEM); */ - } - BUG(); + BUG_ON(!size); + /* kmalloc() has per-CPU caches so is faster for now. */ + return kmalloc(PAGE_SIZE, GFP_NOFS); + /* return (void *)__get_free_page(GFP_NOFS | __GFP_HIGHMEM); */ } if (likely(size >> PAGE_SHIFT < num_physpages)) return __vmalloc(size, GFP_NOFS | __GFP_HIGHMEM, PAGE_KERNEL); @@ -54,8 +52,9 @@ static inline void ntfs_free(void *addr) { if (likely(((unsigned long)addr < VMALLOC_START) || ((unsigned long)addr >= VMALLOC_END ))) { - return kfree(addr); - /* return free_page((unsigned long)addr); */ + kfree(addr); + /* free_page((unsigned long)addr); */ + return; } vfree(addr); }