From patchwork Mon Mar 27 07:06:30 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhu Yanjun X-Patchwork-Id: 9645397 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id D9C7E602BF for ; Mon, 27 Mar 2017 07:07:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CC94E2832D for ; Mon, 27 Mar 2017 07:07:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C16AC28356; Mon, 27 Mar 2017 07:07:24 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6288C2832D for ; Mon, 27 Mar 2017 07:07:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752047AbdC0HHT (ORCPT ); Mon, 27 Mar 2017 03:07:19 -0400 Received: from userp1040.oracle.com ([156.151.31.81]:45359 "EHLO userp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752033AbdC0HHT (ORCPT ); Mon, 27 Mar 2017 03:07:19 -0400 Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id v2R76rIa001995 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 27 Mar 2017 07:06:53 GMT Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by userv0021.oracle.com (8.14.4/8.14.4) with ESMTP id v2R76q1r020706 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Mon, 27 Mar 2017 07:06:53 GMT Received: from abhmp0018.oracle.com (abhmp0018.oracle.com [141.146.116.24]) by aserv0121.oracle.com (8.13.8/8.13.8) with ESMTP id v2R76oAU020417; Mon, 27 Mar 2017 07:06:51 GMT Received: from redman.cn.oracle.com (/10.113.194.127) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 27 Mar 2017 00:06:50 -0700 From: Zhu Yanjun To: yanjun.zhu@oracle.com, santosh.shilimkar@oracle.com, netdev@vger.kernel.org, linux-rdma@vger.kernel.org, rds-devel@oss.oracle.com, junxiao.bi@oracle.com, joe.jin@oracle.com Subject: [PATCH 5/5] rds: ib: add the static type to the functions Date: Mon, 27 Mar 2017 03:06:30 -0400 Message-Id: <1490598390-13812-6-git-send-email-yanjun.zhu@oracle.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1490598390-13812-1-git-send-email-yanjun.zhu@oracle.com> References: <1490598390-13812-1-git-send-email-yanjun.zhu@oracle.com> X-Source-IP: userv0021.oracle.com [156.151.31.71] Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The functions rds_ib_flush_mr_pool and rds_ib_reuse_mr are called in the local file. As such, the static type is added to limit them in the local file. And the function rds_ib_flush_mr_pool always returns zero. As such, change the return type to void. Signed-off-by: Zhu Yanjun --- net/rds/ib_mr.h | 2 -- net/rds/ib_rdma.c | 12 +++++------- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/net/rds/ib_mr.h b/net/rds/ib_mr.h index 0ea4ab0..a3a9676 100644 --- a/net/rds/ib_mr.h +++ b/net/rds/ib_mr.h @@ -125,8 +125,6 @@ void rds_ib_mr_exit(void); void __rds_ib_teardown_mr(struct rds_ib_mr *); void rds_ib_teardown_mr(struct rds_ib_mr *); struct rds_ib_mr *rds_ib_alloc_fmr(struct rds_ib_device *, int); -struct rds_ib_mr *rds_ib_reuse_mr(struct rds_ib_mr_pool *); -int rds_ib_flush_mr_pool(struct rds_ib_mr_pool *, int, struct rds_ib_mr **); struct rds_ib_mr *rds_ib_reg_fmr(struct rds_ib_device *, struct scatterlist *, unsigned long, u32 *); struct rds_ib_mr *rds_ib_try_reuse_ibmr(struct rds_ib_mr_pool *); diff --git a/net/rds/ib_rdma.c b/net/rds/ib_rdma.c index 977f698..1bd3aba 100644 --- a/net/rds/ib_rdma.c +++ b/net/rds/ib_rdma.c @@ -179,7 +179,7 @@ void rds_ib_get_mr_info(struct rds_ib_device *rds_ibdev, struct rds_info_rdma_co iinfo->rdma_mr_size = pool_1m->fmr_attr.max_pages; } -struct rds_ib_mr *rds_ib_reuse_mr(struct rds_ib_mr_pool *pool) +static struct rds_ib_mr *rds_ib_reuse_mr(struct rds_ib_mr_pool *pool) { struct rds_ib_mr *ibmr = NULL; struct llist_node *ret; @@ -336,8 +336,8 @@ static void list_to_llist_nodes(struct rds_ib_mr_pool *pool, * If the number of MRs allocated exceeds the limit, we also try * to free as many MRs as needed to get back to this limit. */ -int rds_ib_flush_mr_pool(struct rds_ib_mr_pool *pool, - int free_all, struct rds_ib_mr **ibmr_ret) +static void rds_ib_flush_mr_pool(struct rds_ib_mr_pool *pool, + int free_all, struct rds_ib_mr **ibmr_ret) { struct rds_ib_mr *ibmr; struct llist_node *clean_nodes; @@ -358,7 +358,7 @@ int rds_ib_flush_mr_pool(struct rds_ib_mr_pool *pool, if (ibmr) { *ibmr_ret = ibmr; finish_wait(&pool->flush_wait, &wait); - goto out_nolock; + return; } prepare_to_wait(&pool->flush_wait, &wait, @@ -370,7 +370,7 @@ int rds_ib_flush_mr_pool(struct rds_ib_mr_pool *pool, if (ibmr) { *ibmr_ret = ibmr; finish_wait(&pool->flush_wait, &wait); - goto out_nolock; + return; } } finish_wait(&pool->flush_wait, &wait); @@ -433,8 +433,6 @@ int rds_ib_flush_mr_pool(struct rds_ib_mr_pool *pool, mutex_unlock(&pool->flush_lock); if (waitqueue_active(&pool->flush_wait)) wake_up(&pool->flush_wait); -out_nolock: - return 0; } struct rds_ib_mr *rds_ib_try_reuse_ibmr(struct rds_ib_mr_pool *pool)