diff options
author | Gal Pressman <gal@nvidia.com> | 2023-03-08 15:17:19 +0200 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2023-03-10 16:49:21 -0800 |
commit | 566b6701d5dfc823d1e7ee27a7f0c5719f4b93dd (patch) | |
tree | 513e6db66a951d93ee8bd383e25e31da62e363d2 | |
parent | f758bfec377ad2f15d7683473b1db1cfbf8e1bb0 (diff) |
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>
-rw-r--r-- | net/core/skbuff.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/net/core/skbuff.c b/net/core/skbuff.c index 1a31815104d6..de465368fc2c 100644 --- a/net/core/skbuff.c +++ b/net/core/skbuff.c @@ -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; } @@ -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; } |