Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753358AbdHBUOW (ORCPT ); Wed, 2 Aug 2017 16:14:22 -0400 Received: from a2nlsmtp01-04.prod.iad2.secureserver.net ([198.71.225.38]:36738 "EHLO a2nlsmtp01-04.prod.iad2.secureserver.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753050AbdHBUM1 (ORCPT ); Wed, 2 Aug 2017 16:12:27 -0400 x-originating-ip: 107.180.71.197 From: Long Li To: Steve French , linux-cifs@vger.kernel.org, samba-technical@lists.samba.org, linux-kernel@vger.kernel.org Cc: Long Li Subject: [[PATCH v1] 36/37] [CIFS] Read from SMBD transport when it's used Date: Wed, 2 Aug 2017 13:10:47 -0700 Message-Id: <1501704648-20159-37-git-send-email-longli@exchange.microsoft.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1501704648-20159-1-git-send-email-longli@exchange.microsoft.com> References: <1501704648-20159-1-git-send-email-longli@exchange.microsoft.com> X-CMAE-Envelope: MS4wfF/hggb3KEnTtqzrFYu9HNg7B14VX7iTRjvqrNTjh6nM8kgP6S6qjfCHZDWMT8uL0WhLvA0wC5cZkWLtM/ea3PTvDR39ChUGNf7i6nFG5gd9IoYmYrAA X8NJW+GMkYrNYpSmigw8lMYyf2k3KGqU95RsdniLq5Ps/ekU9uF7W5VcRPe/HDOjx9w2evWMjP5SXpOG3kR53Ym886kE/WqyTc0Fw/mOrN4yZxMktJm8B2bF J91S4fN6lYLHmhoZtac39iNjCzGDQWKCX9tzeMy0YEqS9rM+hyfWhKirgS+94ZjGe7E+skuJIhuHiGFkghl+SwUI/U8giSEV0DOJ0FNaUn4= Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1226 Lines: 37 From: Long Li When receiving data, upper layer looks at which transport is being used. If SMBD is used, read from SMBD. Signed-off-by: Long Li --- fs/cifs/connect.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c index cc58cd8..5ac8af0 100644 --- a/fs/cifs/connect.c +++ b/fs/cifs/connect.c @@ -584,6 +584,10 @@ cifs_read_from_socket(struct TCP_Server_Info *server, char *buf, { struct msghdr smb_msg; struct kvec iov = {.iov_base = buf, .iov_len = to_read}; + + if (server->rdma_ses) + return cifs_rdma_read(server->rdma_ses, buf, to_read); + iov_iter_kvec(&smb_msg.msg_iter, READ | ITER_KVEC, &iov, 1, to_read); return cifs_readv_from_socket(server, &smb_msg); @@ -595,6 +599,10 @@ cifs_read_page_from_socket(struct TCP_Server_Info *server, struct page *page, { struct msghdr smb_msg; struct bio_vec bv = {.bv_page = page, .bv_len = to_read}; + + if (server->rdma_ses) + return cifs_rdma_read_page(server->rdma_ses, page, to_read); + iov_iter_bvec(&smb_msg.msg_iter, READ | ITER_BVEC, &bv, 1, to_read); return cifs_readv_from_socket(server, &smb_msg); } -- 2.7.4