Skip to content

Commit 7b04d71

Browse files
cfd-36Linus Torvalds
authored andcommitted
[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 <[email protected]> Acked-by: Nathan Scott <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent a5d2f46 commit 7b04d71

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

fs/xfs/linux-2.6/xfs_buf.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ free_address(
182182
{
183183
a_list_t *aentry;
184184

185-
aentry = kmalloc(sizeof(a_list_t), GFP_ATOMIC & ~__GFP_HIGH);
185+
aentry = kmalloc(sizeof(a_list_t), GFP_NOWAIT);
186186
if (likely(aentry)) {
187187
spin_lock(&as_lock);
188188
aentry->next = as_free_head;

include/linux/gfp.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@ struct vm_area_struct;
5757
__GFP_NOFAIL|__GFP_NORETRY|__GFP_NO_GROW|__GFP_COMP| \
5858
__GFP_NOMEMALLOC|__GFP_HARDWALL)
5959

60+
/* This equals 0, but use constants in case they ever change */
61+
#define GFP_NOWAIT (GFP_ATOMIC & ~__GFP_HIGH)
6062
/* GFP_ATOMIC means both !wait (__GFP_WAIT not set) and use emergency pool */
6163
#define GFP_ATOMIC (__GFP_HIGH)
6264
#define GFP_NOIO (__GFP_WAIT)

0 commit comments

Comments
 (0)