aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block
diff options
context:
space:
mode:
authorPhilipp Reisner <philipp.reisner@linbit.com>2014-11-10 11:21:15 -0500
committerJens Axboe <axboe@fb.com>2014-11-10 11:27:43 -0500
commite805b983d3fc852b80e30327e42c8c5f0c55c62c (patch)
tree05bca011bab8be42770a2e4974f25b757ef9671d /drivers/block
parent9581f97a687724ea41cf2e145dda4751161198c1 (diff)
drbd: Remove an useless copy of kernel_setsockopt()
Old backward-compat cruft Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com> Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com> Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'drivers/block')
-rw-r--r--drivers/block/drbd/drbd_int.h29
1 files changed, 4 insertions, 25 deletions
diff --git a/drivers/block/drbd/drbd_int.h b/drivers/block/drbd/drbd_int.h
index d2a7589c4bca..b905e9888b88 100644
--- a/drivers/block/drbd/drbd_int.h
+++ b/drivers/block/drbd/drbd_int.h
@@ -1557,52 +1557,31 @@ extern void drbd_set_recv_tcq(struct drbd_device *device, int tcq_enabled);
1557extern void _drbd_clear_done_ee(struct drbd_device *device, struct list_head *to_be_freed); 1557extern void _drbd_clear_done_ee(struct drbd_device *device, struct list_head *to_be_freed);
1558extern int drbd_connected(struct drbd_peer_device *); 1558extern int drbd_connected(struct drbd_peer_device *);
1559 1559
1560/* Yes, there is kernel_setsockopt, but only since 2.6.18.
1561 * So we have our own copy of it here. */
1562static inline int drbd_setsockopt(struct socket *sock, int level, int optname,
1563 char *optval, int optlen)
1564{
1565 mm_segment_t oldfs = get_fs();
1566 char __user *uoptval;
1567 int err;
1568
1569 uoptval = (char __user __force *)optval;
1570
1571 set_fs(KERNEL_DS);
1572 if (level == SOL_SOCKET)
1573 err = sock_setsockopt(sock, level, optname, uoptval, optlen);
1574 else
1575 err = sock->ops->setsockopt(sock, level, optname, uoptval,
1576 optlen);
1577 set_fs(oldfs);
1578 return err;
1579}
1580
1581static inline void drbd_tcp_cork(struct socket *sock) 1560static inline void drbd_tcp_cork(struct socket *sock)
1582{ 1561{
1583 int val = 1; 1562 int val = 1;
1584 (void) drbd_setsockopt(sock, SOL_TCP, TCP_CORK, 1563 (void) kernel_setsockopt(sock, SOL_TCP, TCP_CORK,
1585 (char*)&val, sizeof(val)); 1564 (char*)&val, sizeof(val));
1586} 1565}
1587 1566
1588static inline void drbd_tcp_uncork(struct socket *sock) 1567static inline void drbd_tcp_uncork(struct socket *sock)
1589{ 1568{
1590 int val = 0; 1569 int val = 0;
1591 (void) drbd_setsockopt(sock, SOL_TCP, TCP_CORK, 1570 (void) kernel_setsockopt(sock, SOL_TCP, TCP_CORK,
1592 (char*)&val, sizeof(val)); 1571 (char*)&val, sizeof(val));
1593} 1572}
1594 1573
1595static inline void drbd_tcp_nodelay(struct socket *sock) 1574static inline void drbd_tcp_nodelay(struct socket *sock)
1596{ 1575{
1597 int val = 1; 1576 int val = 1;
1598 (void) drbd_setsockopt(sock, SOL_TCP, TCP_NODELAY, 1577 (void) kernel_setsockopt(sock, SOL_TCP, TCP_NODELAY,
1599 (char*)&val, sizeof(val)); 1578 (char*)&val, sizeof(val));
1600} 1579}
1601 1580
1602static inline void drbd_tcp_quickack(struct socket *sock) 1581static inline void drbd_tcp_quickack(struct socket *sock)
1603{ 1582{
1604 int val = 2; 1583 int val = 2;
1605 (void) drbd_setsockopt(sock, SOL_TCP, TCP_QUICKACK, 1584 (void) kernel_setsockopt(sock, SOL_TCP, TCP_QUICKACK,
1606 (char*)&val, sizeof(val)); 1585 (char*)&val, sizeof(val));
1607} 1586}
1608 1587