Skip to content

Commit

Permalink
skbuff: Replace open-coded skb_propagate_pfmemalloc()s
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Gal Pressman authored and Jakub Kicinski committed Mar 11, 2023
1 parent f758bfe commit 566b670
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions net/core/skbuff.c
Original file line number Diff line number Diff line change
Expand Up @@ -422,8 +422,7 @@ struct sk_buff *build_skb(void *data, unsigned int frag_size)

if (skb && frag_size) {
skb->head_frag = 1;
if (page_is_pfmemalloc(virt_to_head_page(data)))
skb->pfmemalloc = 1;
skb_propagate_pfmemalloc(virt_to_head_page(data), skb);
}
return skb;
}
Expand All @@ -445,8 +444,7 @@ struct sk_buff *build_skb_around(struct sk_buff *skb,

if (frag_size) {
skb->head_frag = 1;
if (page_is_pfmemalloc(virt_to_head_page(data)))
skb->pfmemalloc = 1;
skb_propagate_pfmemalloc(virt_to_head_page(data), skb);
}
return skb;
}
Expand Down

0 comments on commit 566b670

Please sign in to comment.