Merge tag 'gcc-plugins-v4.12-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git...
[sfrench/cifs-2.6.git] / fs / seq_file.c
index ca69fb99e41a8872d6d204d8fd8cffe7f08b3336..dc7c2be963ed4e2c2751313a44270b7655a45b4d 100644 (file)
@@ -25,21 +25,7 @@ static void seq_set_overflow(struct seq_file *m)
 
 static void *seq_buf_alloc(unsigned long size)
 {
-       void *buf;
-       gfp_t gfp = GFP_KERNEL;
-
-       /*
-        * For high order allocations, use __GFP_NORETRY to avoid oom-killing -
-        * it's better to fall back to vmalloc() than to kill things.  For small
-        * allocations, just use GFP_KERNEL which will oom kill, thus no need
-        * for vmalloc fallback.
-        */
-       if (size > PAGE_SIZE)
-               gfp |= __GFP_NORETRY | __GFP_NOWARN;
-       buf = kmalloc(size, gfp);
-       if (!buf && size > PAGE_SIZE)
-               buf = vmalloc(size);
-       return buf;
+       return kvmalloc(size, GFP_KERNEL);
 }
 
 /**