From 8be04b9374e59923fa337766aaa74151b95b7099 Mon Sep 17 00:00:00 2001 From: Joe Perches Date: Wed, 19 Jun 2013 12:15:53 -0700 Subject: treewide: Add __GFP_NOWARN to k.alloc calls with v.alloc fallbacks Don't emit OOM warnings when k.alloc calls fail when there there is a v.alloc immediately afterwards. Converted a kmalloc/vmalloc with memset to kzalloc/vzalloc. Signed-off-by: Joe Perches Acked-by: "Theodore Ts'o" Signed-off-by: Jiri Kosina --- fs/btrfs/send.c | 2 +- fs/ext4/super.c | 4 ++-- fs/gfs2/dir.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) (limited to 'fs') diff --git a/fs/btrfs/send.c b/fs/btrfs/send.c index d3f3b43cae0b..2e14fd89a8b4 100644 --- a/fs/btrfs/send.c +++ b/fs/btrfs/send.c @@ -219,7 +219,7 @@ static int fs_path_ensure_buf(struct fs_path *p, int len) len = PAGE_ALIGN(len); if (p->buf == p->inline_buf) { - tmp_buf = kmalloc(len, GFP_NOFS); + tmp_buf = kmalloc(len, GFP_NOFS | __GFP_NOWARN); if (!tmp_buf) { tmp_buf = vmalloc(len); if (!tmp_buf) diff --git a/fs/ext4/super.c b/fs/ext4/super.c index bca26f34edf4..ffdfe385b029 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c @@ -162,7 +162,7 @@ void *ext4_kvmalloc(size_t size, gfp_t flags) { void *ret; - ret = kmalloc(size, flags); + ret = kmalloc(size, flags | __GFP_NOWARN); if (!ret) ret = __vmalloc(size, flags, PAGE_KERNEL); return ret; @@ -172,7 +172,7 @@ void *ext4_kvzalloc(size_t size, gfp_t flags) { void *ret; - ret = kzalloc(size, flags); + ret = kzalloc(size, flags | __GFP_NOWARN); if (!ret) ret = __vmalloc(size, flags | __GFP_ZERO, PAGE_KERNEL); return ret; diff --git a/fs/gfs2/dir.c b/fs/gfs2/dir.c index 0cb4c1557f20..2e5fc268d324 100644 --- a/fs/gfs2/dir.c +++ b/fs/gfs2/dir.c @@ -1859,7 +1859,7 @@ static int leaf_dealloc(struct gfs2_inode *dip, u32 index, u32 len, memset(&rlist, 0, sizeof(struct gfs2_rgrp_list)); - ht = kzalloc(size, GFP_NOFS); + ht = kzalloc(size, GFP_NOFS | __GFP_NOWARN); if (ht == NULL) ht = vzalloc(size); if (!ht) -- cgit v1.2.3-59-g8ed1b