aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorPavel Emelyanov <xemul@parallels.com>2012-04-18 23:39:36 -0400
committerDavid S. Miller <davem@davemloft.net>2012-04-21 15:52:25 -0400
commit4a17fd5229c1b6066aa478f6b690f8293ce811a1 (patch)
treef6acd00935d2d7a990befb4c77f57fdf39f46689 /drivers
parent59c55bdde856c4000bbeb33ba212c3df6f1997a4 (diff)
sock: Introduce named constants for sk_reuse
Name them in a "backward compatible" manner, i.e. reuse or not are still 1 and 0 respectively. The reuse value of 2 means that the socket with it will forcibly reuse everyone else's port. Signed-off-by: Pavel Emelyanov <xemul@openvz.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/block/drbd/drbd_receiver.c6
-rw-r--r--drivers/scsi/iscsi_tcp.c2
-rw-r--r--drivers/staging/ramster/cluster/tcp.c2
3 files changed, 5 insertions, 5 deletions
diff --git a/drivers/block/drbd/drbd_receiver.c b/drivers/block/drbd/drbd_receiver.c
index 43beaca53179..436f519bed1c 100644
--- a/drivers/block/drbd/drbd_receiver.c
+++ b/drivers/block/drbd/drbd_receiver.c
@@ -664,7 +664,7 @@ static struct socket *drbd_wait_for_connect(struct drbd_conf *mdev)
664 timeo = mdev->net_conf->try_connect_int * HZ; 664 timeo = mdev->net_conf->try_connect_int * HZ;
665 timeo += (random32() & 1) ? timeo / 7 : -timeo / 7; /* 28.5% random jitter */ 665 timeo += (random32() & 1) ? timeo / 7 : -timeo / 7; /* 28.5% random jitter */
666 666
667 s_listen->sk->sk_reuse = 1; /* SO_REUSEADDR */ 667 s_listen->sk->sk_reuse = SK_CAN_REUSE; /* SO_REUSEADDR */
668 s_listen->sk->sk_rcvtimeo = timeo; 668 s_listen->sk->sk_rcvtimeo = timeo;
669 s_listen->sk->sk_sndtimeo = timeo; 669 s_listen->sk->sk_sndtimeo = timeo;
670 drbd_setbufsize(s_listen, mdev->net_conf->sndbuf_size, 670 drbd_setbufsize(s_listen, mdev->net_conf->sndbuf_size,
@@ -841,8 +841,8 @@ retry:
841 } 841 }
842 } while (1); 842 } while (1);
843 843
844 msock->sk->sk_reuse = 1; /* SO_REUSEADDR */ 844 msock->sk->sk_reuse = SK_CAN_REUSE; /* SO_REUSEADDR */
845 sock->sk->sk_reuse = 1; /* SO_REUSEADDR */ 845 sock->sk->sk_reuse = SK_CAN_REUSE; /* SO_REUSEADDR */
846 846
847 sock->sk->sk_allocation = GFP_NOIO; 847 sock->sk->sk_allocation = GFP_NOIO;
848 msock->sk->sk_allocation = GFP_NOIO; 848 msock->sk->sk_allocation = GFP_NOIO;
diff --git a/drivers/scsi/iscsi_tcp.c b/drivers/scsi/iscsi_tcp.c
index 453a740fa68e..922086105b4b 100644
--- a/drivers/scsi/iscsi_tcp.c
+++ b/drivers/scsi/iscsi_tcp.c
@@ -662,7 +662,7 @@ iscsi_sw_tcp_conn_bind(struct iscsi_cls_session *cls_session,
662 662
663 /* setup Socket parameters */ 663 /* setup Socket parameters */
664 sk = sock->sk; 664 sk = sock->sk;
665 sk->sk_reuse = 1; 665 sk->sk_reuse = SK_CAN_REUSE;
666 sk->sk_sndtimeo = 15 * HZ; /* FIXME: make it configurable */ 666 sk->sk_sndtimeo = 15 * HZ; /* FIXME: make it configurable */
667 sk->sk_allocation = GFP_ATOMIC; 667 sk->sk_allocation = GFP_ATOMIC;
668 668
diff --git a/drivers/staging/ramster/cluster/tcp.c b/drivers/staging/ramster/cluster/tcp.c
index 3af1b2c51b78..b9721c1055b1 100644
--- a/drivers/staging/ramster/cluster/tcp.c
+++ b/drivers/staging/ramster/cluster/tcp.c
@@ -2106,7 +2106,7 @@ static int r2net_open_listening_sock(__be32 addr, __be16 port)
2106 r2net_listen_sock = sock; 2106 r2net_listen_sock = sock;
2107 INIT_WORK(&r2net_listen_work, r2net_accept_many); 2107 INIT_WORK(&r2net_listen_work, r2net_accept_many);
2108 2108
2109 sock->sk->sk_reuse = 1; 2109 sock->sk->sk_reuse = SK_CAN_REUSE;
2110 ret = sock->ops->bind(sock, (struct sockaddr *)&sin, sizeof(sin)); 2110 ret = sock->ops->bind(sock, (struct sockaddr *)&sin, sizeof(sin));
2111 if (ret < 0) { 2111 if (ret < 0) {
2112 printk(KERN_ERR "ramster: Error %d while binding socket at " 2112 printk(KERN_ERR "ramster: Error %d while binding socket at "