Whamcloud - gitweb
* Removed the (new) tcp zero-copy patches
[fs/lustre-release.git] / lustre / kernel_patches / patches / grab_cache_page_nowait_gfp-2.4.21-suse2.patch
1 Index: linux-2.4.21-suse2/mm/filemap.c
2 ===================================================================
3 --- linux-2.4.21-suse2.orig/mm/filemap.c        2005-04-04 05:58:21.000000000 -0600
4 +++ linux-2.4.21-suse2/mm/filemap.c     2005-04-04 06:18:57.000000000 -0600
5 @@ -1022,6 +1022,14 @@
6   */
7  struct page *grab_cache_page_nowait(struct address_space *mapping, unsigned long index)
8  {
9 +       return grab_cache_page_nowait_gfp(mapping, index, mapping->gfp_mask);
10 +}
11 +
12 +
13 +struct page *grab_cache_page_nowait_gfp(struct address_space *mapping,
14 +                                       unsigned long index, 
15 +                                       unsigned int gfp_mask)
16 +{
17         struct page *page, **hash;
18  
19         hash = page_hash(mapping, index);
20 @@ -1046,7 +1054,7 @@
21                 }
22         }
23  
24 -       page = page_cache_alloc(mapping);
25 +       page = alloc_pages(gfp_mask, 0);
26         if ( unlikely(!page) )
27                 return NULL;    /* Failed to allocate a page */
28  
29 Index: linux-2.4.21-suse2/mm/page_alloc.c
30 ===================================================================
31 --- linux-2.4.21-suse2.orig/mm/page_alloc.c     2005-04-04 05:58:04.000000000 -0600
32 +++ linux-2.4.21-suse2/mm/page_alloc.c  2005-04-04 06:12:11.000000000 -0600
33 @@ -435,7 +435,7 @@
34                         break;
35  
36                 min = z->watermarks[class_idx].min;
37 -               if (!(gfp_mask & __GFP_WAIT))
38 +               if (!(gfp_mask & __GFP_WAIT) && (gfp_mask & __GFP_HIGH))
39                         min >>= 2;
40                 else if (current->rt_priority)
41                         min >>= 1;
42 @@ -504,6 +504,7 @@
43         }
44  
45   out:
46 +       if (!(gfp_mask & __GFP_NOWARN))
47         printk(KERN_NOTICE "__alloc_pages: %u-order allocation failed (gfp=0x%x/%i)\n",
48                order, gfp_mask, !!(current->flags & PF_MEMALLOC));
49         if (unlikely(vm_gfp_debug))
50 Index: linux-2.4.21-suse2/kernel/ksyms.c
51 ===================================================================
52 --- linux-2.4.21-suse2.orig/kernel/ksyms.c      2005-04-04 06:01:39.000000000 -0600
53 +++ linux-2.4.21-suse2/kernel/ksyms.c   2005-04-04 06:01:43.000000000 -0600
54 @@ -326,6 +326,7 @@
55  EXPORT_SYMBOL(__find_lock_page);
56  EXPORT_SYMBOL(find_or_create_page);
57  EXPORT_SYMBOL(grab_cache_page_nowait);
58 +EXPORT_SYMBOL(grab_cache_page_nowait_gfp);
59  EXPORT_SYMBOL(read_cache_page);
60  EXPORT_SYMBOL(set_page_dirty);
61  EXPORT_SYMBOL(vfs_readlink);
62 Index: linux-2.4.21-suse2/include/linux/pagemap.h
63 ===================================================================
64 --- linux-2.4.21-suse2.orig/include/linux/pagemap.h     2003-11-10 17:44:33.000000000 -0700
65 +++ linux-2.4.21-suse2/include/linux/pagemap.h  2005-04-04 06:01:43.000000000 -0600
66 @@ -110,6 +110,7 @@
67  
68  
69  extern struct page * grab_cache_page_nowait (struct address_space *, unsigned long);
70 +extern struct page * grab_cache_page_nowait_gfp (struct address_space *, unsigned long, unsigned int);
71  
72  typedef int filler_t(void *, struct page*);
73  
74 Index: linux-2.4.21-suse2/include/linux/mm.h
75 ===================================================================
76 --- linux-2.4.21-suse2.orig/include/linux/mm.h  2005-04-04 05:58:14.000000000 -0600
77 +++ linux-2.4.21-suse2/include/linux/mm.h       2005-04-04 06:17:10.000000000 -0600
78 @@ -661,6 +661,7 @@
79  #define __GFP_IO       0x40    /* Can start low memory physical IO? */
80  #define __GFP_HIGHIO   0x80    /* Can start high mem physical IO? */
81  #define __GFP_FS       0x100   /* Can call down to low-level FS? */
82 +#define __GFP_NOWARN   0x200   /* Don't warn on allocation failure */
83  
84  #define GFP_NOHIGHIO   (__GFP_HIGH | __GFP_WAIT | __GFP_IO)
85  #define GFP_NOIO       (__GFP_HIGH | __GFP_WAIT)