~ubuntu-branches/ubuntu/precise/linux-ti-omap4/precise-security

« back to all changes in this revision

Viewing changes to net/netfilter/ipvs/ip_vs_sync.c

  • Committer: Package Import Robot
  • Author(s): Paolo Pisati, Paolo Pisati
  • Date: 2011-12-06 15:56:07 UTC
  • Revision ID: package-import@ubuntu.com-20111206155607-pcf44kv5fmhk564f
Tags: 3.2.0-1401.1
[ Paolo Pisati ]

* Rebased on top of Ubuntu-3.2.0-3.8
* Tilt-tracking @ ef2487af4bb15bdd0689631774b5a5e3a59f74e2
* Delete debian.ti-omap4/control, it shoudln't be tracked
* Fix architecture spelling (s/armel/armhf/)
* [Config] Update configs following 3.2 import
* [Config] Fix compilation: disable CODA and ARCH_OMAP3
* [Config] Fix compilation: disable Ethernet Faraday
* Update series to precise

Show diffs side-by-side

added added

removed removed

Lines of Context:
61
61
 
62
62
#define SYNC_PROTO_VER  1               /* Protocol version in header */
63
63
 
 
64
static struct lock_class_key __ipvs_sync_key;
64
65
/*
65
66
 *      IPVS sync connection entry
66
67
 *      Version 0, i.e. original version.
1545
1546
        IP_VS_DBG(7, "Each ip_vs_sync_conn entry needs %Zd bytes\n",
1546
1547
                  sizeof(struct ip_vs_sync_conn_v0));
1547
1548
 
 
1549
 
1548
1550
        if (state == IP_VS_STATE_MASTER) {
1549
1551
                if (ipvs->master_thread)
1550
1552
                        return -EEXIST;
1663
1665
/*
1664
1666
 * Initialize data struct for each netns
1665
1667
 */
1666
 
int __net_init __ip_vs_sync_init(struct net *net)
 
1668
int __net_init ip_vs_sync_net_init(struct net *net)
1667
1669
{
1668
1670
        struct netns_ipvs *ipvs = net_ipvs(net);
1669
1671
 
 
1672
        __mutex_init(&ipvs->sync_mutex, "ipvs->sync_mutex", &__ipvs_sync_key);
1670
1673
        INIT_LIST_HEAD(&ipvs->sync_queue);
1671
1674
        spin_lock_init(&ipvs->sync_lock);
1672
1675
        spin_lock_init(&ipvs->sync_buff_lock);
1677
1680
        return 0;
1678
1681
}
1679
1682
 
1680
 
void __ip_vs_sync_cleanup(struct net *net)
 
1683
void ip_vs_sync_net_cleanup(struct net *net)
1681
1684
{
1682
1685
        int retc;
 
1686
        struct netns_ipvs *ipvs = net_ipvs(net);
1683
1687
 
 
1688
        mutex_lock(&ipvs->sync_mutex);
1684
1689
        retc = stop_sync_thread(net, IP_VS_STATE_MASTER);
1685
1690
        if (retc && retc != -ESRCH)
1686
1691
                pr_err("Failed to stop Master Daemon\n");
1688
1693
        retc = stop_sync_thread(net, IP_VS_STATE_BACKUP);
1689
1694
        if (retc && retc != -ESRCH)
1690
1695
                pr_err("Failed to stop Backup Daemon\n");
1691
 
}
1692
 
 
1693
 
int __init ip_vs_sync_init(void)
1694
 
{
1695
 
        return 0;
1696
 
}
1697
 
 
1698
 
void ip_vs_sync_cleanup(void)
1699
 
{
 
1696
        mutex_unlock(&ipvs->sync_mutex);
1700
1697
}