Operations structures should be 'const' wherever possible.
So change both lfsck_operations and lfsck_assistant_operations
to const.
Test-Parameters: trivial
Signed-off-by: Mr NeilBrown <neilb@suse.de>
Change-Id: Ic457c0e52ceafab58cb788db383957ed4ab39df4
Reviewed-on: https://review.whamcloud.com/39397
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Lai Siyao <lai.siyao@whamcloud.com>
Reviewed-by: Arshad Hussain <arshad.hussain@aeoncomputing.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
struct lfsck_assistant_data *lad = com->lc_data;
struct ptlrpc_thread *mthread = &lfsck->li_thread;
struct ptlrpc_thread *athread = &lad->lad_thread;
- struct lfsck_assistant_operations *lao = lad->lad_ops;
+ const struct lfsck_assistant_operations *lao = lad->lad_ops;
struct lfsck_assistant_req *lar;
int rc = 0;
int rc1 = 0;
struct lfsck_instance *lc_lfsck;
struct dt_object *lc_obj;
struct lfsck_sub_trace_obj lc_sub_trace_objs[LFSCK_STF_COUNT];
- struct lfsck_operations *lc_ops;
+ const struct lfsck_operations *lc_ops;
void *lc_file_ram;
void *lc_file_disk;
void *lc_data;
struct ptlrpc_thread lad_thread;
struct task_struct *lad_task;
- struct lfsck_assistant_operations *lad_ops;
+ const struct lfsck_assistant_operations *lad_ops;
struct cfs_bitmap *lad_bitmap;
void lfsck_control_speed_by_self(struct lfsck_component *com);
void lfsck_thread_args_fini(struct lfsck_thread_args *lta);
struct lfsck_assistant_data *
-lfsck_assistant_data_init(struct lfsck_assistant_operations *lao,
+lfsck_assistant_data_init(const struct lfsck_assistant_operations *lao,
const char *name);
struct lfsck_assistant_object *
lfsck_assistant_object_init(const struct lu_env *env, const struct lu_fid *fid,
RETURN(rc);
}
-static struct lfsck_operations lfsck_layout_master_ops = {
+static const struct lfsck_operations lfsck_layout_master_ops = {
.lfsck_reset = lfsck_layout_reset,
.lfsck_fail = lfsck_layout_fail,
.lfsck_checkpoint = lfsck_layout_master_checkpoint,
.lfsck_query = lfsck_layout_query,
};
-static struct lfsck_operations lfsck_layout_slave_ops = {
+static const struct lfsck_operations lfsck_layout_slave_ops = {
.lfsck_reset = lfsck_layout_reset,
.lfsck_fail = lfsck_layout_fail,
.lfsck_checkpoint = lfsck_layout_slave_checkpoint,
pos->lp_oit_cookie = llr->llr_lar.lar_parent->lso_oit_cookie - 1;
}
-struct lfsck_assistant_operations lfsck_layout_assistant_ops = {
+const struct lfsck_assistant_operations lfsck_layout_assistant_ops = {
.la_handler_p1 = lfsck_layout_assistant_handler_p1,
.la_handler_p2 = lfsck_layout_assistant_handler_p2,
.la_fill_pos = lfsck_layout_assistant_fill_pos,
}
struct lfsck_assistant_data *
-lfsck_assistant_data_init(struct lfsck_assistant_operations *lao,
+lfsck_assistant_data_init(const struct lfsck_assistant_operations *lao,
const char *name)
{
struct lfsck_assistant_data *lad;
return rc;
}
-static struct lfsck_operations lfsck_namespace_ops = {
+static const struct lfsck_operations lfsck_namespace_ops = {
.lfsck_reset = lfsck_namespace_reset,
.lfsck_fail = lfsck_namespace_fail,
.lfsck_close_dir = lfsck_namespace_close_dir,
EXIT;
}
-struct lfsck_assistant_operations lfsck_namespace_assistant_ops = {
+const struct lfsck_assistant_operations lfsck_namespace_assistant_ops = {
.la_handler_p1 = lfsck_namespace_assistant_handler_p1,
.la_handler_p2 = lfsck_namespace_assistant_handler_p2,
.la_fill_pos = lfsck_namespace_assistant_fill_pos,