Whamcloud - gitweb
LU-6142 lfsck: make all 'struct lfsck_operations' to const 97/39397/3
authorMr NeilBrown <neilb@suse.de>
Thu, 16 Jul 2020 04:07:56 +0000 (14:07 +1000)
committerOleg Drokin <green@whamcloud.com>
Fri, 26 Feb 2021 21:42:16 +0000 (21:42 +0000)
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>
lustre/lfsck/lfsck_engine.c
lustre/lfsck/lfsck_internal.h
lustre/lfsck/lfsck_layout.c
lustre/lfsck/lfsck_lib.c
lustre/lfsck/lfsck_namespace.c

index f278c1d..2ae4ad8 100644 (file)
@@ -1583,7 +1583,7 @@ int lfsck_assistant_engine(void *args)
        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;
index 9292891..7217c60 100644 (file)
@@ -552,7 +552,7 @@ struct lfsck_component {
        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;
@@ -849,7 +849,7 @@ struct lfsck_assistant_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;
 
@@ -960,7 +960,7 @@ void lfsck_control_speed(struct lfsck_instance *lfsck);
 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,
index 9c0c865..8f81d8f 100644 (file)
@@ -6808,7 +6808,7 @@ static int lfsck_layout_slave_join(const struct lu_env *env,
        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,
@@ -6824,7 +6824,7 @@ static struct lfsck_operations lfsck_layout_master_ops = {
        .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,
@@ -6862,7 +6862,7 @@ static void lfsck_layout_assistant_fill_pos(const struct lu_env *env,
        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,
index 19f7a4d..8efdfce 100644 (file)
@@ -1957,7 +1957,7 @@ 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_data *lad;
index 6e952ac..a227bb0 100644 (file)
@@ -5227,7 +5227,7 @@ static int lfsck_namespace_query(const struct lu_env *env,
        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,
@@ -6828,7 +6828,7 @@ out:
        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,