Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp3305051ybn; Fri, 27 Sep 2019 04:28:12 -0700 (PDT) X-Google-Smtp-Source: APXvYqz4AGzVvCiz3XPh6TiEIuhUBmejNSRsyvAgyfrV3zSGPXEbsJ8s6WRfN4MfdRnOQWkPomc/ X-Received: by 2002:a17:906:4990:: with SMTP id p16mr7462364eju.9.1569583692173; Fri, 27 Sep 2019 04:28:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569583692; cv=none; d=google.com; s=arc-20160816; b=YyjzdrnxfyQpb/1lW7n1d92I1mBKgViB+eZLLunk6zLzFudgwgtDF0eDiBLRphP6Hz eRuDs9VcTr+a28coGPqN+Tq7rqCy2/YZLFcf33kBAhK8EPEeUjsGfRwwzgvmEZgaKVMk YypCJYIGAoklfGeV9aw2ssjWox4hIRaAmeVrJb+Z13T63GLILw7ZeAK++nxdayhaYtNz uR292Y0OoAFyjm5DlCZLnlNRg1SIA5vIzy8CqnIHyl5QwXuyQYG04+EedzrpKPX3T7vi HxPGwiWpuJNAWQYAfKdYkiRrQjTcrj97nW8d19BnqyiO85pBdPGtHbAynvuDIWbfGkA4 Ol3Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=viBnnvhIX61R0qYC0ovsyIcAIHrnbeHc16hFagtQXeQ=; b=YeEh0myofen1BcQq1DNwEZmHuE63L49xbbTzerPYAiqLgEgjoZBPWMrzzN3O4M9PTC zypb7rYVPay5+TBZeeDfLO7pgglBjAFe0uSvbg07LdgksZMZ+i3/j846q1E27uIknicG QMtwhcJmgkKjnRZ6rgQzwN72nFB64CgNfNTHHBDaMyNwisp3eRdhhmBpMLoaCSjunedP DndG5H9dpSQ5eNDbDbTnceOOzHr5P3J+RPW7ewtNc6dLFl7MBjxhu7NUKkydpDtDjR2z wnHSgB/6xZ52gD3CsS8W+i72rTcR+YhDxIcn9ydwP5WLXpwAuDL7fAV5VWgEGTPx/lpL /Iyg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d26si1333076edq.91.2019.09.27.04.27.48; Fri, 27 Sep 2019 04:28:12 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727355AbfI0L1c (ORCPT + 99 others); Fri, 27 Sep 2019 07:27:32 -0400 Received: from mx1.redhat.com ([209.132.183.28]:59750 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725890AbfI0L12 (ORCPT ); Fri, 27 Sep 2019 07:27:28 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id EB10564D87; Fri, 27 Sep 2019 11:27:27 +0000 (UTC) Received: from steredhat.redhat.com (ovpn-117-249.ams2.redhat.com [10.36.117.249]) by smtp.corp.redhat.com (Postfix) with ESMTP id 18D665D9C3; Fri, 27 Sep 2019 11:27:21 +0000 (UTC) From: Stefano Garzarella To: netdev@vger.kernel.org Cc: linux-hyperv@vger.kernel.org, "K. Y. Srinivasan" , Stefan Hajnoczi , Sasha Levin , linux-kernel@vger.kernel.org, kvm@vger.kernel.org, "David S. Miller" , virtualization@lists.linux-foundation.org, Stephen Hemminger , Jason Wang , "Michael S. Tsirkin" , Haiyang Zhang , Dexuan Cui , Jorgen Hansen Subject: [RFC PATCH 02/13] vsock: remove vm_sockets_get_local_cid() Date: Fri, 27 Sep 2019 13:26:52 +0200 Message-Id: <20190927112703.17745-3-sgarzare@redhat.com> In-Reply-To: <20190927112703.17745-1-sgarzare@redhat.com> References: <20190927112703.17745-1-sgarzare@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Fri, 27 Sep 2019 11:27:28 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org vm_sockets_get_local_cid() is only used in virtio_transport_common.c. We can replace it calling the virtio_transport_get_ops() and using the get_local_cid() callback registered by the transport. Signed-off-by: Stefano Garzarella --- include/linux/vm_sockets.h | 2 -- net/vmw_vsock/af_vsock.c | 10 ---------- net/vmw_vsock/virtio_transport_common.c | 2 +- 3 files changed, 1 insertion(+), 13 deletions(-) diff --git a/include/linux/vm_sockets.h b/include/linux/vm_sockets.h index 33f1a2ecd905..7dd899ccb920 100644 --- a/include/linux/vm_sockets.h +++ b/include/linux/vm_sockets.h @@ -10,6 +10,4 @@ #include -int vm_sockets_get_local_cid(void); - #endif /* _VM_SOCKETS_H */ diff --git a/net/vmw_vsock/af_vsock.c b/net/vmw_vsock/af_vsock.c index ab47bf3ab66e..f609434b2794 100644 --- a/net/vmw_vsock/af_vsock.c +++ b/net/vmw_vsock/af_vsock.c @@ -129,16 +129,6 @@ static struct proto vsock_proto = { static const struct vsock_transport *transport; static DEFINE_MUTEX(vsock_register_mutex); -/**** EXPORTS ****/ - -/* Get the ID of the local context. This is transport dependent. */ - -int vm_sockets_get_local_cid(void) -{ - return transport->get_local_cid(); -} -EXPORT_SYMBOL_GPL(vm_sockets_get_local_cid); - /**** UTILS ****/ /* Each bound VSocket is stored in the bind hash table and each connected diff --git a/net/vmw_vsock/virtio_transport_common.c b/net/vmw_vsock/virtio_transport_common.c index 5bb70c692b1e..ed1ad5289164 100644 --- a/net/vmw_vsock/virtio_transport_common.c +++ b/net/vmw_vsock/virtio_transport_common.c @@ -168,7 +168,7 @@ static int virtio_transport_send_pkt_info(struct vsock_sock *vsk, struct virtio_vsock_pkt *pkt; u32 pkt_len = info->pkt_len; - src_cid = vm_sockets_get_local_cid(); + src_cid = virtio_transport_get_ops()->transport.get_local_cid(); src_port = vsk->local_addr.svm_port; if (!info->remote_cid) { dst_cid = vsk->remote_addr.svm_cid; -- 2.21.0