]> git.hungrycats.org Git - linux/commitdiff
[PATCH] Remove PF_NOWARN
authorAndrew Morton <akpm@digeo.com>
Sat, 21 Dec 2002 09:07:27 +0000 (01:07 -0800)
committerLinus Torvalds <torvalds@home.transmeta.com>
Sat, 21 Dec 2002 09:07:27 +0000 (01:07 -0800)
We keep getting in a mess with the current->flags setting and
unsetting.

Remove current->flags:PF_NOWARN and create __GFP_NOWARN instead.

fs/bio.c
fs/buffer.c
fs/xfs/pagebuf/page_buf.c
include/linux/gfp.h
include/linux/sched.h
include/linux/slab.h
mm/mempool.c
mm/page_alloc.c
mm/swap_state.c

index 6e7f245649d3a84a91a2626f3ff37ac549168e1b..cbb5b26807b3e18dd0952d8efc34c0f6d527cbfe 100644 (file)
--- a/fs/bio.c
+++ b/fs/bio.c
@@ -137,12 +137,10 @@ inline void bio_init(struct bio *bio)
  **/
 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;
@@ -160,7 +158,6 @@ noiovec:
                bio->bi_io_vec = bvl;
                bio->bi_destructor = bio_destructor;
 out:
-               current->flags = pf_flags;
                return bio;
        }
 
index bbe4d3b780c52af26498b48667f7a4173e0e17b2..148753e121eb0b539c6cd6d4b6e58c9fed1b2791 100644 (file)
@@ -923,11 +923,7 @@ try_again:
        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;
 
index 6c1b1b2760e0f1ac500db03c238c9453dd22daf0..76f6d213b0134b40c10542e1b9f70bce1c728f38 100644 (file)
@@ -67,7 +67,7 @@
 #define BN_ALIGN_MASK  ((1 << (PAGE_CACHE_SHIFT - BBSHIFT)) - 1)
 
 #ifndef GFP_READAHEAD
-#define GFP_READAHEAD  0
+#define GFP_READAHEAD  __GFP_NOWARN
 #endif
 
 /*
@@ -806,11 +806,7 @@ pagebuf_readahead(
                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 *
index 8e093813e4f7a05772bb5f7c7258b9879b304b76..54bf03eaf3e78506fa7bb26b32f5024c8a562b58 100644 (file)
@@ -18,6 +18,7 @@
 #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)
index d0726cb87145b6ca466e757e634deb61c703cb0b..7c3bbfc255eda17b0d54abe4b51b44e3ad7a0402 100644 (file)
@@ -419,13 +419,12 @@ do { if (atomic_dec_and_test(&(tsk)->usage)) __put_task_struct(tsk); } while(0)
 #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
index 3a5a6d576f939e625d55344787a59b0a75aa7c39..997bc710bfb0803250b859f437d9d8eded4d7733 100644 (file)
@@ -23,7 +23,7 @@ typedef struct kmem_cache_s kmem_cache_t;
 #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().
index 3417c8e38b07f000d46a7b643b14f5a0c3cf3c99..bfa262857358aba88e9ece4f49223b074d73d151 100644 (file)
@@ -187,12 +187,9 @@ void * mempool_alloc(mempool_t *pool, int gfp_mask)
        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;
 
index 84550e8c4ba02fe5377f7926cc18494f1716ad93..7de787fd57d90835cecb968c927ee93761fc8378 100644 (file)
@@ -543,7 +543,7 @@ rebalance:
        }
 
 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);
index 91f84bf8307b1b4c3ebc0382d25949ee903e9e71..47269578b68915f2279d3e58678675bef54574be 100644 (file)
@@ -145,15 +145,12 @@ int add_to_swap(struct page * page)
 
                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;