aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--net/ipv4/ipvs/ip_vs_lblcr.c76
1 files changed, 0 insertions, 76 deletions
diff --git a/net/ipv4/ipvs/ip_vs_lblcr.c b/net/ipv4/ipvs/ip_vs_lblcr.c
index 6a1fec416eaf..427b593c1069 100644
--- a/net/ipv4/ipvs/ip_vs_lblcr.c
+++ b/net/ipv4/ipvs/ip_vs_lblcr.c
@@ -48,8 +48,6 @@
48/* for sysctl */ 48/* for sysctl */
49#include <linux/fs.h> 49#include <linux/fs.h>
50#include <linux/sysctl.h> 50#include <linux/sysctl.h>
51/* for proc_net_create/proc_net_remove */
52#include <linux/proc_fs.h>
53#include <net/net_namespace.h> 51#include <net/net_namespace.h>
54 52
55#include <net/ip_vs.h> 53#include <net/ip_vs.h>
@@ -547,71 +545,6 @@ static void ip_vs_lblcr_check_expire(unsigned long data)
547 mod_timer(&tbl->periodic_timer, jiffies+CHECK_EXPIRE_INTERVAL); 545 mod_timer(&tbl->periodic_timer, jiffies+CHECK_EXPIRE_INTERVAL);
548} 546}
549 547
550
551#ifdef CONFIG_IP_VS_LBLCR_DEBUG
552static struct ip_vs_lblcr_table *lblcr_table_list;
553
554/*
555 * /proc/net/ip_vs_lblcr to display the mappings of
556 * destination IP address <==> its serverSet
557 */
558static int
559ip_vs_lblcr_getinfo(char *buffer, char **start, off_t offset, int length)
560{
561 off_t pos=0, begin;
562 int len=0, size;
563 struct ip_vs_lblcr_table *tbl;
564 unsigned long now = jiffies;
565 int i;
566 struct ip_vs_lblcr_entry *en;
567
568 tbl = lblcr_table_list;
569
570 size = sprintf(buffer, "LastTime Dest IP address Server set\n");
571 pos += size;
572 len += size;
573
574 for (i=0; i<IP_VS_LBLCR_TAB_SIZE; i++) {
575 read_lock_bh(&tbl->lock);
576 list_for_each_entry(en, &tbl->bucket[i], list) {
577 char tbuf[16];
578 struct ip_vs_dest_list *d;
579
580 sprintf(tbuf, "%u.%u.%u.%u", NIPQUAD(en->addr));
581 size = sprintf(buffer+len, "%8lu %-16s ",
582 now-en->lastuse, tbuf);
583
584 read_lock(&en->set.lock);
585 for (d=en->set.list; d!=NULL; d=d->next) {
586 size += sprintf(buffer+len+size,
587 "%u.%u.%u.%u ",
588 NIPQUAD(d->dest->addr));
589 }
590 read_unlock(&en->set.lock);
591 size += sprintf(buffer+len+size, "\n");
592 len += size;
593 pos += size;
594 if (pos <= offset)
595 len=0;
596 if (pos >= offset+length) {
597 read_unlock_bh(&tbl->lock);
598 goto done;
599 }
600 }
601 read_unlock_bh(&tbl->lock);
602 }
603
604 done:
605 begin = len - (pos - offset);
606 *start = buffer + begin;
607 len -= begin;
608 if(len>length)
609 len = length;
610 return len;
611}
612#endif
613
614
615static int ip_vs_lblcr_init_svc(struct ip_vs_service *svc) 548static int ip_vs_lblcr_init_svc(struct ip_vs_service *svc)
616{ 549{
617 int i; 550 int i;
@@ -650,9 +583,6 @@ static int ip_vs_lblcr_init_svc(struct ip_vs_service *svc)
650 tbl->periodic_timer.expires = jiffies+CHECK_EXPIRE_INTERVAL; 583 tbl->periodic_timer.expires = jiffies+CHECK_EXPIRE_INTERVAL;
651 add_timer(&tbl->periodic_timer); 584 add_timer(&tbl->periodic_timer);
652 585
653#ifdef CONFIG_IP_VS_LBLCR_DEBUG
654 lblcr_table_list = tbl;
655#endif
656 return 0; 586 return 0;
657} 587}
658 588
@@ -843,18 +773,12 @@ static int __init ip_vs_lblcr_init(void)
843{ 773{
844 INIT_LIST_HEAD(&ip_vs_lblcr_scheduler.n_list); 774 INIT_LIST_HEAD(&ip_vs_lblcr_scheduler.n_list);
845 sysctl_header = register_sysctl_table(lblcr_root_table); 775 sysctl_header = register_sysctl_table(lblcr_root_table);
846#ifdef CONFIG_IP_VS_LBLCR_DEBUG
847 proc_net_create(&init_net, "ip_vs_lblcr", 0, ip_vs_lblcr_getinfo);
848#endif
849 return register_ip_vs_scheduler(&ip_vs_lblcr_scheduler); 776 return register_ip_vs_scheduler(&ip_vs_lblcr_scheduler);
850} 777}
851 778
852 779
853static void __exit ip_vs_lblcr_cleanup(void) 780static void __exit ip_vs_lblcr_cleanup(void)
854{ 781{
855#ifdef CONFIG_IP_VS_LBLCR_DEBUG
856 proc_net_remove(&init_net, "ip_vs_lblcr");
857#endif
858 unregister_sysctl_table(sysctl_header); 782 unregister_sysctl_table(sysctl_header);
859 unregister_ip_vs_scheduler(&ip_vs_lblcr_scheduler); 783 unregister_ip_vs_scheduler(&ip_vs_lblcr_scheduler);
860} 784}