Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

sock: remove one redundant SKB_FRAG_PAGE_ORDER macro

Both SKB_FRAG_PAGE_ORDER are defined to the same value in
net/core/sock.c and drivers/vhost/net.c.

Move the SKB_FRAG_PAGE_ORDER definition to net/core/sock.h,
as both net/core/sock.c and drivers/vhost/net.c include it,
and it seems a reasonable file to put the macro.

Signed-off-by: Yunsheng Lin <linyunsheng@huawei.com>
Acked-by: Jason Wang <jasowang@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Yunsheng Lin and committed by
David S. Miller
723783d0 5e8243e6

+1 -3
-2
drivers/vhost/net.c
··· 643 643 !vhost_vq_avail_empty(vq->dev, vq); 644 644 } 645 645 646 - #define SKB_FRAG_PAGE_ORDER get_order(32768) 647 - 648 646 static bool vhost_net_page_frag_refill(struct vhost_net *net, unsigned int sz, 649 647 struct page_frag *pfrag, gfp_t gfp) 650 648 {
+1
include/net/sock.h
··· 2717 2717 extern __u32 sysctl_wmem_default; 2718 2718 extern __u32 sysctl_rmem_default; 2719 2719 2720 + #define SKB_FRAG_PAGE_ORDER get_order(32768) 2720 2721 DECLARE_STATIC_KEY_FALSE(net_high_order_alloc_disable_key); 2721 2722 2722 2723 static inline int sk_get_wmem0(const struct sock *sk, const struct proto *proto)
-1
net/core/sock.c
··· 2574 2574 } 2575 2575 } 2576 2576 2577 - #define SKB_FRAG_PAGE_ORDER get_order(32768) 2578 2577 DEFINE_STATIC_KEY_FALSE(net_high_order_alloc_disable_key); 2579 2578 2580 2579 /**