diff options
author | Christoph Hellwig <hch@lst.de> | 2020-05-28 07:12:11 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2020-05-28 11:11:44 -0700 |
commit | 6e43496745e75ac49d644df984d2f4ee5b5b6b4e (patch) | |
tree | ef3eeb80b015aa53a98072d925fe7900b8634a07 /drivers/nvme/host/tcp.c | |
parent | c433594c07457d2b2e41a87014bfad9bec279abf (diff) | |
download | lwn-6e43496745e75ac49d644df984d2f4ee5b5b6b4e.tar.gz lwn-6e43496745e75ac49d644df984d2f4ee5b5b6b4e.zip |
net: add sock_set_priority
Add a helper to directly set the SO_PRIORITY sockopt from kernel space
without going through a fake uaccess.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Acked-by: Sagi Grimberg <sagi@grimberg.me>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/nvme/host/tcp.c')
-rw-r--r-- | drivers/nvme/host/tcp.c | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/drivers/nvme/host/tcp.c b/drivers/nvme/host/tcp.c index e72d87482eb7..a307972d33a0 100644 --- a/drivers/nvme/host/tcp.c +++ b/drivers/nvme/host/tcp.c @@ -1362,16 +1362,8 @@ static int nvme_tcp_alloc_queue(struct nvme_ctrl *nctrl, */ sock_no_linger(queue->sock->sk); - if (so_priority > 0) { - ret = kernel_setsockopt(queue->sock, SOL_SOCKET, SO_PRIORITY, - (char *)&so_priority, sizeof(so_priority)); - if (ret) { - dev_err(ctrl->ctrl.device, - "failed to set SO_PRIORITY sock opt, ret %d\n", - ret); - goto err_sock; - } - } + if (so_priority > 0) + sock_set_priority(queue->sock->sk, so_priority); /* Set socket type of service */ if (nctrl->opts->tos >= 0) { |