aboutsummaryrefslogtreecommitdiffstats
path: root/include/net
diff options
context:
space:
mode:
authorAlexey Dobriyan <adobriyan@gmail.com>2008-10-28 16:24:06 -0400
committerDavid S. Miller <davem@davemloft.net>2008-10-28 16:24:06 -0400
commitdef8b4faff5ca349beafbbfeb2c51f3602a6ef3a (patch)
treea90fbb0b6ae2a49c507465801f31df77bc5ebf9d /include/net
parentb057efd4d226fcc3a92b0dc6d8ea8e8185ecb260 (diff)
net: reduce structures when XFRM=n
ifdef out * struct sk_buff::sp (pointer) * struct dst_entry::xfrm (pointer) * struct sock::sk_policy (2 pointers) Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net')
-rw-r--r--include/net/dst.h3
-rw-r--r--include/net/sock.h2
-rw-r--r--include/net/xfrm.h4
3 files changed, 8 insertions, 1 deletions
diff --git a/include/net/dst.h b/include/net/dst.h
index 8a8b71e5f3f1..f96c4ba4dd32 100644
--- a/include/net/dst.h
+++ b/include/net/dst.h
@@ -59,8 +59,9 @@ struct dst_entry
59 59
60 struct neighbour *neighbour; 60 struct neighbour *neighbour;
61 struct hh_cache *hh; 61 struct hh_cache *hh;
62#ifdef CONFIG_XFRM
62 struct xfrm_state *xfrm; 63 struct xfrm_state *xfrm;
63 64#endif
64 int (*input)(struct sk_buff*); 65 int (*input)(struct sk_buff*);
65 int (*output)(struct sk_buff*); 66 int (*output)(struct sk_buff*);
66 67
diff --git a/include/net/sock.h b/include/net/sock.h
index ada50c04d09f..d6b750a25078 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -229,7 +229,9 @@ struct sock {
229 } sk_backlog; 229 } sk_backlog;
230 wait_queue_head_t *sk_sleep; 230 wait_queue_head_t *sk_sleep;
231 struct dst_entry *sk_dst_cache; 231 struct dst_entry *sk_dst_cache;
232#ifdef CONFIG_XFRM
232 struct xfrm_policy *sk_policy[2]; 233 struct xfrm_policy *sk_policy[2];
234#endif
233 rwlock_t sk_dst_lock; 235 rwlock_t sk_dst_lock;
234 atomic_t sk_rmem_alloc; 236 atomic_t sk_rmem_alloc;
235 atomic_t sk_wmem_alloc; 237 atomic_t sk_wmem_alloc;
diff --git a/include/net/xfrm.h b/include/net/xfrm.h
index 11c890ad8ebb..f2c5ba28a428 100644
--- a/include/net/xfrm.h
+++ b/include/net/xfrm.h
@@ -882,6 +882,7 @@ struct xfrm_dst
882 u32 path_cookie; 882 u32 path_cookie;
883}; 883};
884 884
885#ifdef CONFIG_XFRM
885static inline void xfrm_dst_destroy(struct xfrm_dst *xdst) 886static inline void xfrm_dst_destroy(struct xfrm_dst *xdst)
886{ 887{
887 dst_release(xdst->route); 888 dst_release(xdst->route);
@@ -894,6 +895,7 @@ static inline void xfrm_dst_destroy(struct xfrm_dst *xdst)
894 xdst->partner = NULL; 895 xdst->partner = NULL;
895#endif 896#endif
896} 897}
898#endif
897 899
898extern void xfrm_dst_ifdown(struct dst_entry *dst, struct net_device *dev); 900extern void xfrm_dst_ifdown(struct dst_entry *dst, struct net_device *dev);
899 901
@@ -1536,9 +1538,11 @@ static inline void xfrm_states_delete(struct xfrm_state **states, int n)
1536} 1538}
1537#endif 1539#endif
1538 1540
1541#ifdef CONFIG_XFRM
1539static inline struct xfrm_state *xfrm_input_state(struct sk_buff *skb) 1542static inline struct xfrm_state *xfrm_input_state(struct sk_buff *skb)
1540{ 1543{
1541 return skb->sp->xvec[skb->sp->len - 1]; 1544 return skb->sp->xvec[skb->sp->len - 1];
1542} 1545}
1546#endif
1543 1547
1544#endif /* _NET_XFRM_H */ 1548#endif /* _NET_XFRM_H */