Aughment kmalloc(size, GFP_XXXXX) with kmalloc_XXXXX(size) (inline of course)?
You may use this form in those 90% cases where flags are constant.
This also gets rid of GFP_ prefixes (shorter).
Ingo, Rusty?
-- vda--- linux-2.5.36/include/linux/slab.h.orig Tue Sep 24 11:00:42 2002 +++ linux-2.5.36/include/linux/slab.h Tue Sep 24 11:06:32 2002 @@ -61,6 +61,15 @@
extern void *kmalloc(size_t, int); extern void kfree(const void *); +extern inline void *kmalloc_NOHIGHIO(size_t sz) { return kmalloc(sz, GFP_NOHIGHIO); } +extern inline void *kmalloc_NOIO (size_t sz) { return kmalloc(sz, GFP_NOIO ); } +extern inline void *kmalloc_NOFS (size_t sz) { return kmalloc(sz, GFP_NOFS ); } +extern inline void *kmalloc_ATOMIC (size_t sz) { return kmalloc(sz, GFP_ATOMIC ); } +extern inline void *kmalloc_USER (size_t sz) { return kmalloc(sz, GFP_USER ); } +extern inline void *kmalloc_HIGHUSER(size_t sz) { return kmalloc(sz, GFP_HIGHUSER); } +extern inline void *kmalloc_KERNEL (size_t sz) { return kmalloc(sz, GFP_KERNEL ); } +extern inline void *kmalloc_NFS (size_t sz) { return kmalloc(sz, GFP_NFS ); } +extern inline void *kmalloc_KSWAPD (size_t sz) { return kmalloc(sz, GFP_KSWAPD ); }
extern int FASTCALL(kmem_cache_reap(int));
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/