Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8be04b93 authored by Joe Perches's avatar Joe Perches Committed by Jiri Kosina
Browse files

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: default avatarJoe Perches <joe@perches.com>
Acked-by: default avatar"Theodore Ts'o" <tytso@mit.edu>
Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
parent 85dbe706
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -393,7 +393,7 @@ static struct page **bm_realloc_pages(struct drbd_bitmap *b, unsigned long want)
	 * we must not block on IO to ourselves.
	 * Context is receiver thread or dmsetup. */
	bytes = sizeof(struct page *)*want;
	new_pages = kzalloc(bytes, GFP_NOIO);
	new_pages = kzalloc(bytes, GFP_NOIO | __GFP_NOWARN);
	if (!new_pages) {
		new_pages = __vmalloc(bytes,
				GFP_NOIO | __GFP_HIGHMEM | __GFP_ZERO,
+2 −1
Original line number Diff line number Diff line
@@ -222,7 +222,8 @@ int ipz_queue_ctor(struct ehca_pd *pd, struct ipz_queue *queue,
	queue->small_page = NULL;

	/* allocate queue page pointers */
	queue->queue_pages = kzalloc(nr_of_pages * sizeof(void *), GFP_KERNEL);
	queue->queue_pages = kzalloc(nr_of_pages * sizeof(void *),
				     GFP_KERNEL | __GFP_NOWARN);
	if (!queue->queue_pages) {
		queue->queue_pages = vzalloc(nr_of_pages * sizeof(void *));
		if (!queue->queue_pages) {
+1 −1
Original line number Diff line number Diff line
@@ -1157,7 +1157,7 @@ static void cxgb_redirect(struct dst_entry *old, struct dst_entry *new,
 */
void *cxgb_alloc_mem(unsigned long size)
{
	void *p = kzalloc(size, GFP_KERNEL);
	void *p = kzalloc(size, GFP_KERNEL | __GFP_NOWARN);

	if (!p)
		p = vzalloc(size);
+1 −1
Original line number Diff line number Diff line
@@ -1133,7 +1133,7 @@ out: release_firmware(fw);
 */
void *t4_alloc_mem(size_t size)
{
	void *p = kzalloc(size, GFP_KERNEL);
	void *p = kzalloc(size, GFP_KERNEL | __GFP_NOWARN);

	if (!p)
		p = vzalloc(size);
+4 −4
Original line number Diff line number Diff line
@@ -658,11 +658,11 @@ static inline u32 cxgbi_tag_nonrsvd_bits(struct cxgbi_tag_format *tformat,
static inline void *cxgbi_alloc_big_mem(unsigned int size,
					gfp_t gfp)
{
	void *p = kmalloc(size, gfp);
	void *p = kzalloc(size, gfp | __GFP_NOWARN);

	if (!p)
		p = vmalloc(size);
	if (p)
		memset(p, 0, size);
		p = vzalloc(size);

	return p;
}

Loading