From patchwork Sun Jan 6 22:14:27 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Simmons X-Patchwork-Id: 10749739 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E8B3491E for ; Sun, 6 Jan 2019 22:15:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DBE2328957 for ; Sun, 6 Jan 2019 22:15:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D04F028968; Sun, 6 Jan 2019 22:15:58 +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=-2.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from pdx1-mailman02.dreamhost.com (pdx1-mailman02.dreamhost.com [64.90.62.194]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 714BE28957 for ; Sun, 6 Jan 2019 22:15:58 +0000 (UTC) Received: from pdx1-mailman02.dreamhost.com (localhost [IPv6:::1]) by pdx1-mailman02.dreamhost.com (Postfix) with ESMTP id 1F0FF6823B6; Sun, 6 Jan 2019 14:15:14 -0800 (PST) X-Original-To: lustre-devel@lists.lustre.org Delivered-To: lustre-devel-lustre.org@pdx1-mailman02.dreamhost.com Received: from smtp4.ccs.ornl.gov (smtp4.ccs.ornl.gov [160.91.203.40]) by pdx1-mailman02.dreamhost.com (Postfix) with ESMTP id D9ACF21FFC6 for ; Sun, 6 Jan 2019 14:14:42 -0800 (PST) Received: from star.ccs.ornl.gov (star.ccs.ornl.gov [160.91.202.134]) by smtp4.ccs.ornl.gov (Postfix) with ESMTP id E67F11005186; Sun, 6 Jan 2019 17:14:30 -0500 (EST) Received: by star.ccs.ornl.gov (Postfix, from userid 2004) id E4E9FBE; Sun, 6 Jan 2019 17:14:30 -0500 (EST) From: James Simmons To: Andreas Dilger , Oleg Drokin , NeilBrown Date: Sun, 6 Jan 2019 17:14:27 -0500 Message-Id: <1546812868-11794-33-git-send-email-jsimmons@infradead.org> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1546812868-11794-1-git-send-email-jsimmons@infradead.org> References: <1546812868-11794-1-git-send-email-jsimmons@infradead.org> Subject: [lustre-devel] [PATCH v2 32/33] lustre: lov: use stripe_count instead of stripe_nr X-BeenThere: lustre-devel@lists.lustre.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "For discussing Lustre software development." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Lustre Development List MIME-Version: 1.0 Errors-To: lustre-devel-bounces@lists.lustre.org Sender: "lustre-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Andreas Dilger Replace the use of stripecnt in the code with stripe_count to be consistent the rest of the code. Signed-off-by: Andreas Dilger WC-bug-id: https://jira.whamcloud.com/browse/LU-8653 Reviewed-on: https://review.whamcloud.com/26681 Reviewed-by: Lai Siyao Reviewed-by: Steve Guminski Reviewed-by: Oleg Drokin Signed-off-by: James Simmons --- drivers/staging/lustre/lustre/lov/lov_internal.h | 2 +- drivers/staging/lustre/lustre/lov/lov_pack.c | 12 ++++++------ drivers/staging/lustre/lustre/lov/lov_request.c | 4 ++-- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/staging/lustre/lustre/lov/lov_internal.h b/drivers/staging/lustre/lustre/lov/lov_internal.h index 3878cad..2b31c99 100644 --- a/drivers/staging/lustre/lustre/lov/lov_internal.h +++ b/drivers/staging/lustre/lustre/lov/lov_internal.h @@ -271,7 +271,7 @@ int lov_prep_statfs_set(struct obd_device *obd, struct obd_info *oinfo, void lov_fix_desc_stripe_count(__u32 *val); void lov_fix_desc_pattern(__u32 *val); void lov_fix_desc_qos_maxage(__u32 *val); -__u16 lov_get_stripecnt(struct lov_obd *lov, __u32 magic, __u16 stripe_count); +u16 lov_get_stripe_count(struct lov_obd *lov, u32 magic, u16 stripe_count); int lov_connect_obd(struct obd_device *obd, __u32 index, int activate, struct obd_connect_data *data); int lov_setup(struct obd_device *obd, struct lustre_cfg *lcfg); diff --git a/drivers/staging/lustre/lustre/lov/lov_pack.c b/drivers/staging/lustre/lustre/lov/lov_pack.c index 089e556..0a6bb1e 100644 --- a/drivers/staging/lustre/lustre/lov/lov_pack.c +++ b/drivers/staging/lustre/lustre/lov/lov_pack.c @@ -192,7 +192,7 @@ ssize_t lov_lsm_pack(const struct lov_stripe_md *lsm, void *buf, for (entry = 0; entry < lsm->lsm_entry_count; entry++) { struct lov_stripe_md_entry *lsme; struct lov_mds_md *lmm; - u16 stripecnt; + u16 stripe_count; lsme = lsm->lsm_entries[entry]; lcme = &lcmv1->lcm_entries[entry]; @@ -227,11 +227,11 @@ ssize_t lov_lsm_pack(const struct lov_stripe_md *lsm, void *buf, if (lsme_inited(lsme) && !(lsme->lsme_pattern & LOV_PATTERN_F_RELEASED)) - stripecnt = lsme->lsme_stripe_count; + stripe_count = lsme->lsme_stripe_count; else - stripecnt = 0; + stripe_count = 0; - for (i = 0; i < stripecnt; i++) { + for (i = 0; i < stripe_count; i++) { struct lov_oinfo *loi = lsme->lsme_oinfo[i]; ostid_cpu_to_le(&loi->loi_oi, &lmm_objects[i].l_ost_oi); @@ -241,7 +241,7 @@ ssize_t lov_lsm_pack(const struct lov_stripe_md *lsm, void *buf, cpu_to_le32(loi->loi_ost_idx); } - size = lov_mds_md_size(stripecnt, lsme->lsme_magic); + size = lov_mds_md_size(stripe_count, lsme->lsme_magic); lcme->lcme_size = cpu_to_le32(size); offset += size; } /* for each layout component */ @@ -250,7 +250,7 @@ ssize_t lov_lsm_pack(const struct lov_stripe_md *lsm, void *buf, } /* Find the max stripecount we should use */ -__u16 lov_get_stripecnt(struct lov_obd *lov, __u32 magic, __u16 stripe_count) +u16 lov_get_stripe_count(struct lov_obd *lov, u32 magic, u16 stripe_count) { __u32 max_stripes = LOV_MAX_STRIPE_COUNT_OLD; diff --git a/drivers/staging/lustre/lustre/lov/lov_request.c b/drivers/staging/lustre/lustre/lov/lov_request.c index 8ca13ed..d13e8d1 100644 --- a/drivers/staging/lustre/lustre/lov/lov_request.c +++ b/drivers/staging/lustre/lustre/lov/lov_request.c @@ -149,8 +149,8 @@ static int lov_fini_statfs(struct obd_device *obd, struct obd_statfs *osfs, int success) { if (success) { - __u32 expected_stripes = lov_get_stripecnt(&obd->u.lov, - LOV_MAGIC, 0); + u32 expected_stripes = lov_get_stripe_count(&obd->u.lov, + LOV_MAGIC, 0); if (osfs->os_files != LOV_U64_MAX) lov_do_div64(osfs->os_files, expected_stripes); if (osfs->os_ffree != LOV_U64_MAX)