From: James Simmons <jsimmons@infradead.org>
To: Andreas Dilger <adilger@whamcloud.com>,
Oleg Drokin <green@whamcloud.com>, NeilBrown <neilb@suse.de>
Cc: Sergey Cheremencev <sergey.cheremencev@hpe.com>,
Lustre Development List <lustre-devel@lists.lustre.org>
Subject: [lustre-devel] [PATCH 08/12] lustre: obdclass: cosmetic changes in pool handling
Date: Sun, 12 Dec 2021 10:07:59 -0500 [thread overview]
Message-ID: <1639321683-22909-9-git-send-email-jsimmons@infradead.org> (raw)
In-Reply-To: <1639321683-22909-1-git-send-email-jsimmons@infradead.org>
From: Sergey Cheremencev <sergey.cheremencev@hpe.com>
cosmetic changes in pool handling:
- make tgt_pool_free void
- set default rc value in lu_tgt_check_index.
HPE-bug-id: LUS-9547
WC-bug-id: https://jira.whamcloud.com/browse/LU-15110
Lustre-commit: d01cae3ec8758fc27 ("LU-15110 quota: cosmetic changes in PQ")
Signed-off-by: Sergey Cheremencev <sergey.cheremencev@hpe.com>
Reviewed-on: https://review.whamcloud.com/45258
Reviewed-by: Petros Koutoupis <petros.koutoupis@hpe.com>
Reviewed-by: Shaun Tancheff <shaun.tancheff@hpe.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
---
fs/lustre/include/lu_object.h | 2 +-
fs/lustre/obdclass/lu_tgt_pool.c | 15 +++++++--------
2 files changed, 8 insertions(+), 9 deletions(-)
diff --git a/fs/lustre/include/lu_object.h b/fs/lustre/include/lu_object.h
index 146398a..3fb40c6 100644
--- a/fs/lustre/include/lu_object.h
+++ b/fs/lustre/include/lu_object.h
@@ -1423,7 +1423,7 @@ struct lu_tgt_pool {
int lu_tgt_pool_init(struct lu_tgt_pool *op, unsigned int count);
int lu_tgt_pool_add(struct lu_tgt_pool *op, u32 idx, unsigned int min_count);
int lu_tgt_pool_remove(struct lu_tgt_pool *op, u32 idx);
-int lu_tgt_pool_free(struct lu_tgt_pool *op);
+void lu_tgt_pool_free(struct lu_tgt_pool *op);
int lu_tgt_check_index(int idx, struct lu_tgt_pool *osts);
int lu_tgt_pool_extend(struct lu_tgt_pool *op, unsigned int min_count);
diff --git a/fs/lustre/obdclass/lu_tgt_pool.c b/fs/lustre/obdclass/lu_tgt_pool.c
index 17bae54..38ab83d 100644
--- a/fs/lustre/obdclass/lu_tgt_pool.c
+++ b/fs/lustre/obdclass/lu_tgt_pool.c
@@ -197,14 +197,15 @@ int lu_tgt_pool_remove(struct lu_tgt_pool *op, u32 idx)
int lu_tgt_check_index(int idx, struct lu_tgt_pool *osts)
{
- int rc = 0, i;
+ int i, rc = -ENOENT;
down_read(&osts->op_rw_sem);
for (i = 0; i < osts->op_count; i++) {
- if (osts->op_array[i] == idx)
+ if (osts->op_array[i] == idx) {
+ rc = 0;
goto out;
+ }
}
- rc = -ENOENT;
out:
up_read(&osts->op_rw_sem);
return rc;
@@ -219,13 +220,11 @@ int lu_tgt_check_index(int idx, struct lu_tgt_pool *osts)
* deleted from memory.
*
* @op pool to be freed.
- *
- * Return: 0 on success or if pool was already freed
*/
-int lu_tgt_pool_free(struct lu_tgt_pool *op)
+void lu_tgt_pool_free(struct lu_tgt_pool *op)
{
if (op->op_size == 0)
- return 0;
+ return;
down_write(&op->op_rw_sem);
@@ -235,6 +234,6 @@ int lu_tgt_pool_free(struct lu_tgt_pool *op)
op->op_size = 0;
up_write(&op->op_rw_sem);
- return 0;
+ return;
}
EXPORT_SYMBOL(lu_tgt_pool_free);
--
1.8.3.1
_______________________________________________
lustre-devel mailing list
lustre-devel@lists.lustre.org
http://lists.lustre.org/listinfo.cgi/lustre-devel-lustre.org
next prev parent reply other threads:[~2021-12-12 15:09 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-12-12 15:07 [lustre-devel] [PATCH 00/12] lustre: backport OpenSFS work Dec 12, 2021 James Simmons
2021-12-12 15:07 ` [lustre-devel] [PATCH 01/12] lustre: llite: do not take mod rpc slot for getxattr James Simmons
2021-12-12 15:07 ` [lustre-devel] [PATCH 02/12] lnet: uapi: move out kernel only code James Simmons
2021-12-12 15:07 ` [lustre-devel] [PATCH 03/12] lustre: ptlrpc: Do not unlink difficult reply until sent James Simmons
2021-12-12 15:07 ` [lustre-devel] [PATCH 04/12] lustre: obdclass: make niduuid for lustre_stop_mgc() static James Simmons
2021-12-12 15:07 ` [lustre-devel] [PATCH 05/12] lnet: Allow specifying a source NID for lnetctl ping James Simmons
2021-12-12 15:07 ` [lustre-devel] [PATCH 06/12] lnet: Fix source specified send to different net James Simmons
2021-12-12 15:07 ` [lustre-devel] [PATCH 07/12] lnet: Fix source specified to routed destination James Simmons
2021-12-12 15:07 ` James Simmons [this message]
2021-12-12 15:08 ` [lustre-devel] [PATCH 09/12] lustre: llite: properly detect SELinux disabled case James Simmons
2021-12-12 15:08 ` [lustre-devel] [PATCH 10/12] lnet: o2iblnd: Default map_on_demand to 1 James Simmons
2021-12-12 15:08 ` [lustre-devel] [PATCH 11/12] lustre: pcc: disable PCC for encrypted files James Simmons
2021-12-12 15:08 ` [lustre-devel] [PATCH 12/12] lustre: llite: avoid needless large stats alloc James Simmons
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1639321683-22909-9-git-send-email-jsimmons@infradead.org \
--to=jsimmons@infradead.org \
--cc=adilger@whamcloud.com \
--cc=green@whamcloud.com \
--cc=lustre-devel@lists.lustre.org \
--cc=neilb@suse.de \
--cc=sergey.cheremencev@hpe.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).