From: James Simmons <jsimmons@infradead.org>
To: Andreas Dilger <adilger@whamcloud.com>,
Oleg Drokin <green@whamcloud.com>, NeilBrown <neilb@suse.de>
Cc: Lustre Development List <lustre-devel@lists.lustre.org>
Subject: [lustre-devel] [PATCH 31/41] lustre: change various operations structs to const
Date: Sun, 4 Apr 2021 20:51:00 -0400 [thread overview]
Message-ID: <1617583870-32029-32-git-send-email-jsimmons@infradead.org> (raw)
In-Reply-To: <1617583870-32029-1-git-send-email-jsimmons@infradead.org>
From: Mr NeilBrown <neilb@suse.de>
Nearly all of
struct cl_io_operations
struct cl_lock_operations
struct super_operations
struct llog_operations
are now const. The one exception is changelog_orig_logops.
WC-bug-id: https://jira.whamcloud.com/browse/LU-6142
Lustre-commit: c20b866ba374ea3 ("LU-6142 lustre: change various operations structs to const")
Signed-off-by: Mr NeilBrown <neilb@suse.de>
Reviewed-on: https://review.whamcloud.com/39400
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Arshad Hussain <arshad.hussain@aeoncomputing.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
---
fs/lustre/include/lustre_log.h | 10 +++++-----
fs/lustre/include/lustre_net.h | 2 +-
fs/lustre/llite/llite_internal.h | 2 +-
fs/lustre/llite/super25.c | 2 +-
fs/lustre/mdc/mdc_dev.c | 2 +-
fs/lustre/obdclass/llog.c | 4 ++--
fs/lustre/obdclass/llog_obd.c | 2 +-
fs/lustre/ptlrpc/llog_client.c | 2 +-
8 files changed, 13 insertions(+), 13 deletions(-)
diff --git a/fs/lustre/include/lustre_log.h b/fs/lustre/include/lustre_log.h
index 6995414..24e6609 100644
--- a/fs/lustre/include/lustre_log.h
+++ b/fs/lustre/include/lustre_log.h
@@ -134,7 +134,7 @@ int llog_cat_process(const struct lu_env *env, struct llog_handle *cat_llh,
/* llog_obd.c */
int llog_setup(const struct lu_env *env, struct obd_device *obd,
struct obd_llog_group *olg, int index,
- struct obd_device *disk_obd, struct llog_operations *op);
+ struct obd_device *disk_obd, const struct llog_operations *op);
int __llog_ctxt_put(const struct lu_env *env, struct llog_ctxt *ctxt);
int llog_cleanup(const struct lu_env *env, struct llog_ctxt *);
@@ -225,7 +225,7 @@ struct llog_handle {
} u;
char *lgh_name;
void *private_data;
- struct llog_operations *lgh_logops;
+ const struct llog_operations *lgh_logops;
refcount_t lgh_refcount;
bool lgh_destroyed;
};
@@ -241,7 +241,7 @@ struct llog_ctxt {
struct obd_import *loc_imp; /* to use in RPC's: can be backward
* pointing import
*/
- struct llog_operations *loc_logops;
+ const struct llog_operations *loc_logops;
struct llog_handle *loc_handle;
struct mutex loc_mutex; /* protect loc_imp */
refcount_t loc_refcount;
@@ -257,7 +257,7 @@ struct llog_ctxt {
#define LLOG_DEL_RECORD 0x0002
static inline int llog_handle2ops(struct llog_handle *loghandle,
- struct llog_operations **lop)
+ const struct llog_operations **lop)
{
if (!loghandle || !loghandle->lgh_logops)
return -EINVAL;
@@ -351,7 +351,7 @@ static inline int llog_next_block(const struct lu_env *env,
int next_idx, u64 *cur_offset, void *buf,
int len)
{
- struct llog_operations *lop;
+ const struct llog_operations *lop;
int rc;
rc = llog_handle2ops(loghandle, &lop);
diff --git a/fs/lustre/include/lustre_net.h b/fs/lustre/include/lustre_net.h
index f16c935..a9aa363 100644
--- a/fs/lustre/include/lustre_net.h
+++ b/fs/lustre/include/lustre_net.h
@@ -2409,7 +2409,7 @@ enum timeout_event {
/** @} */
/* ptlrpc/llog_client.c */
-extern struct llog_operations llog_client_ops;
+extern const struct llog_operations llog_client_ops;
/** @} net */
#endif
diff --git a/fs/lustre/llite/llite_internal.h b/fs/lustre/llite/llite_internal.h
index 3bd774b..677106d 100644
--- a/fs/lustre/llite/llite_internal.h
+++ b/fs/lustre/llite/llite_internal.h
@@ -1131,7 +1131,7 @@ int ll_revalidate_it_finish(struct ptlrpc_request *request,
struct lookup_intent *it, struct inode *inode);
/* llite/llite_lib.c */
-extern struct super_operations lustre_super_operations;
+extern const struct super_operations lustre_super_operations;
void ll_common_put_super(struct super_block *sb);
void ll_lli_init(struct ll_inode_info *lli);
diff --git a/fs/lustre/llite/super25.c b/fs/lustre/llite/super25.c
index d02c8cf..e3194a5 100644
--- a/fs/lustre/llite/super25.c
+++ b/fs/lustre/llite/super25.c
@@ -83,7 +83,7 @@ static int ll_drop_inode(struct inode *inode)
}
/* exported operations */
-struct super_operations lustre_super_operations = {
+const struct super_operations lustre_super_operations = {
.alloc_inode = ll_alloc_inode,
.destroy_inode = ll_destroy_inode,
.drop_inode = ll_drop_inode,
diff --git a/fs/lustre/mdc/mdc_dev.c b/fs/lustre/mdc/mdc_dev.c
index 68088ef..39c1213 100644
--- a/fs/lustre/mdc/mdc_dev.c
+++ b/fs/lustre/mdc/mdc_dev.c
@@ -1284,7 +1284,7 @@ static void mdc_io_data_version_end(const struct lu_env *env,
}
}
-static struct cl_io_operations mdc_io_ops = {
+static const struct cl_io_operations mdc_io_ops = {
.op = {
[CIT_READ] = {
.cio_iter_init = osc_io_rw_iter_init,
diff --git a/fs/lustre/obdclass/llog.c b/fs/lustre/obdclass/llog.c
index 7668d51..b431087 100644
--- a/fs/lustre/obdclass/llog.c
+++ b/fs/lustre/obdclass/llog.c
@@ -100,7 +100,7 @@ int llog_handle_put(const struct lu_env *env, struct llog_handle *loghandle)
int rc = 0;
if (refcount_dec_and_test(&loghandle->lgh_refcount)) {
- struct llog_operations *lop;
+ const struct llog_operations *lop;
rc = llog_handle2ops(loghandle, &lop);
if (!rc) {
@@ -118,7 +118,7 @@ static int llog_read_header(const struct lu_env *env,
struct llog_handle *handle,
struct obd_uuid *uuid)
{
- struct llog_operations *lop;
+ const struct llog_operations *lop;
int rc;
rc = llog_handle2ops(handle, &lop);
diff --git a/fs/lustre/obdclass/llog_obd.c b/fs/lustre/obdclass/llog_obd.c
index f652eed..82f96ed 100644
--- a/fs/lustre/obdclass/llog_obd.c
+++ b/fs/lustre/obdclass/llog_obd.c
@@ -135,7 +135,7 @@ int llog_cleanup(const struct lu_env *env, struct llog_ctxt *ctxt)
int llog_setup(const struct lu_env *env, struct obd_device *obd,
struct obd_llog_group *olg, int index,
- struct obd_device *disk_obd, struct llog_operations *op)
+ struct obd_device *disk_obd, const struct llog_operations *op)
{
struct llog_ctxt *ctxt;
int rc = 0;
diff --git a/fs/lustre/ptlrpc/llog_client.c b/fs/lustre/ptlrpc/llog_client.c
index aeefa8f..79764cf 100644
--- a/fs/lustre/ptlrpc/llog_client.c
+++ b/fs/lustre/ptlrpc/llog_client.c
@@ -352,7 +352,7 @@ static int llog_client_close(const struct lu_env *env,
return 0;
}
-struct llog_operations llog_client_ops = {
+const struct llog_operations llog_client_ops = {
.lop_next_block = llog_client_next_block,
.lop_prev_block = llog_client_prev_block,
.lop_read_header = llog_client_read_header,
--
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-04-05 0:52 UTC|newest]
Thread overview: 42+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-05 0:50 [lustre-devel] [PATCH 00/41] lustre: sync to OpenSFS branch as of March 1 James Simmons
2021-04-05 0:50 ` [lustre-devel] [PATCH 01/41] lustre: llite: data corruption due to RPC reordering James Simmons
2021-04-05 0:50 ` [lustre-devel] [PATCH 02/41] lustre: llite: make readahead aware of hints James Simmons
2021-04-05 0:50 ` [lustre-devel] [PATCH 03/41] lustre: lov: avoid NULL dereference in cleanup James Simmons
2021-04-05 0:50 ` [lustre-devel] [PATCH 04/41] lustre: llite: quiet spurious ioctl warning James Simmons
2021-04-05 0:50 ` [lustre-devel] [PATCH 05/41] lustre: ptlrpc: do not output error when imp_sec is freed James Simmons
2021-04-05 0:50 ` [lustre-devel] [PATCH 06/41] lustre: update version to 2.14.0 James Simmons
2021-04-05 0:50 ` [lustre-devel] [PATCH 07/41] lnet: UDSP storage and marshalled structs James Simmons
2021-04-05 0:50 ` [lustre-devel] [PATCH 08/41] lnet: foundation patch for selection mod James Simmons
2021-04-05 0:50 ` [lustre-devel] [PATCH 09/41] lnet: Preferred gateway selection James Simmons
2021-04-05 0:50 ` [lustre-devel] [PATCH 10/41] lnet: Select NI/peer NI with highest prio James Simmons
2021-04-05 0:50 ` [lustre-devel] [PATCH 11/41] lnet: select best peer and local net James Simmons
2021-04-05 0:50 ` [lustre-devel] [PATCH 12/41] lnet: UDSP handling James Simmons
2021-04-05 0:50 ` [lustre-devel] [PATCH 13/41] lnet: Apply UDSP on local and remote NIs James Simmons
2021-04-05 0:50 ` [lustre-devel] [PATCH 14/41] lnet: Add the kernel level Marshalling API James Simmons
2021-04-05 0:50 ` [lustre-devel] [PATCH 15/41] lnet: Add the kernel level De-Marshalling API James Simmons
2021-04-05 0:50 ` [lustre-devel] [PATCH 16/41] lnet: Add the ioctl handler for "add policy" James Simmons
2021-04-05 0:50 ` [lustre-devel] [PATCH 17/41] lnet: ioctl handler for "delete policy" James Simmons
2021-04-05 0:50 ` [lustre-devel] [PATCH 18/41] lnet: ioctl handler for get policy info James Simmons
2021-04-05 0:50 ` [lustre-devel] [PATCH 19/41] lustre: update version to 2.14.50 James Simmons
2021-04-05 0:50 ` [lustre-devel] [PATCH 20/41] lustre: gss: handle empty reqmsg in sptlrpc_req_ctx_switch James Simmons
2021-04-05 0:50 ` [lustre-devel] [PATCH 21/41] lustre: sec: file ioctls to handle encryption policies James Simmons
2021-04-05 0:50 ` [lustre-devel] [PATCH 22/41] lustre: obdclass: try to skip corrupted llog records James Simmons
2021-04-05 0:50 ` [lustre-devel] [PATCH 23/41] lustre: lov: fix layout generation inc for mirror split James Simmons
2021-04-05 0:50 ` [lustre-devel] [PATCH 24/41] lnet: modify assertion in lnet_post_send_locked James Simmons
2021-04-05 0:50 ` [lustre-devel] [PATCH 25/41] lustre: lov: fixes bitfield in lod qos code James Simmons
2021-04-05 0:50 ` [lustre-devel] [PATCH 26/41] lustre: lov: grant deadlock if same OSC in two components James Simmons
2021-04-05 0:50 ` [lustre-devel] [PATCH 27/41] lustre: change EWOULDBLOCK to EAGAIN James Simmons
2021-04-05 0:50 ` [lustre-devel] [PATCH 28/41] lsutre: ldlm: return error from ldlm_namespace_new() James Simmons
2021-04-05 0:50 ` [lustre-devel] [PATCH 29/41] lustre: llite: remove unused ll_teardown_mmaps() James Simmons
2021-04-05 0:50 ` [lustre-devel] [PATCH 30/41] lustre: lov: style cleanups in lov_set_osc_active() James Simmons
2021-04-05 0:51 ` James Simmons [this message]
2021-04-05 0:51 ` [lustre-devel] [PATCH 32/41] lustre: mark strings in char arrays as const James Simmons
2021-04-05 0:51 ` [lustre-devel] [PATCH 33/41] lustre: convert snprintf to scnprintf as appropriate James Simmons
2021-04-05 0:51 ` [lustre-devel] [PATCH 34/41] lustre: remove non-static 'inline' markings James Simmons
2021-04-05 0:51 ` [lustre-devel] [PATCH 35/41] lustre: llite: use is_root_inode() James Simmons
2021-04-05 0:51 ` [lustre-devel] [PATCH 36/41] lnet: libcfs: discard cfs_firststr James Simmons
2021-04-05 0:51 ` [lustre-devel] [PATCH 37/41] lnet: place wire protocol data int own headers James Simmons
2021-04-05 0:51 ` [lustre-devel] [PATCH 38/41] lnet: libcfs: use wait_event_timeout() in tracefiled() James Simmons
2021-04-05 0:51 ` [lustre-devel] [PATCH 39/41] lnet: use init_wait() rather than init_waitqueue_entry() James Simmons
2021-04-05 0:51 ` [lustre-devel] [PATCH 40/41] lnet: discard LNET_MD_PHYS James Simmons
2021-04-05 0:51 ` [lustre-devel] [PATCH 41/41] lnet: o2iblnd: convert peers hash table to hashtable.h 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=1617583870-32029-32-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 \
/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).