Merge git://oss.sgi.com:8090/xfs/xfs-2.6
[linux-drm-fsl-dcu.git] / net / ipv4 / ipvs / ip_vs_lblcr.c
index ce456dbf09a54967c4edde5d648ffd3661e400a1..bf1e7f272b8416c5f84bd8afde6876f1882be044 100644 (file)
  *
  */
 
+#include <linux/ip.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
+#include <linux/skbuff.h>
+#include <linux/jiffies.h>
 
 /* for sysctl */
 #include <linux/fs.h>
@@ -274,7 +277,7 @@ static inline struct ip_vs_dest *ip_vs_dest_set_max(struct ip_vs_dest_set *set)
  */
 struct ip_vs_lblcr_entry {
        struct list_head        list;
-       __u32                   addr;           /* destination IP address */
+       __be32                   addr;           /* destination IP address */
        struct ip_vs_dest_set   set;            /* destination server set */
        unsigned long           lastuse;        /* last used time */
 };
@@ -304,7 +307,7 @@ static ctl_table vs_vars_table[] = {
                .procname       = "lblcr_expiration",
                .data           = &sysctl_ip_vs_lblcr_expiration,
                .maxlen         = sizeof(int),
-               .mode           = 0644, 
+               .mode           = 0644,
                .proc_handler   = &proc_dointvec_jiffies,
        },
        { .ctl_name = 0 }
@@ -323,7 +326,7 @@ static ctl_table vs_table[] = {
 static ctl_table ipvs_ipv4_table[] = {
        {
                .ctl_name       = NET_IPV4,
-               .procname       = "ipv4", 
+               .procname       = "ipv4",
                .mode           = 0555,
                .child          = vs_table
        },
@@ -333,8 +336,8 @@ static ctl_table ipvs_ipv4_table[] = {
 static ctl_table lblcr_root_table[] = {
        {
                .ctl_name       = CTL_NET,
-               .procname       = "net", 
-               .mode           = 0555, 
+               .procname       = "net",
+               .mode           = 0555,
                .child          = ipvs_ipv4_table
        },
        { .ctl_name = 0 }
@@ -346,7 +349,7 @@ static struct ctl_table_header * sysctl_header;
  *      new/free a ip_vs_lblcr_entry, which is a mapping of a destination
  *      IP address to a server.
  */
-static inline struct ip_vs_lblcr_entry *ip_vs_lblcr_new(__u32 daddr)
+static inline struct ip_vs_lblcr_entry *ip_vs_lblcr_new(__be32 daddr)
 {
        struct ip_vs_lblcr_entry *en;
 
@@ -379,7 +382,7 @@ static inline void ip_vs_lblcr_free(struct ip_vs_lblcr_entry *en)
 /*
  *     Returns hash value for IPVS LBLCR entry
  */
-static inline unsigned ip_vs_lblcr_hashkey(__u32 addr)
+static inline unsigned ip_vs_lblcr_hashkey(__be32 addr)
 {
        return (ntohl(addr)*2654435761UL) & IP_VS_LBLCR_TAB_MASK;
 }
@@ -414,38 +417,11 @@ ip_vs_lblcr_hash(struct ip_vs_lblcr_table *tbl, struct ip_vs_lblcr_entry *en)
 }
 
 
-#if 0000
-/*
- *     Unhash ip_vs_lblcr_entry from ip_vs_lblcr_table.
- *     returns bool success.
- */
-static int ip_vs_lblcr_unhash(struct ip_vs_lblcr_table *tbl,
-                            struct ip_vs_lblcr_entry *en)
-{
-       if (list_empty(&en->list)) {
-               IP_VS_ERR("ip_vs_lblcr_unhash(): request for not hashed entry, "
-                         "called from %p\n", __builtin_return_address(0));
-               return 0;
-       }
-
-       /*
-        * Remove it from the table
-        */
-       write_lock(&tbl->lock);
-       list_del(&en->list);
-       INIT_LIST_HEAD(&en->list);
-       write_unlock(&tbl->lock);
-
-       return 1;
-}
-#endif
-
-
 /*
  *  Get ip_vs_lblcr_entry associated with supplied parameters.
  */
 static inline struct ip_vs_lblcr_entry *
-ip_vs_lblcr_get(struct ip_vs_lblcr_table *tbl, __u32 addr)
+ip_vs_lblcr_get(struct ip_vs_lblcr_table *tbl, __be32 addr)
 {
        unsigned hash;
        struct ip_vs_lblcr_entry *en;