Skip to content

Commit 566b670

Browse files
gal-pressmankuba-moo
authored andcommitted
skbuff: Replace open-coded skb_propagate_pfmemalloc()s
Use skb_propagate_pfmemalloc() in build_skb()/build_skb_around() instead of open-coding it. Reviewed-by: Tariq Toukan <tariqt@nvidia.com> Signed-off-by: Gal Pressman <gal@nvidia.com> Reviewed-by: Simon Horman <simon.horman@corigine.com> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent f758bfe commit 566b670

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

net/core/skbuff.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -422,8 +422,7 @@ struct sk_buff *build_skb(void *data, unsigned int frag_size)
422422

423423
if (skb && frag_size) {
424424
skb->head_frag = 1;
425-
if (page_is_pfmemalloc(virt_to_head_page(data)))
426-
skb->pfmemalloc = 1;
425+
skb_propagate_pfmemalloc(virt_to_head_page(data), skb);
427426
}
428427
return skb;
429428
}
@@ -445,8 +444,7 @@ struct sk_buff *build_skb_around(struct sk_buff *skb,
445444

446445
if (frag_size) {
447446
skb->head_frag = 1;
448-
if (page_is_pfmemalloc(virt_to_head_page(data)))
449-
skb->pfmemalloc = 1;
447+
skb_propagate_pfmemalloc(virt_to_head_page(data), skb);
450448
}
451449
return skb;
452450
}

0 commit comments

Comments
 (0)