Whamcloud - gitweb
LU-8174 mdt: remove use of typedef mds_reint_t 94/27494/4
authorAndreas Dilger <andreas.dilger@intel.com>
Mon, 30 Oct 2017 18:41:55 +0000 (14:41 -0400)
committerOleg Drokin <oleg.drokin@intel.com>
Mon, 6 Nov 2017 03:43:23 +0000 (03:43 +0000)
Replace the use of mdt_reint_t with enum mds_reint_op.

Remove the old mds_reint_t and mdt_reint_t since they were only used
in one place in the Lustre code and are unlikely to cause additional
patch breakage.  The majority of references are in wireshark.

Test-Parameters: trivial
Signed-off-by: Andreas Dilger <andreas.dilger@intel.com>
Change-Id: I3932db8e6dc9ac83325900d3f382c648ac57b8c0
Reviewed-on: https://review.whamcloud.com/27494
Tested-by: Jenkins
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: James Simmons <uja.ornl@yahoo.com>
Reviewed-by: Ben Evans <bevans@cray.com>
lustre/contrib/wireshark/packet-lustre.c
lustre/include/uapi/linux/lustre/lustre_idl.h
lustre/mdt/mdt_internal.h

index 2ad9467..f95588a 100644 (file)
@@ -272,8 +272,8 @@ static const value_string lustre_layout_intent_opc_values[] = {
 #define IT_QUOTA_CONN  0x1000
 #define IT_SETXATTR    0x2000
 
-/* lustre/include/lustre/lustre_idl.h */
-typedef enum {
+/* lustre/include/uapi/linux/lustre/lustre_idl.h */
+enum mds_reint_op {
   REINT_SETATTR  = 1,
   REINT_CREATE   = 2,
   REINT_LINK     = 3,
@@ -284,7 +284,7 @@ typedef enum {
   REINT_RMENTRY  = 8,
   REINT_MIGRATE  = 9,
   REINT_MAX
-} mds_reint_t;
+};
 
 enum ldlm_cmd {
   LDLM_ENQUEUE     = 101,
@@ -1294,7 +1294,7 @@ const value_string lustre_LMTypes[] = {
   { 0, NULL }
 };
 
-const value_string lustre_mds_reint_t_vals[] = {
+const value_string lustre_mds_reint_op_vals[] = {
   { REINT_SETATTR, "REINT_SETATTR" },
   { REINT_CREATE, "REINT_CREATE" },
   { REINT_LINK, "REINT_LINK" },
@@ -3695,7 +3695,7 @@ lustre_dissect_struct_mdt_rec_setattr(tvbuff_t *tvb _U_, int offset _U_, packet_
     tree = proto_item_add_subtree(item, ett_lustre_mdt_rec_setattr);
   }
   sa_opcode=tvb_get_letohl(tvb,offset);
-  display_info_fstr(parent_tree->parent, pinfo->cinfo, COL_INFO, "[%s]", val_to_str(sa_opcode, lustre_mds_reint_t_vals, "Unknown sa_opc"));
+  display_info_fstr(parent_tree->parent, pinfo->cinfo, COL_INFO, "[%s]", val_to_str(sa_opcode, lustre_mds_reint_op_vals, "Unknown sa_opc"));
 
   offset=lustre_dissect_element_mdt_rec_setattr_sa_opcode(tvb, offset, pinfo, tree);
 
@@ -3986,7 +3986,7 @@ lustre_dissect_struct_mdt_rec_create(tvbuff_t *tvb _U_, int offset _U_,
     tree = proto_item_add_subtree(item, ett_lustre_mdt_rec_create);
   }
   cr_opcode=tvb_get_letohl(tvb,offset);
-  display_info_fstr(parent_tree->parent, pinfo->cinfo, COL_INFO, "[%s]", val_to_str(cr_opcode, lustre_mds_reint_t_vals, "Unknown cr_opc"));
+  display_info_fstr(parent_tree->parent, pinfo->cinfo, COL_INFO, "[%s]", val_to_str(cr_opcode, lustre_mds_reint_op_vals, "Unknown cr_opc"));
 
   offset=lustre_dissect_element_mdt_rec_create_cr_opcode(tvb, offset, pinfo, tree);
 
@@ -4271,7 +4271,7 @@ lustre_dissect_struct_mdt_rec_link(tvbuff_t *tvb _U_, int offset _U_, packet_inf
     tree = proto_item_add_subtree(item, ett_lustre_mdt_rec_link);
   }
   lk_opcode=tvb_get_letohl(tvb,offset);
-  display_info_fstr(parent_tree->parent, pinfo->cinfo, COL_INFO, "[%s]", val_to_str(lk_opcode, lustre_mds_reint_t_vals, "Unknown lk_opc"));
+  display_info_fstr(parent_tree->parent, pinfo->cinfo, COL_INFO, "[%s]", val_to_str(lk_opcode, lustre_mds_reint_op_vals, "Unknown lk_opc"));
 
   offset=lustre_dissect_element_mdt_rec_link_lk_opcode(tvb, offset, pinfo, tree);
 
@@ -4557,7 +4557,7 @@ lustre_dissect_struct_mdt_rec_unlink(tvbuff_t *tvb _U_, int offset _U_, packet_i
   }
 
   ul_opcode=tvb_get_letohl(tvb,offset);
-  display_info_fstr(parent_tree->parent, pinfo->cinfo, COL_INFO, "[%s]", val_to_str(ul_opcode, lustre_mds_reint_t_vals, "Unknown ul_opc"));
+  display_info_fstr(parent_tree->parent, pinfo->cinfo, COL_INFO, "[%s]", val_to_str(ul_opcode, lustre_mds_reint_op_vals, "Unknown ul_opc"));
 
   offset=lustre_dissect_element_mdt_rec_unlink_ul_opcode(tvb, offset, pinfo, tree);
 
@@ -4833,7 +4833,7 @@ lustre_dissect_struct_mdt_rec_rename(tvbuff_t *tvb _U_, int offset _U_, packet_i
   }
 
   rn_opcode=tvb_get_letohl(tvb,offset);
-  display_info_fstr(parent_tree->parent, pinfo->cinfo, COL_INFO, "[%s]", val_to_str(rn_opcode, lustre_mds_reint_t_vals, "Unknown rn_opc"));
+  display_info_fstr(parent_tree->parent, pinfo->cinfo, COL_INFO, "[%s]", val_to_str(rn_opcode, lustre_mds_reint_op_vals, "Unknown rn_opc"));
 
   offset=lustre_dissect_element_mdt_rec_rename_rn_opcode(tvb, offset, pinfo, tree);
 
@@ -5139,7 +5139,7 @@ int
     tree = proto_item_add_subtree(item, ett_lustre_mdt_rec_setxattr);
   }
   sx_opcode=tvb_get_letohl(tvb,offset);
-  display_info_fstr(parent_tree->parent, pinfo->cinfo, COL_INFO, "[%s]", val_to_str(sx_opcode, lustre_mds_reint_t_vals, "Unknown sx_opc"));
+  display_info_fstr(parent_tree->parent, pinfo->cinfo, COL_INFO, "[%s]", val_to_str(sx_opcode, lustre_mds_reint_op_vals, "Unknown sx_opc"));
 
   offset=lustre_dissect_element_mdt_rec_setxattr_sx_opcode(tvb, offset, pinfo, tree);
 
@@ -10769,7 +10769,7 @@ void proto_register_dcerpc_lustre(void)
     { &hf_lustre_mdt_rec_setattr,
       { "mdt rec setattr", "lustre.mdt_rec_setattr", FT_NONE, BASE_NONE, NULL , 0 , "", HFILL}},
     { &hf_lustre_mdt_rec_setattr_sa_opcode,
-      { "Sa Opcode", "lustre.mdt_rec_setattr.sa_opcode", FT_UINT32, BASE_DEC, VALS(lustre_mds_reint_t_vals), 0, "", HFILL }},
+      { "Sa Opcode", "lustre.mdt_rec_setattr.sa_opcode", FT_UINT32, BASE_DEC, VALS(lustre_mds_reint_op_vals), 0, "", HFILL }},
     { &hf_lustre_mdt_rec_setattr_sa_cap,
       { "Sa Cap", "lustre.mdt_rec_setattr.sa_cap", FT_UINT32, BASE_DEC, NULL, 0, "", HFILL }},
     { &hf_lustre_mdt_rec_setattr_sa_fsuid,
@@ -10823,7 +10823,7 @@ void proto_register_dcerpc_lustre(void)
     { &hf_lustre_mdt_rec_create,
       { "mdt rec create", "lustre.mdt_rec_create", FT_NONE, BASE_NONE, NULL , 0 , "", HFILL}},
     { &hf_lustre_mdt_rec_create_cr_opcode,
-      { "Cr Opcode", "lustre.mdt_rec_create.cr_opcode", FT_UINT32, BASE_DEC, VALS(lustre_mds_reint_t_vals), 0, "", HFILL }},
+      { "Cr Opcode", "lustre.mdt_rec_create.cr_opcode", FT_UINT32, BASE_DEC, VALS(lustre_mds_reint_op_vals), 0, "", HFILL }},
     { &hf_lustre_mdt_rec_create_cr_cap,
       { "Cr Cap", "lustre.mdt_rec_create.cr_cap", FT_UINT32, BASE_DEC, NULL, 0, "", HFILL }},
     { &hf_lustre_mdt_rec_create_cr_fsuid,
@@ -10872,7 +10872,7 @@ void proto_register_dcerpc_lustre(void)
     { &hf_lustre_mdt_rec_link,
       { "mdt rec link", "lustre.mdt_rec_link", FT_NONE, BASE_NONE, NULL , 0 , "", HFILL}},
     { &hf_lustre_mdt_rec_link_lk_opcode,
-      { "Lk Opcode", "lustre.mdt_rec_link.lk_opcode", FT_UINT32, BASE_DEC, VALS(lustre_mds_reint_t_vals) , 0, "", HFILL }},
+      { "Lk Opcode", "lustre.mdt_rec_link.lk_opcode", FT_UINT32, BASE_DEC, VALS(lustre_mds_reint_op_vals) , 0, "", HFILL }},
     { &hf_lustre_mdt_rec_link_lk_cap,
       { "Lk Cap", "lustre.mdt_rec_link.lk_cap", FT_UINT32, BASE_DEC, NULL, 0, "", HFILL }},
     { &hf_lustre_mdt_rec_link_lk_fsuid,
@@ -10924,7 +10924,7 @@ void proto_register_dcerpc_lustre(void)
     { &hf_lustre_mdt_rec_unlink,
       { "mdt rec unlink", "lustre.mdt_rec_unlink", FT_NONE, BASE_NONE, NULL , 0 , "", HFILL}},
     { &hf_lustre_mdt_rec_unlink_ul_opcode,
-      { "Ul Opcode", "lustre.mdt_rec_unlink.ul_opcode", FT_UINT32, BASE_DEC, VALS(lustre_mds_reint_t_vals) , 0, "", HFILL }},
+      { "Ul Opcode", "lustre.mdt_rec_unlink.ul_opcode", FT_UINT32, BASE_DEC, VALS(lustre_mds_reint_op_vals) , 0, "", HFILL }},
     { &hf_lustre_mdt_rec_unlink_ul_cap,
       { "Ul Cap", "lustre.mdt_rec_unlink.ul_cap", FT_UINT32, BASE_DEC, NULL, 0, "", HFILL }},
     { &hf_lustre_mdt_rec_unlink_ul_fsuid,
@@ -10975,7 +10975,7 @@ void proto_register_dcerpc_lustre(void)
     { &hf_lustre_mdt_rec_rename,
       { "mdt rec rename", "lustre.mdt_rec_rename", FT_NONE, BASE_NONE, NULL , 0 , "", HFILL}},
     { &hf_lustre_mdt_rec_rename_rn_opcode,
-      { "Rn Opcode", "lustre.mdt_rec_rename.rn_opcode", FT_UINT32, BASE_DEC, VALS(lustre_mds_reint_t_vals) , 0, "", HFILL }},
+      { "Rn Opcode", "lustre.mdt_rec_rename.rn_opcode", FT_UINT32, BASE_DEC, VALS(lustre_mds_reint_op_vals) , 0, "", HFILL }},
     { &hf_lustre_mdt_rec_rename_rn_cap,
       { "Rn Cap", "lustre.mdt_rec_rename.rn_cap", FT_UINT32, BASE_DEC, NULL, 0, "", HFILL }},
     { &hf_lustre_mdt_rec_rename_rn_fsuid,
@@ -11026,7 +11026,7 @@ void proto_register_dcerpc_lustre(void)
     { &hf_lustre_mdt_rec_setxattr,
       { "mdt rec setxattr", "lustre.mdt_rec_setxattr", FT_NONE, BASE_NONE, NULL , 0 , "", HFILL}},
     { &hf_lustre_mdt_rec_setxattr_sx_opcode,
-      { "Sx Opcode", "lustre.mdt_rec_setxattr.sx_opcode", FT_UINT32, BASE_DEC, VALS(lustre_mds_reint_t_vals), 0, "", HFILL }},
+      { "Sx Opcode", "lustre.mdt_rec_setxattr.sx_opcode", FT_UINT32, BASE_DEC, VALS(lustre_mds_reint_op_vals), 0, "", HFILL }},
     { &hf_lustre_mdt_rec_setxattr_sx_cap,
       { "Sx Cap", "lustre.mdt_rec_setxattr.sx_cap", FT_UINT32, BASE_DEC, NULL, 0, "", HFILL }},
     { &hf_lustre_mdt_rec_setxattr_sx_fsuid,
index 8008aee..f497574 100644 (file)
@@ -1562,7 +1562,7 @@ typedef enum {
  * Do not exceed 63
  */
 
-typedef enum {
+enum mds_reint_op {
        REINT_SETATTR  = 1,
        REINT_CREATE   = 2,
        REINT_LINK     = 3,
@@ -1573,7 +1573,7 @@ typedef enum {
        REINT_RMENTRY  = 8,
        REINT_MIGRATE  = 9,
         REINT_MAX
-} mds_reint_t, mdt_reint_t;
+};
 
 /* the disposition of the intent outlines what was executed */
 #define DISP_IT_EXECD        0x00000001
index 2000374..2ba6f9a 100644 (file)
@@ -323,7 +323,7 @@ enum {
 #define MDT_EREMOTE_OPEN (EREMOTE + 1024)
 
 struct mdt_reint_record {
-       mdt_reint_t                      rr_opcode;
+       enum mds_reint_op                rr_opcode;
        const struct lustre_handle      *rr_handle;
        const struct lu_fid             *rr_fid1;
        const struct lu_fid             *rr_fid2;