nfsd: track last inode only in use_wgather case
[safe/jmp/linux-2.6] / include / net / dst.h
index c5c318a..6be3b08 100644 (file)
@@ -59,8 +59,11 @@ struct dst_entry
 
        struct neighbour        *neighbour;
        struct hh_cache         *hh;
+#ifdef CONFIG_XFRM
        struct xfrm_state       *xfrm;
-
+#else
+       void                    *__pad1;
+#endif
        int                     (*input)(struct sk_buff*);
        int                     (*output)(struct sk_buff*);
 
@@ -70,8 +73,20 @@ struct dst_entry
 
 #ifdef CONFIG_NET_CLS_ROUTE
        __u32                   tclassid;
+#else
+       __u32                   __pad2;
 #endif
 
+
+       /*
+        * Align __refcnt to a 64 bytes alignment
+        * (L1_CACHE_SIZE would be too much)
+        */
+#ifdef CONFIG_64BIT
+       long                    __pad_to_align_refcnt[2];
+#else
+       long                    __pad_to_align_refcnt[1];
+#endif
        /*
         * __refcnt wants to be on a different cache line from
         * input/output/ops or performance tanks badly
@@ -103,7 +118,6 @@ struct dst_ops
        void                    (*link_failure)(struct sk_buff *);
        void                    (*update_pmtu)(struct dst_entry *dst, u32 mtu);
        int                     (*local_out)(struct sk_buff *skb);
-       int                     entry_size;
 
        atomic_t                entries;
        struct kmem_cache               *kmem_cachep;
@@ -157,6 +171,11 @@ dst_metric_locked(struct dst_entry *dst, int metric)
 
 static inline void dst_hold(struct dst_entry * dst)
 {
+       /*
+        * If your kernel compilation stops here, please check
+        * __pad_to_align_refcnt declaration in struct dst_entry
+        */
+       BUILD_BUG_ON(offsetof(struct dst_entry, __refcnt) & 63);
        atomic_inc(&dst->__refcnt);
 }
 
@@ -252,17 +271,7 @@ static inline int dst_output(struct sk_buff *skb)
 /* Input packet from network to transport.  */
 static inline int dst_input(struct sk_buff *skb)
 {
-       int err;
-
-       for (;;) {
-               err = skb->dst->input(skb);
-
-               if (likely(err == 0))
-                       return err;
-               /* Oh, Jamal... Seems, I will not forgive you this mess. :-) */
-               if (unlikely(err != NET_XMIT_BYPASS))
-                       return err;
-       }
+       return skb->dst->input(skb);
 }
 
 static inline struct dst_entry *dst_check(struct dst_entry *dst, u32 cookie)
@@ -282,21 +291,21 @@ enum {
 
 struct flowi;
 #ifndef CONFIG_XFRM
-static inline int xfrm_lookup(struct dst_entry **dst_p, struct flowi *fl,
-                      struct sock *sk, int flags)
+static inline int xfrm_lookup(struct net *net, struct dst_entry **dst_p,
+                             struct flowi *fl, struct sock *sk, int flags)
 {
        return 0;
 } 
-static inline int __xfrm_lookup(struct dst_entry **dst_p, struct flowi *fl,
-                               struct sock *sk, int flags)
+static inline int __xfrm_lookup(struct net *net, struct dst_entry **dst_p,
+                               struct flowi *fl, struct sock *sk, int flags)
 {
        return 0;
 }
 #else
-extern int xfrm_lookup(struct dst_entry **dst_p, struct flowi *fl,
-                      struct sock *sk, int flags);
-extern int __xfrm_lookup(struct dst_entry **dst_p, struct flowi *fl,
-                        struct sock *sk, int flags);
+extern int xfrm_lookup(struct net *net, struct dst_entry **dst_p,
+                      struct flowi *fl, struct sock *sk, int flags);
+extern int __xfrm_lookup(struct net *net, struct dst_entry **dst_p,
+                        struct flowi *fl, struct sock *sk, int flags);
 #endif
 #endif