From patchwork Fri Jan 11 00:00:45 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: NeilBrown X-Patchwork-Id: 10757051 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 D53A66C5 for ; Fri, 11 Jan 2019 00:01:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C2E1B29D33 for ; Fri, 11 Jan 2019 00:01:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B6E9629D48; Fri, 11 Jan 2019 00:01:22 +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 227D829D33 for ; Fri, 11 Jan 2019 00:01:22 +0000 (UTC) Received: from pdx1-mailman02.dreamhost.com (localhost [IPv6:::1]) by pdx1-mailman02.dreamhost.com (Postfix) with ESMTP id 4B96221F302; Thu, 10 Jan 2019 16:01:20 -0800 (PST) X-Original-To: lustre-devel@lists.lustre.org Delivered-To: lustre-devel-lustre.org@pdx1-mailman02.dreamhost.com Received: from mx1.suse.de (mx2.suse.de [195.135.220.15]) by pdx1-mailman02.dreamhost.com (Postfix) with ESMTP id D5CE521EF2B for ; Thu, 10 Jan 2019 16:01:17 -0800 (PST) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 112F2B008; Fri, 11 Jan 2019 00:01:17 +0000 (UTC) From: NeilBrown To: Oleg Drokin , James Simmons , Andreas Dilger Date: Fri, 11 Jan 2019 11:00:45 +1100 Message-ID: <154716484583.28978.14863799416083470252.stgit@noble> In-Reply-To: <154716475327.28978.3817067697027604609.stgit@noble> References: <154716475327.28978.3817067697027604609.stgit@noble> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Subject: [lustre-devel] [PATCH 1/4] lustre: osc: change some foo0() to __foo() 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 Errors-To: lustre-devel-bounces@lists.lustre.org Sender: "lustre-devel" X-Virus-Scanned: ClamAV using ClamSMTP It is standard practice in Linux, when naming a helper-function which is not meant to be called directly, to use a name starting __. e.g. foo() and foo_too() might call __foo(), which is otherwise not directly called. Lustre has a similar convention, but instead uses names like foo0(). This patch convert osc_extent_tree_dump0 -> __osc_extent_tree_dump osc_extent_sanity_check0 -> __osc_extent_sanity_check osc_io_unplug0 -> __osc_io_unplug osc_dlm_blocking_ast0 -> __osc_dlm_blocking_ast Suggested-by: Andreas Dilger Signed-off-by: NeilBrown Reviewed-by: Andreas Dilger --- drivers/staging/lustre/lustre/osc/osc_cache.c | 44 +++++++++++++------------ drivers/staging/lustre/lustre/osc/osc_lock.c | 8 ++--- 2 files changed, 26 insertions(+), 26 deletions(-) diff --git a/drivers/staging/lustre/lustre/osc/osc_cache.c b/drivers/staging/lustre/lustre/osc/osc_cache.c index 1ce9f673f1bf..57046d355eda 100644 --- a/drivers/staging/lustre/lustre/osc/osc_cache.c +++ b/drivers/staging/lustre/lustre/osc/osc_cache.c @@ -57,10 +57,10 @@ static int osc_io_unplug_async(const struct lu_env *env, static void osc_free_grant(struct client_obd *cli, unsigned int nr_pages, unsigned int lost_grant, unsigned int dirty_grant); -static void osc_extent_tree_dump0(int level, struct osc_object *obj, - const char *func, int line); +static void __osc_extent_tree_dump(int level, struct osc_object *obj, + const char *func, int line); #define osc_extent_tree_dump(lvl, obj) \ - osc_extent_tree_dump0(lvl, obj, __func__, __LINE__) + __osc_extent_tree_dump(lvl, obj, __func__, __LINE__) static void osc_unreserve_grant(struct client_obd *cli, unsigned int reserved, unsigned int unused); @@ -173,8 +173,8 @@ static inline struct osc_extent *first_extent(struct osc_object *obj) } /* object must be locked by caller. */ -static int osc_extent_sanity_check0(struct osc_extent *ext, - const char *func, const int line) +static int __osc_extent_sanity_check(struct osc_extent *ext, + const char *func, const int line) { struct osc_object *obj = ext->oe_obj; struct osc_async_page *oap; @@ -302,13 +302,13 @@ static int osc_extent_sanity_check0(struct osc_extent *ext, return rc; } -#define sanity_check_nolock(ext) \ - osc_extent_sanity_check0(ext, __func__, __LINE__) +#define osc_extent_sanity_check_nolock(ext) \ + __osc_extent_sanity_check(ext, __func__, __LINE__) -#define sanity_check(ext) ({ \ +#define osc_extent_sanity_check(ext) ({ \ int __res; \ osc_object_lock((ext)->oe_obj); \ - __res = sanity_check_nolock(ext); \ + __res = osc_extent_sanity_check_nolock(ext); \ osc_object_unlock((ext)->oe_obj); \ __res; \ }) @@ -342,7 +342,7 @@ static void osc_extent_state_set(struct osc_extent *ext, int state) LASSERT(state >= OES_INV && state < OES_STATE_MAX); /* Never try to sanity check a state changing extent :-) */ - /* LASSERT(sanity_check_nolock(ext) == 0); */ + /* LASSERT(osc_extent_sanity_check_nolock(ext) == 0); */ /* TODO: validate the state machine */ ext->oe_state = state; @@ -600,7 +600,7 @@ void osc_extent_release(const struct lu_env *env, struct osc_extent *ext) struct client_obd *cli = osc_cli(obj); LASSERT(atomic_read(&ext->oe_users) > 0); - LASSERT(sanity_check(ext) == 0); + LASSERT(osc_extent_sanity_check(ext) == 0); LASSERT(ext->oe_grants > 0); if (atomic_dec_and_lock(&ext->oe_users, &obj->oo_lock)) { @@ -729,7 +729,7 @@ static struct osc_extent *osc_extent_find(const struct lu_env *env, pgoff_t ext_chk_start = ext->oe_start >> ppc_bits; pgoff_t ext_chk_end = ext->oe_end >> ppc_bits; - LASSERT(sanity_check_nolock(ext) == 0); + LASSERT(osc_extent_sanity_check_nolock(ext) == 0); if (chunk > ext_chk_end + 1) break; @@ -969,7 +969,7 @@ static int osc_extent_wait(const struct lu_env *env, struct osc_extent *ext, int rc = 0; osc_object_lock(obj); - LASSERT(sanity_check_nolock(ext) == 0); + LASSERT(osc_extent_sanity_check_nolock(ext) == 0); /* `Kick' this extent only if the caller is waiting for it to be * written out. */ @@ -1025,7 +1025,7 @@ static int osc_extent_truncate(struct osc_extent *ext, pgoff_t trunc_index, int rc = 0; u16 refcheck; - LASSERT(sanity_check(ext) == 0); + LASSERT(osc_extent_sanity_check(ext) == 0); EASSERT(ext->oe_state == OES_TRUNC, ext); EASSERT(!ext->oe_urgent, ext); @@ -1141,7 +1141,7 @@ static int osc_extent_make_ready(const struct lu_env *env, int rc; /* we're going to grab page lock, so object lock must not be taken. */ - LASSERT(sanity_check(ext) == 0); + LASSERT(osc_extent_sanity_check(ext) == 0); /* in locking state, any process should not touch this extent. */ EASSERT(ext->oe_state == OES_LOCKING, ext); EASSERT(ext->oe_owner, ext); @@ -1229,7 +1229,7 @@ static int osc_extent_expand(struct osc_extent *ext, pgoff_t index, LASSERT(ext->oe_max_end >= index && ext->oe_start <= index); osc_object_lock(obj); - LASSERT(sanity_check_nolock(ext) == 0); + LASSERT(osc_extent_sanity_check_nolock(ext) == 0); end_chunk = ext->oe_end >> ppc_bits; if (chunk > end_chunk + 1) { rc = -ERANGE; @@ -1273,8 +1273,8 @@ static int osc_extent_expand(struct osc_extent *ext, pgoff_t index, return rc; } -static void osc_extent_tree_dump0(int level, struct osc_object *obj, - const char *func, int line) +static void __osc_extent_tree_dump(int level, struct osc_object *obj, + const char *func, int line) { struct osc_extent *ext; int cnt; @@ -2355,8 +2355,8 @@ static void osc_check_rpcs(const struct lu_env *env, struct client_obd *cli) } } -static int osc_io_unplug0(const struct lu_env *env, struct client_obd *cli, - struct osc_object *osc, int async) +static int __osc_io_unplug(const struct lu_env *env, struct client_obd *cli, + struct osc_object *osc, int async) { int rc = 0; @@ -2378,13 +2378,13 @@ static int osc_io_unplug0(const struct lu_env *env, struct client_obd *cli, static int osc_io_unplug_async(const struct lu_env *env, struct client_obd *cli, struct osc_object *osc) { - return osc_io_unplug0(env, cli, osc, 1); + return __osc_io_unplug(env, cli, osc, 1); } void osc_io_unplug(const struct lu_env *env, struct client_obd *cli, struct osc_object *osc) { - (void)osc_io_unplug0(env, cli, osc, 0); + (void)__osc_io_unplug(env, cli, osc, 0); } int osc_prep_async_page(struct osc_object *osc, struct osc_page *ops, diff --git a/drivers/staging/lustre/lustre/osc/osc_lock.c b/drivers/staging/lustre/lustre/osc/osc_lock.c index 824c655b4ce0..01b6bf7df3b7 100644 --- a/drivers/staging/lustre/lustre/osc/osc_lock.c +++ b/drivers/staging/lustre/lustre/osc/osc_lock.c @@ -413,9 +413,9 @@ static int osc_lock_flush(struct osc_object *obj, pgoff_t start, pgoff_t end, * Helper for osc_dlm_blocking_ast() handling discrepancies between cl_lock * and ldlm_lock caches. */ -static int osc_dlm_blocking_ast0(const struct lu_env *env, - struct ldlm_lock *dlmlock, - void *data, int flag) +static int __osc_dlm_blocking_ast(const struct lu_env *env, + struct ldlm_lock *dlmlock, + void *data, int flag) { enum cl_lock_mode mode = CLM_READ; struct cl_object *obj = NULL; @@ -556,7 +556,7 @@ static int osc_ldlm_blocking_ast(struct ldlm_lock *dlmlock, break; } - result = osc_dlm_blocking_ast0(env, dlmlock, data, flag); + result = __osc_dlm_blocking_ast(env, dlmlock, data, flag); cl_env_put(env, &refcheck); break; } From patchwork Fri Jan 11 00:00:46 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: NeilBrown X-Patchwork-Id: 10757053 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 54C906C5 for ; Fri, 11 Jan 2019 00:01:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 40C5529D33 for ; Fri, 11 Jan 2019 00:01:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3369229D48; Fri, 11 Jan 2019 00:01:31 +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 C4B8929D33 for ; Fri, 11 Jan 2019 00:01:30 +0000 (UTC) Received: from pdx1-mailman02.dreamhost.com (localhost [IPv6:::1]) by pdx1-mailman02.dreamhost.com (Postfix) with ESMTP id 8B25021F990; Thu, 10 Jan 2019 16:01:26 -0800 (PST) X-Original-To: lustre-devel@lists.lustre.org Delivered-To: lustre-devel-lustre.org@pdx1-mailman02.dreamhost.com Received: from mx1.suse.de (mx2.suse.de [195.135.220.15]) by pdx1-mailman02.dreamhost.com (Postfix) with ESMTP id F106B20576D for ; Thu, 10 Jan 2019 16:01:23 -0800 (PST) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 077BBAD7F; Fri, 11 Jan 2019 00:01:23 +0000 (UTC) From: NeilBrown To: Oleg Drokin , James Simmons , Andreas Dilger Date: Fri, 11 Jan 2019 11:00:46 +1100 Message-ID: <154716484597.28978.7362652816645934722.stgit@noble> In-Reply-To: <154716475327.28978.3817067697027604609.stgit@noble> References: <154716475327.28978.3817067697027604609.stgit@noble> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Subject: [lustre-devel] [PATCH 2/4] lustre: llite: change some foo0() to __foo() 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 Errors-To: lustre-devel-bounces@lists.lustre.org Sender: "lustre-devel" X-Virus-Scanned: ClamAV using ClamSMTP Change: cl_glimpse_size0 -> __cl_glimpse_size ll_page_mkwrite0 -> __ll_page_mkwrite ll_fault0 -> __ll_fault vvp_object_init0 -> __vvp_object_init This is more consistent with Linux naming style. Signed-off-by: NeilBrown Reviewed-by: Andreas Dilger --- drivers/staging/lustre/lustre/llite/glimpse.c | 2 +- .../staging/lustre/lustre/llite/llite_internal.h | 6 +++--- drivers/staging/lustre/lustre/llite/llite_mmap.c | 11 +++++------ drivers/staging/lustre/lustre/llite/vvp_object.c | 8 ++++---- 4 files changed, 13 insertions(+), 14 deletions(-) diff --git a/drivers/staging/lustre/lustre/llite/glimpse.c b/drivers/staging/lustre/lustre/llite/glimpse.c index ce0d51767da3..d8712a392e58 100644 --- a/drivers/staging/lustre/lustre/llite/glimpse.c +++ b/drivers/staging/lustre/lustre/llite/glimpse.c @@ -163,7 +163,7 @@ static int cl_io_get(struct inode *inode, struct lu_env **envout, return result; } -int cl_glimpse_size0(struct inode *inode, int agl) +int __cl_glimpse_size(struct inode *inode, int agl) { /* * We don't need ast_flags argument to cl_glimpse_size(), because diff --git a/drivers/staging/lustre/lustre/llite/llite_internal.h b/drivers/staging/lustre/lustre/llite/llite_internal.h index b2a1f54ab228..c680a49d900c 100644 --- a/drivers/staging/lustre/lustre/llite/llite_internal.h +++ b/drivers/staging/lustre/lustre/llite/llite_internal.h @@ -1161,18 +1161,18 @@ void ll_deauthorize_statahead(struct inode *dir, void *key); blkcnt_t dirty_cnt(struct inode *inode); -int cl_glimpse_size0(struct inode *inode, int agl); +int __cl_glimpse_size(struct inode *inode, int agl); int cl_glimpse_lock(const struct lu_env *env, struct cl_io *io, struct inode *inode, struct cl_object *clob, int agl); static inline int cl_glimpse_size(struct inode *inode) { - return cl_glimpse_size0(inode, 0); + return __cl_glimpse_size(inode, 0); } static inline int cl_agl(struct inode *inode) { - return cl_glimpse_size0(inode, 1); + return __cl_glimpse_size(inode, 1); } static inline int ll_glimpse_size(struct inode *inode) diff --git a/drivers/staging/lustre/lustre/llite/llite_mmap.c b/drivers/staging/lustre/lustre/llite/llite_mmap.c index 023d62e53051..33e23ee4aff4 100644 --- a/drivers/staging/lustre/lustre/llite/llite_mmap.c +++ b/drivers/staging/lustre/lustre/llite/llite_mmap.c @@ -143,9 +143,8 @@ ll_fault_io_init(struct lu_env *env, struct vm_area_struct *vma, return io; } -/* Sharing code of page_mkwrite method for rhel5 and rhel6 */ -static int ll_page_mkwrite0(struct vm_area_struct *vma, struct page *vmpage, - bool *retry) +static int __ll_page_mkwrite(struct vm_area_struct *vma, struct page *vmpage, + bool *retry) { struct lu_env *env; struct cl_io *io; @@ -262,7 +261,7 @@ static inline vm_fault_t to_fault_error(int result) * \retval VM_FAULT_ERROR on general error * \retval NOPAGE_OOM not have memory for allocate new page */ -static vm_fault_t ll_fault0(struct vm_area_struct *vma, struct vm_fault *vmf) +static vm_fault_t __ll_fault(struct vm_area_struct *vma, struct vm_fault *vmf) { struct lu_env *env; struct cl_io *io; @@ -365,7 +364,7 @@ static vm_fault_t ll_fault(struct vm_fault *vmf) LPROC_LL_FAULT, 1); restart: - result = ll_fault0(vmf->vma, vmf); + result = __ll_fault(vmf->vma, vmf); if (!(result & (VM_FAULT_RETRY | VM_FAULT_ERROR | VM_FAULT_LOCKED))) { struct page *vmpage = vmf->page; @@ -406,7 +405,7 @@ static vm_fault_t ll_page_mkwrite(struct vm_fault *vmf) file_update_time(vma->vm_file); do { retry = false; - err = ll_page_mkwrite0(vma, vmf->page, &retry); + err = __ll_page_mkwrite(vma, vmf->page, &retry); if (!printed && ++count > 16) { const struct dentry *de = vma->vm_file->f_path.dentry; diff --git a/drivers/staging/lustre/lustre/llite/vvp_object.c b/drivers/staging/lustre/lustre/llite/vvp_object.c index e1000f6b7f22..86e077bd516b 100644 --- a/drivers/staging/lustre/lustre/llite/vvp_object.c +++ b/drivers/staging/lustre/lustre/llite/vvp_object.c @@ -220,9 +220,9 @@ static const struct cl_object_operations vvp_ops = { .coo_req_attr_set = vvp_req_attr_set }; -static int vvp_object_init0(const struct lu_env *env, - struct vvp_object *vob, - const struct cl_object_conf *conf) +static int __vvp_object_init(const struct lu_env *env, + struct vvp_object *vob, + const struct cl_object_conf *conf) { vob->vob_inode = conf->coc_inode; atomic_set(&vob->vob_transient_pages, 0); @@ -246,7 +246,7 @@ static int vvp_object_init(const struct lu_env *env, struct lu_object *obj, cconf = lu2cl_conf(conf); lu_object_add(obj, below); - result = vvp_object_init0(env, vob, cconf); + result = __vvp_object_init(env, vob, cconf); } else { result = -ENOMEM; } From patchwork Fri Jan 11 00:00:46 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: NeilBrown X-Patchwork-Id: 10757055 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 1C4C0746 for ; Fri, 11 Jan 2019 00:01:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0A06429D33 for ; Fri, 11 Jan 2019 00:01:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F006829D48; Fri, 11 Jan 2019 00:01:37 +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 4886729D33 for ; Fri, 11 Jan 2019 00:01:37 +0000 (UTC) Received: from pdx1-mailman02.dreamhost.com (localhost [IPv6:::1]) by pdx1-mailman02.dreamhost.com (Postfix) with ESMTP id AC7EB21F696; Thu, 10 Jan 2019 16:01:31 -0800 (PST) X-Original-To: lustre-devel@lists.lustre.org Delivered-To: lustre-devel-lustre.org@pdx1-mailman02.dreamhost.com Received: from mx1.suse.de (mx2.suse.de [195.135.220.15]) by pdx1-mailman02.dreamhost.com (Postfix) with ESMTP id EFA8121FEBA for ; Thu, 10 Jan 2019 16:01:29 -0800 (PST) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id F2F64AD7F; Fri, 11 Jan 2019 00:01:28 +0000 (UTC) From: NeilBrown To: Oleg Drokin , James Simmons , Andreas Dilger Date: Fri, 11 Jan 2019 11:00:46 +1100 Message-ID: <154716484605.28978.3593304564414994720.stgit@noble> In-Reply-To: <154716475327.28978.3817067697027604609.stgit@noble> References: <154716475327.28978.3817067697027604609.stgit@noble> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Subject: [lustre-devel] [PATCH 3/4] lustre: obdclass: change some foo0() to __foo() 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 Errors-To: lustre-devel-bounces@lists.lustre.org Sender: "lustre-devel" X-Virus-Scanned: ClamAV using ClamSMTP Change: cl_io_init0 -> __cl_io_init cl_lock_trace0 -> __cl_lock_trace cl_page_delete0 -> __cl_page_delete cl_page_state_set0 -> __cl_page_state_set cl_page_own0 -> __cl_page_own cl_page_disown0 -> __cl_page_disown cl_page_delete0 -> __cl_page_delete cl_echo_enqueue0 -> __cl_echo_enqueue cl_echo_cancel0 -> __cl_echo_cancel This is more consistent with Linux naming style. Signed-off-by: NeilBrown Reviewed-by: Andreas Dilger --- drivers/staging/lustre/lustre/include/cl_object.h | 6 ++- drivers/staging/lustre/lustre/obdclass/cl_io.c | 14 ++++---- drivers/staging/lustre/lustre/obdclass/cl_lock.c | 8 ++-- drivers/staging/lustre/lustre/obdclass/cl_page.c | 36 ++++++++++---------- .../staging/lustre/lustre/obdecho/echo_client.c | 20 ++++++----- 5 files changed, 42 insertions(+), 42 deletions(-) diff --git a/drivers/staging/lustre/lustre/include/cl_object.h b/drivers/staging/lustre/lustre/include/cl_object.h index 4f0e8e271452..d0e61e503f9d 100644 --- a/drivers/staging/lustre/lustre/include/cl_object.h +++ b/drivers/staging/lustre/lustre/include/cl_object.h @@ -803,7 +803,7 @@ struct cl_page_operations { /** * cl_page<->struct page methods. Only one layer in the stack has to * implement these. Current code assumes that this functionality is - * provided by the topmost layer, see cl_page_disown0() as an example. + * provided by the topmost layer, see __cl_page_disown() as an example. */ /** @@ -2144,8 +2144,8 @@ void cl_page_unassume(const struct lu_env *env, struct cl_io *io, struct cl_page *pg); void cl_page_disown(const struct lu_env *env, struct cl_io *io, struct cl_page *page); -void cl_page_disown0(const struct lu_env *env, - struct cl_io *io, struct cl_page *pg); +void __cl_page_disown(const struct lu_env *env, + struct cl_io *io, struct cl_page *pg); int cl_page_is_owned(const struct cl_page *pg, const struct cl_io *io); /** @} ownership */ diff --git a/drivers/staging/lustre/lustre/obdclass/cl_io.c b/drivers/staging/lustre/lustre/obdclass/cl_io.c index 0da731cfeb30..84c7710f80d7 100644 --- a/drivers/staging/lustre/lustre/obdclass/cl_io.c +++ b/drivers/staging/lustre/lustre/obdclass/cl_io.c @@ -131,8 +131,8 @@ void cl_io_fini(const struct lu_env *env, struct cl_io *io) } EXPORT_SYMBOL(cl_io_fini); -static int cl_io_init0(const struct lu_env *env, struct cl_io *io, - enum cl_io_type iot, struct cl_object *obj) +static int __cl_io_init(const struct lu_env *env, struct cl_io *io, + enum cl_io_type iot, struct cl_object *obj) { struct cl_object *scan; int result; @@ -169,7 +169,7 @@ int cl_io_sub_init(const struct lu_env *env, struct cl_io *io, { LASSERT(obj != cl_object_top(obj)); - return cl_io_init0(env, io, iot, obj); + return __cl_io_init(env, io, iot, obj); } EXPORT_SYMBOL(cl_io_sub_init); @@ -188,7 +188,7 @@ int cl_io_init(const struct lu_env *env, struct cl_io *io, { LASSERT(obj == cl_object_top(obj)); - return cl_io_init0(env, io, iot, obj); + return __cl_io_init(env, io, iot, obj); } EXPORT_SYMBOL(cl_io_init); @@ -897,14 +897,14 @@ void cl_page_list_disown(const struct lu_env *env, list_del_init(&page->cp_batch); --plist->pl_nr; /* - * cl_page_disown0 rather than usual cl_page_disown() is used, + * __cl_page_disown rather than usual cl_page_disown() is used, * because pages are possibly in CPS_FREEING state already due * to the call to cl_page_list_discard(). */ /* - * XXX cl_page_disown0() will fail if page is not locked. + * XXX __cl_page_disown() will fail if page is not locked. */ - cl_page_disown0(env, io, page); + __cl_page_disown(env, io, page); lu_ref_del_at(&page->cp_reference, &page->cp_queue_ref, "queue", plist); cl_page_put(env, page); diff --git a/drivers/staging/lustre/lustre/obdclass/cl_lock.c b/drivers/staging/lustre/lustre/obdclass/cl_lock.c index 9ca29a26a38b..23c1609415a3 100644 --- a/drivers/staging/lustre/lustre/obdclass/cl_lock.c +++ b/drivers/staging/lustre/lustre/obdclass/cl_lock.c @@ -45,9 +45,9 @@ #include #include "cl_internal.h" -static void cl_lock_trace0(int level, const struct lu_env *env, - const char *prefix, const struct cl_lock *lock, - const char *func, const int line) +static void __cl_lock_trace(int level, const struct lu_env *env, + const char *prefix, const struct cl_lock *lock, + const char *func, const int line) { struct cl_object_header *h = cl_object_header(lock->cll_descr.cld_obj); @@ -55,7 +55,7 @@ static void cl_lock_trace0(int level, const struct lu_env *env, prefix, lock, env, h->coh_nesting, func, line); } #define cl_lock_trace(level, env, prefix, lock) \ - cl_lock_trace0(level, env, prefix, lock, __func__, __LINE__) + __cl_lock_trace(level, env, prefix, lock, __func__, __LINE__) /** * Adds lock slice to the compound lock. diff --git a/drivers/staging/lustre/lustre/obdclass/cl_page.c b/drivers/staging/lustre/lustre/obdclass/cl_page.c index 00df94b87606..5794b1cbfb54 100644 --- a/drivers/staging/lustre/lustre/obdclass/cl_page.c +++ b/drivers/staging/lustre/lustre/obdclass/cl_page.c @@ -45,7 +45,7 @@ #include #include "cl_internal.h" -static void cl_page_delete0(const struct lu_env *env, struct cl_page *pg); +static void __cl_page_delete(const struct lu_env *env, struct cl_page *pg); # define PASSERT(env, page, expr) \ do { \ @@ -156,7 +156,7 @@ struct cl_page *cl_page_alloc(const struct lu_env *env, result = o->co_ops->coo_page_init(env, o, page, ind); if (result != 0) { - cl_page_delete0(env, page); + __cl_page_delete(env, page); cl_page_free(env, page); page = ERR_PTR(result); break; @@ -228,8 +228,8 @@ static inline int cl_page_invariant(const struct cl_page *pg) return cl_page_in_use_noref(pg); } -static void cl_page_state_set0(const struct lu_env *env, - struct cl_page *page, enum cl_page_state state) +static void __cl_page_state_set(const struct lu_env *env, + struct cl_page *page, enum cl_page_state state) { enum cl_page_state old; @@ -286,7 +286,7 @@ static void cl_page_state_set0(const struct lu_env *env, static void cl_page_state_set(const struct lu_env *env, struct cl_page *page, enum cl_page_state state) { - cl_page_state_set0(env, page, state); + __cl_page_state_set(env, page, state); } /** @@ -377,7 +377,7 @@ static void cl_page_owner_set(struct cl_page *page) page->cp_owner->ci_owned_nr++; } -void cl_page_disown0(const struct lu_env *env, +void __cl_page_disown(const struct lu_env *env, struct cl_io *io, struct cl_page *pg) { const struct cl_page_slice *slice; @@ -433,8 +433,8 @@ EXPORT_SYMBOL(cl_page_is_owned); * \see cl_page_own_try() * \see cl_page_own */ -static int cl_page_own0(const struct lu_env *env, struct cl_io *io, - struct cl_page *pg, int nonblock) +static int __cl_page_own(const struct lu_env *env, struct cl_io *io, + struct cl_page *pg, int nonblock) { const struct cl_page_slice *slice; int result = 0; @@ -465,7 +465,7 @@ static int cl_page_own0(const struct lu_env *env, struct cl_io *io, if (pg->cp_state != CPS_FREEING) { cl_page_state_set(env, pg, CPS_OWNED); } else { - cl_page_disown0(env, io, pg); + __cl_page_disown(env, io, pg); result = -ENOENT; } } @@ -477,23 +477,23 @@ static int cl_page_own0(const struct lu_env *env, struct cl_io *io, /** * Own a page, might be blocked. * - * \see cl_page_own0() + * \see __cl_page_own() */ int cl_page_own(const struct lu_env *env, struct cl_io *io, struct cl_page *pg) { - return cl_page_own0(env, io, pg, 0); + return __cl_page_own(env, io, pg, 0); } EXPORT_SYMBOL(cl_page_own); /** * Nonblock version of cl_page_own(). * - * \see cl_page_own0() + * \see __cl_page_own() */ int cl_page_own_try(const struct lu_env *env, struct cl_io *io, struct cl_page *pg) { - return cl_page_own0(env, io, pg, 1); + return __cl_page_own(env, io, pg, 1); } EXPORT_SYMBOL(cl_page_own_try); @@ -576,7 +576,7 @@ void cl_page_disown(const struct lu_env *env, pg->cp_state == CPS_FREEING); io = cl_io_top(io); - cl_page_disown0(env, io, pg); + __cl_page_disown(env, io, pg); } EXPORT_SYMBOL(cl_page_disown); @@ -607,10 +607,10 @@ EXPORT_SYMBOL(cl_page_discard); /** * Version of cl_page_delete() that can be called for not fully constructed - * pages, e.g,. in a error handling cl_page_find()->cl_page_delete0() + * pages, e.g,. in a error handling cl_page_find()->__cl_page_delete() * path. Doesn't check page invariant. */ -static void cl_page_delete0(const struct lu_env *env, struct cl_page *pg) +static void __cl_page_delete(const struct lu_env *env, struct cl_page *pg) { const struct cl_page_slice *slice; @@ -620,7 +620,7 @@ static void cl_page_delete0(const struct lu_env *env, struct cl_page *pg) * Sever all ways to obtain new pointers to @pg. */ cl_page_owner_clear(pg); - cl_page_state_set0(env, pg, CPS_FREEING); + __cl_page_state_set(env, pg, CPS_FREEING); list_for_each_entry_reverse(slice, &pg->cp_layers, cpl_linkage) { if (slice->cpl_ops->cpo_delete) @@ -655,7 +655,7 @@ static void cl_page_delete0(const struct lu_env *env, struct cl_page *pg) void cl_page_delete(const struct lu_env *env, struct cl_page *pg) { PINVRNT(env, pg, cl_page_invariant(pg)); - cl_page_delete0(env, pg); + __cl_page_delete(env, pg); } EXPORT_SYMBOL(cl_page_delete); diff --git a/drivers/staging/lustre/lustre/obdecho/echo_client.c b/drivers/staging/lustre/lustre/obdecho/echo_client.c index 887df7ce6b5c..39b7ab1447a4 100644 --- a/drivers/staging/lustre/lustre/obdecho/echo_client.c +++ b/drivers/staging/lustre/lustre/obdecho/echo_client.c @@ -910,9 +910,9 @@ static int cl_echo_object_put(struct echo_object *eco) return 0; } -static int cl_echo_enqueue0(struct lu_env *env, struct echo_object *eco, - u64 start, u64 end, int mode, - __u64 *cookie, __u32 enqflags) +static int __cl_echo_enqueue(struct lu_env *env, struct echo_object *eco, + u64 start, u64 end, int mode, + __u64 *cookie, __u32 enqflags) { struct cl_io *io; struct cl_lock *lck; @@ -953,8 +953,8 @@ static int cl_echo_enqueue0(struct lu_env *env, struct echo_object *eco, return rc; } -static int cl_echo_cancel0(struct lu_env *env, struct echo_device *ed, - __u64 cookie) +static int __cl_echo_cancel(struct lu_env *env, struct echo_device *ed, + __u64 cookie) { struct echo_client_obd *ec = ed->ed_ec; struct echo_lock *ecl = NULL; @@ -1028,10 +1028,10 @@ static int cl_echo_object_brw(struct echo_object *eco, int rw, u64 offset, goto out; LASSERT(rc == 0); - rc = cl_echo_enqueue0(env, eco, offset, - offset + npages * PAGE_SIZE - 1, - rw == READ ? LCK_PR : LCK_PW, &lh.cookie, - CEF_NEVER); + rc = __cl_echo_enqueue(env, eco, offset, + offset + npages * PAGE_SIZE - 1, + rw == READ ? LCK_PR : LCK_PW, &lh.cookie, + CEF_NEVER); if (rc < 0) goto error_lock; @@ -1079,7 +1079,7 @@ static int cl_echo_object_brw(struct echo_object *eco, int rw, u64 offset, async ? "async" : "sync", rc); } - cl_echo_cancel0(env, ed, lh.cookie); + __cl_echo_cancel(env, ed, lh.cookie); error_lock: cl_2queue_discard(env, io, queue); cl_2queue_disown(env, io, queue); From patchwork Fri Jan 11 00:00:46 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: NeilBrown X-Patchwork-Id: 10757057 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 E1CC86C5 for ; Fri, 11 Jan 2019 00:01:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CF96629D33 for ; Fri, 11 Jan 2019 00:01:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C2FF529D48; Fri, 11 Jan 2019 00:01:45 +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 62E0129D33 for ; Fri, 11 Jan 2019 00:01:45 +0000 (UTC) Received: from pdx1-mailman02.dreamhost.com (localhost [IPv6:::1]) by pdx1-mailman02.dreamhost.com (Postfix) with ESMTP id 0516D6204E9; Thu, 10 Jan 2019 16:01:38 -0800 (PST) X-Original-To: lustre-devel@lists.lustre.org Delivered-To: lustre-devel-lustre.org@pdx1-mailman02.dreamhost.com Received: from mx1.suse.de (mx2.suse.de [195.135.220.15]) by pdx1-mailman02.dreamhost.com (Postfix) with ESMTP id B9AF721F7B0 for ; Thu, 10 Jan 2019 16:01:35 -0800 (PST) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id E181AAD7F; Fri, 11 Jan 2019 00:01:34 +0000 (UTC) From: NeilBrown To: Oleg Drokin , James Simmons , Andreas Dilger Date: Fri, 11 Jan 2019 11:00:46 +1100 Message-ID: <154716484609.28978.296505839179223953.stgit@noble> In-Reply-To: <154716475327.28978.3817067697027604609.stgit@noble> References: <154716475327.28978.3817067697027604609.stgit@noble> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Subject: [lustre-devel] [PATCH 4/4] lustre: ptlrpc: change some foo0() to __foo() 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 Errors-To: lustre-devel-bounces@lists.lustre.org Sender: "lustre-devel" X-Virus-Scanned: ClamAV using ClamSMTP Change: nrs_policy_stop0 -> __nrs_policy_stop nrs_svcpt_setup_locked0 -> __nrs_svcpt_setup_locked ptlrpc_nrs_req_get_nolock0 -> __ptlrpc_nrs_req_get_nolock This is more consistent with Linux naming style. Signed-off-by: NeilBrown Reviewed-by: Andreas Dilger Reviewed-by: Nikitas Angelinas --- drivers/staging/lustre/lustre/ptlrpc/nrs.c | 20 ++++++++++---------- drivers/staging/lustre/lustre/ptlrpc/nrs_fifo.c | 2 +- .../staging/lustre/lustre/ptlrpc/ptlrpc_internal.h | 6 +++--- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/drivers/staging/lustre/lustre/ptlrpc/nrs.c b/drivers/staging/lustre/lustre/ptlrpc/nrs.c index e09b86529c5d..248ba045fb79 100644 --- a/drivers/staging/lustre/lustre/ptlrpc/nrs.c +++ b/drivers/staging/lustre/lustre/ptlrpc/nrs.c @@ -82,7 +82,7 @@ static int nrs_policy_ctl_locked(struct ptlrpc_nrs_policy *policy, -ENOSYS; } -static void nrs_policy_stop0(struct ptlrpc_nrs_policy *policy) +static void __nrs_policy_stop(struct ptlrpc_nrs_policy *policy) { if (policy->pol_desc->pd_ops->op_policy_stop) policy->pol_desc->pd_ops->op_policy_stop(policy); @@ -126,7 +126,7 @@ static int nrs_policy_stop_locked(struct ptlrpc_nrs_policy *policy) /* I have the only refcount */ if (policy->pol_ref == 1) - nrs_policy_stop0(policy); + __nrs_policy_stop(policy); return 0; } @@ -151,7 +151,7 @@ static void nrs_policy_stop_primary(struct ptlrpc_nrs *nrs) tmp->pol_state = NRS_POL_STATE_STOPPING; if (tmp->pol_ref == 0) - nrs_policy_stop0(tmp); + __nrs_policy_stop(tmp); } /** @@ -300,7 +300,7 @@ static void nrs_policy_put_locked(struct ptlrpc_nrs_policy *policy) policy->pol_ref--; if (unlikely(policy->pol_ref == 0 && policy->pol_state == NRS_POL_STATE_STOPPING)) - nrs_policy_stop0(policy); + __nrs_policy_stop(policy); } static void nrs_policy_put(struct ptlrpc_nrs_policy *policy) @@ -888,8 +888,8 @@ static int nrs_register_policies_locked(struct ptlrpc_nrs *nrs) * * \pre mutex_is_locked(&nrs_core.nrs_mutex) */ -static int nrs_svcpt_setup_locked0(struct ptlrpc_nrs *nrs, - struct ptlrpc_service_part *svcpt) +static int __nrs_svcpt_setup_locked(struct ptlrpc_nrs *nrs, + struct ptlrpc_service_part *svcpt) { enum ptlrpc_nrs_queue_type queue; @@ -931,7 +931,7 @@ static int nrs_svcpt_setup_locked(struct ptlrpc_service_part *svcpt) * Initialize the regular NRS head. */ nrs = nrs_svcpt2nrs(svcpt, false); - rc = nrs_svcpt_setup_locked0(nrs, svcpt); + rc = __nrs_svcpt_setup_locked(nrs, svcpt); if (rc < 0) goto out; @@ -951,7 +951,7 @@ static int nrs_svcpt_setup_locked(struct ptlrpc_service_part *svcpt) } nrs = nrs_svcpt2nrs(svcpt, true); - rc = nrs_svcpt_setup_locked0(nrs, svcpt); + rc = __nrs_svcpt_setup_locked(nrs, svcpt); out: return rc; @@ -1444,8 +1444,8 @@ static void nrs_request_removed(struct ptlrpc_nrs_policy *policy) * \retval NULL the head has no requests to serve */ struct ptlrpc_request * -ptlrpc_nrs_req_get_nolock0(struct ptlrpc_service_part *svcpt, bool hp, - bool peek, bool force) +__ptlrpc_nrs_req_get_nolock(struct ptlrpc_service_part *svcpt, bool hp, + bool peek, bool force) { struct ptlrpc_nrs *nrs = nrs_svcpt2nrs(svcpt, hp); struct ptlrpc_nrs_policy *policy; diff --git a/drivers/staging/lustre/lustre/ptlrpc/nrs_fifo.c b/drivers/staging/lustre/lustre/ptlrpc/nrs_fifo.c index ff630d94dd26..7fe8aeeff428 100644 --- a/drivers/staging/lustre/lustre/ptlrpc/nrs_fifo.c +++ b/drivers/staging/lustre/lustre/ptlrpc/nrs_fifo.c @@ -96,7 +96,7 @@ static int nrs_fifo_start(struct ptlrpc_nrs_policy *policy) * * \param[in] policy The policy to stop * - * \see nrs_policy_stop0() + * \see __nrs_policy_stop() */ static void nrs_fifo_stop(struct ptlrpc_nrs_policy *policy) { diff --git a/drivers/staging/lustre/lustre/ptlrpc/ptlrpc_internal.h b/drivers/staging/lustre/lustre/ptlrpc/ptlrpc_internal.h index 177010cf7148..da42b99fc36f 100644 --- a/drivers/staging/lustre/lustre/ptlrpc/ptlrpc_internal.h +++ b/drivers/staging/lustre/lustre/ptlrpc/ptlrpc_internal.h @@ -133,14 +133,14 @@ void ptlrpc_nrs_req_add(struct ptlrpc_service_part *svcpt, struct ptlrpc_request *req, bool hp); struct ptlrpc_request * -ptlrpc_nrs_req_get_nolock0(struct ptlrpc_service_part *svcpt, bool hp, - bool peek, bool force); +__ptlrpc_nrs_req_get_nolock(struct ptlrpc_service_part *svcpt, bool hp, + bool peek, bool force); static inline struct ptlrpc_request * ptlrpc_nrs_req_get_nolock(struct ptlrpc_service_part *svcpt, bool hp, bool force) { - return ptlrpc_nrs_req_get_nolock0(svcpt, hp, false, force); + return __ptlrpc_nrs_req_get_nolock(svcpt, hp, false, force); } bool ptlrpc_nrs_req_pending_nolock(struct ptlrpc_service_part *svcpt, bool hp);