staging/lustre: Get rid of cksum_type_t typedef
authorOleg Drokin <green@linuxhacker.ru>
Thu, 25 Feb 2016 02:59:48 +0000 (21:59 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 26 Feb 2016 06:05:50 +0000 (22:05 -0800)
Replace it with enum cksum_type

Signed-off-by: Oleg Drokin <green@linuxhacker.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
drivers/staging/lustre/lustre/include/obd.h
drivers/staging/lustre/lustre/include/obd_cksum.h
drivers/staging/lustre/lustre/osc/osc_request.c

index 0e3bac6f44183f5b84bbcc9302d871eb75799e58..0f37b615b2463d75ac21f42ab893d3e43659c544 100644 (file)
@@ -1408,11 +1408,11 @@ void lustre_swab_connect(struct obd_connect_data *ocd);
  * Please update DECLARE_CKSUM_NAME/OBD_CKSUM_ALL in obd.h when adding a new
  * algorithm and also the OBD_FL_CKSUM* flags.
  */
-typedef enum {
+enum cksum_type {
        OBD_CKSUM_CRC32  = 0x00000001,
        OBD_CKSUM_ADLER  = 0x00000002,
        OBD_CKSUM_CRC32C = 0x00000004,
-} cksum_type_t;
+};
 
 /*
  *   OST requests: OBDO & OBD request records
index d6e5a177105d8ff1e929ff5a408b55db0ed4f494..09f1a5b791168329f524c17996b703d82cd19615 100644 (file)
@@ -339,7 +339,7 @@ struct client_obd {
        /* supported checksum types that are worked out at connect time */
        __u32               cl_supp_cksum_types;
        /* checksum algorithm to be used */
-       cksum_type_t         cl_cksum_type;
+       enum cksum_type      cl_cksum_type;
 
        /* also protected by the poorly named _loi_list_lock lock above */
        struct osc_async_rc      cl_ar;
index 01db604053939c4af563e6da81d8c6e8188ce7f9..d61b4db8196c5905a0007a75c626db39868e8aa0 100644 (file)
@@ -37,7 +37,7 @@
 #include "../../include/linux/libcfs/libcfs.h"
 #include "lustre/lustre_idl.h"
 
-static inline unsigned char cksum_obd2cfs(cksum_type_t cksum_type)
+static inline unsigned char cksum_obd2cfs(enum cksum_type cksum_type)
 {
        switch (cksum_type) {
        case OBD_CKSUM_CRC32:
@@ -64,7 +64,7 @@ static inline unsigned char cksum_obd2cfs(cksum_type_t cksum_type)
  * because that is supported by all clients since 1.8
  *
  * In case multiple algorithms are supported the best one is used. */
-static inline u32 cksum_type_pack(cksum_type_t cksum_type)
+static inline u32 cksum_type_pack(enum cksum_type cksum_type)
 {
        unsigned int    performance = 0, tmp;
        u32             flag = OBD_FL_CKSUM_ADLER;
@@ -98,7 +98,7 @@ static inline u32 cksum_type_pack(cksum_type_t cksum_type)
        return flag;
 }
 
-static inline cksum_type_t cksum_type_unpack(u32 o_flags)
+static inline enum cksum_type cksum_type_unpack(u32 o_flags)
 {
        switch (o_flags & OBD_FL_CKSUM_ALL) {
        case OBD_FL_CKSUM_CRC32C:
@@ -116,9 +116,9 @@ static inline cksum_type_t cksum_type_unpack(u32 o_flags)
  * 1.8 supported ADLER it is base and not depend on hw
  * Client uses all available local algos
  */
-static inline cksum_type_t cksum_types_supported_client(void)
+static inline enum cksum_type cksum_types_supported_client(void)
 {
-       cksum_type_t ret = OBD_CKSUM_ADLER;
+       enum cksum_type ret = OBD_CKSUM_ADLER;
 
        CDEBUG(D_INFO, "Crypto hash speed: crc %d, crc32c %d, adler %d\n",
               cfs_crypto_hash_speed(cksum_obd2cfs(OBD_CKSUM_CRC32)),
@@ -140,7 +140,7 @@ static inline cksum_type_t cksum_types_supported_client(void)
  * checksum type due to its benchmarking at libcfs module load.
  * Caution is advised, however, since what is fastest on a single client may
  * not be the fastest or most efficient algorithm on the server.  */
-static inline cksum_type_t cksum_type_select(cksum_type_t cksum_types)
+static inline enum cksum_type cksum_type_select(enum cksum_type cksum_types)
 {
        return cksum_type_unpack(cksum_type_pack(cksum_types));
 }
index 43b11c61c2f08ce26662b29cb69e7c30a6e6130d..cb9587f10ae9001ec0f945711c948d2ab73f5a62 100644 (file)
@@ -1151,7 +1151,7 @@ static inline int can_merge_pages(struct brw_page *p1, struct brw_page *p2)
 
 static u32 osc_checksum_bulk(int nob, u32 pg_count,
                             struct brw_page **pga, int opc,
-                            cksum_type_t cksum_type)
+                            enum cksum_type cksum_type)
 {
        __u32 cksum;
        int i = 0;
@@ -1355,7 +1355,7 @@ static int osc_brw_prep_request(int cmd, struct client_obd *cli,
                    !sptlrpc_flavor_has_bulk(&req->rq_flvr)) {
                        /* store cl_cksum_type in a local variable since
                         * it can be changed via lprocfs */
-                       cksum_type_t cksum_type = cli->cl_cksum_type;
+                       enum cksum_type cksum_type = cli->cl_cksum_type;
 
                        if ((body->oa.o_valid & OBD_MD_FLFLAGS) == 0) {
                                oa->o_flags &= OBD_FL_LOCAL_MASK;
@@ -1414,11 +1414,11 @@ static int osc_brw_prep_request(int cmd, struct client_obd *cli,
 static int check_write_checksum(struct obdo *oa, const lnet_process_id_t *peer,
                                __u32 client_cksum, __u32 server_cksum, int nob,
                                u32 page_count, struct brw_page **pga,
-                               cksum_type_t client_cksum_type)
+                               enum cksum_type client_cksum_type)
 {
        __u32 new_cksum;
        char *msg;
-       cksum_type_t cksum_type;
+       enum cksum_type cksum_type;
 
        if (server_cksum == client_cksum) {
                CDEBUG(D_PAGE, "checksum %x confirmed\n", client_cksum);
@@ -1549,7 +1549,7 @@ static int osc_brw_fini_request(struct ptlrpc_request *req, int rc)
                __u32 server_cksum = body->oa.o_cksum;
                char *via = "";
                char *router = "";
-               cksum_type_t cksum_type;
+               enum cksum_type cksum_type;
 
                cksum_type = cksum_type_unpack(body->oa.o_valid&OBD_MD_FLFLAGS ?
                                               body->oa.o_flags : 0);
This page took 0.0292 seconds and 5 git commands to generate.