From: Jeff Dike Date: Tue, 11 Apr 2006 05:53:27 +0000 (-0700) Subject: [PATCH] Add GFP_NOWAIT X-Git-Tag: v2.6.17-rc2~243 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=7b04d7170e9af805cac19f97b28fff10db897893;p=linux-2.6-omap-h63xx.git [PATCH] Add GFP_NOWAIT Introduce GFP_NOWAIT, as an alias for GFP_ATOMIC & ~__GFP_HIGH. This also changes XFS, which is the only in-tree user of this idiom that I could find. The XFS piece is compile-tested only. Signed-off-by: Jeff Dike Acked-by: Nathan Scott Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/fs/xfs/linux-2.6/xfs_buf.c b/fs/xfs/linux-2.6/xfs_buf.c index 9fb0312665c..26fed0756f0 100644 --- a/fs/xfs/linux-2.6/xfs_buf.c +++ b/fs/xfs/linux-2.6/xfs_buf.c @@ -182,7 +182,7 @@ free_address( { a_list_t *aentry; - aentry = kmalloc(sizeof(a_list_t), GFP_ATOMIC & ~__GFP_HIGH); + aentry = kmalloc(sizeof(a_list_t), GFP_NOWAIT); if (likely(aentry)) { spin_lock(&as_lock); aentry->next = as_free_head; diff --git a/include/linux/gfp.h b/include/linux/gfp.h index 7851e6b520c..3ac452945a7 100644 --- a/include/linux/gfp.h +++ b/include/linux/gfp.h @@ -57,6 +57,8 @@ struct vm_area_struct; __GFP_NOFAIL|__GFP_NORETRY|__GFP_NO_GROW|__GFP_COMP| \ __GFP_NOMEMALLOC|__GFP_HARDWALL) +/* This equals 0, but use constants in case they ever change */ +#define GFP_NOWAIT (GFP_ATOMIC & ~__GFP_HIGH) /* GFP_ATOMIC means both !wait (__GFP_WAIT not set) and use emergency pool */ #define GFP_ATOMIC (__GFP_HIGH) #define GFP_NOIO (__GFP_WAIT)