**/
struct bio *bio_alloc(int gfp_mask, int nr_iovecs)
{
- int pf_flags = current->flags;
struct bio_vec *bvl = NULL;
unsigned long idx;
struct bio *bio;
- current->flags |= PF_NOWARN;
bio = mempool_alloc(bio_pool, gfp_mask);
if (unlikely(!bio))
goto out;
bio->bi_io_vec = bvl;
bio->bi_destructor = bio_destructor;
out:
- current->flags = pf_flags;
return bio;
}
head = NULL;
offset = PAGE_SIZE;
while ((offset -= size) >= 0) {
- int pf_flags = current->flags;
-
- current->flags |= PF_NOWARN;
bh = alloc_buffer_head();
- current->flags = pf_flags;
if (!bh)
goto no_grow;
#define BN_ALIGN_MASK ((1 << (PAGE_CACHE_SHIFT - BBSHIFT)) - 1)
#ifndef GFP_READAHEAD
-#define GFP_READAHEAD 0
+#define GFP_READAHEAD __GFP_NOWARN
#endif
/*
return;
flags |= (PBF_TRYLOCK|PBF_READ|PBF_ASYNC|PBF_MAPPABLE|PBF_READ_AHEAD);
-
- /* don't complain on allocation failure, it's fine with us */
- current->flags |= PF_NOWARN;
pagebuf_get(target, ioff, isize, flags);
- current->flags &= ~PF_NOWARN;
}
page_buf_t *
#define __GFP_HIGHIO 0x80 /* Can start high mem physical IO? */
#define __GFP_FS 0x100 /* Can call down to low-level FS? */
#define __GFP_COLD 0x200 /* Cache-cold page required */
+#define __GFP_NOWARN 0x400 /* Suppress page allocation failure warning */
#define GFP_NOHIGHIO ( __GFP_WAIT | __GFP_IO)
#define GFP_NOIO ( __GFP_WAIT)
#define PF_MEMALLOC 0x00000800 /* Allocating memory */
#define PF_MEMDIE 0x00001000 /* Killed for out-of-memory */
#define PF_FLUSHER 0x00002000 /* responsible for disk writeback */
-#define PF_NOWARN 0x00004000 /* debug: don't warn if alloc fails */
-#define PF_FREEZE 0x00008000 /* this task should be frozen for suspend */
-#define PF_IOTHREAD 0x00010000 /* this thread is needed for doing I/O to swap */
-#define PF_FROZEN 0x00020000 /* frozen for system suspend */
-#define PF_FSTRANS 0x00040000 /* inside a filesystem transaction */
-#define PF_KSWAPD 0x00080000 /* I am kswapd */
+#define PF_FREEZE 0x00004000 /* this task should be frozen for suspend */
+#define PF_IOTHREAD 0x00008000 /* this thread is needed for doing I/O to swap */
+#define PF_FROZEN 0x00010000 /* frozen for system suspend */
+#define PF_FSTRANS 0x00020000 /* inside a filesystem transaction */
+#define PF_KSWAPD 0x00040000 /* I am kswapd */
/*
* Ptrace flags
#define SLAB_KERNEL GFP_KERNEL
#define SLAB_DMA GFP_DMA
-#define SLAB_LEVEL_MASK (__GFP_WAIT|__GFP_HIGH|__GFP_IO|__GFP_HIGHIO|__GFP_FS)
+#define SLAB_LEVEL_MASK (__GFP_WAIT|__GFP_HIGH|__GFP_IO|__GFP_HIGHIO|__GFP_FS|__GFP_COLD|__GFP_NOWARN)
#define SLAB_NO_GROW 0x00001000UL /* don't grow a cache */
/* flags to pass to kmem_cache_create().
unsigned long flags;
DEFINE_WAIT(wait);
int gfp_nowait = gfp_mask & ~(__GFP_WAIT | __GFP_IO);
- int pf_flags = current->flags;
repeat_alloc:
- current->flags |= PF_NOWARN;
- element = pool->alloc(gfp_nowait, pool->pool_data);
- current->flags = pf_flags;
+ element = pool->alloc(gfp_nowait|__GFP_NOWARN, pool->pool_data);
if (likely(element != NULL))
return element;
}
nopage:
- if (!(current->flags & PF_NOWARN)) {
+ if (!(gfp_mask & __GFP_NOWARN)) {
printk("%s: page allocation failure."
" order:%d, mode:0x%x\n",
current->comm, order, gfp_mask);
pf_flags = current->flags;
current->flags &= ~PF_MEMALLOC;
- current->flags |= PF_NOWARN;
/*
* Add it to the swap cache and mark it dirty
*/
err = add_to_page_cache(page, &swapper_space, entry.val);
- if (!(pf_flags & PF_NOWARN))
- current->flags &= ~PF_NOWARN;
if (pf_flags & PF_MEMALLOC)
current->flags |= PF_MEMALLOC;