aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/linux-2.6
diff options
context:
space:
mode:
Diffstat (limited to 'fs/xfs/linux-2.6')
-rw-r--r--fs/xfs/linux-2.6/kmem.c8
-rw-r--r--fs/xfs/linux-2.6/kmem.h3
-rw-r--r--fs/xfs/linux-2.6/xfs_buf.c2
3 files changed, 11 insertions, 2 deletions
diff --git a/fs/xfs/linux-2.6/kmem.c b/fs/xfs/linux-2.6/kmem.c
index aba7fcf881a2..f77fe5c8fcc1 100644
--- a/fs/xfs/linux-2.6/kmem.c
+++ b/fs/xfs/linux-2.6/kmem.c
@@ -34,6 +34,14 @@ kmem_alloc(size_t size, unsigned int __nocast flags)
34 gfp_t lflags = kmem_flags_convert(flags); 34 gfp_t lflags = kmem_flags_convert(flags);
35 void *ptr; 35 void *ptr;
36 36
37#ifdef DEBUG
38 if (unlikely(!(flags & KM_LARGE) && (size > PAGE_SIZE))) {
39 printk(KERN_WARNING "Large %s attempt, size=%ld\n",
40 __FUNCTION__, (long)size);
41 dump_stack();
42 }
43#endif
44
37 do { 45 do {
38 if (size < MAX_SLAB_SIZE || retries > MAX_VMALLOCS) 46 if (size < MAX_SLAB_SIZE || retries > MAX_VMALLOCS)
39 ptr = kmalloc(size, lflags); 47 ptr = kmalloc(size, lflags);
diff --git a/fs/xfs/linux-2.6/kmem.h b/fs/xfs/linux-2.6/kmem.h
index 0e8293c5a32f..6d24274fb3cb 100644
--- a/fs/xfs/linux-2.6/kmem.h
+++ b/fs/xfs/linux-2.6/kmem.h
@@ -30,6 +30,7 @@
30#define KM_NOSLEEP 0x0002u 30#define KM_NOSLEEP 0x0002u
31#define KM_NOFS 0x0004u 31#define KM_NOFS 0x0004u
32#define KM_MAYFAIL 0x0008u 32#define KM_MAYFAIL 0x0008u
33#define KM_LARGE 0x0010u
33 34
34/* 35/*
35 * We use a special process flag to avoid recursive callbacks into 36 * We use a special process flag to avoid recursive callbacks into
@@ -41,7 +42,7 @@ kmem_flags_convert(unsigned int __nocast flags)
41{ 42{
42 gfp_t lflags; 43 gfp_t lflags;
43 44
44 BUG_ON(flags & ~(KM_SLEEP|KM_NOSLEEP|KM_NOFS|KM_MAYFAIL)); 45 BUG_ON(flags & ~(KM_SLEEP|KM_NOSLEEP|KM_NOFS|KM_MAYFAIL|KM_LARGE));
45 46
46 if (flags & KM_NOSLEEP) { 47 if (flags & KM_NOSLEEP) {
47 lflags = GFP_ATOMIC | __GFP_NOWARN; 48 lflags = GFP_ATOMIC | __GFP_NOWARN;
diff --git a/fs/xfs/linux-2.6/xfs_buf.c b/fs/xfs/linux-2.6/xfs_buf.c
index 247adced6e1b..58b6599de619 100644
--- a/fs/xfs/linux-2.6/xfs_buf.c
+++ b/fs/xfs/linux-2.6/xfs_buf.c
@@ -768,7 +768,7 @@ xfs_buf_get_noaddr(
768 _xfs_buf_initialize(bp, target, 0, len, 0); 768 _xfs_buf_initialize(bp, target, 0, len, 0);
769 769
770 try_again: 770 try_again:
771 data = kmem_alloc(malloc_len, KM_SLEEP | KM_MAYFAIL); 771 data = kmem_alloc(malloc_len, KM_SLEEP | KM_MAYFAIL | KM_LARGE);
772 if (unlikely(data == NULL)) 772 if (unlikely(data == NULL))
773 goto fail_free_buf; 773 goto fail_free_buf;
774 774