X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lustre%2Finclude%2Fobd_cksum.h;h=53ca52d0b0fd7020b0fa67b01a04a39dc9bb2448;hb=6712478e79588e73e28c7ccac3afc7ac2368a4f3;hp=549e4464c6b29ed145e396db3112b8c9bb036c38;hpb=72057a3af19ee02d9a686bd7e7d074917e381310;p=fs%2Flustre-release.git diff --git a/lustre/include/obd_cksum.h b/lustre/include/obd_cksum.h index 549e446..53ca52d 100644 --- a/lustre/include/obd_cksum.h +++ b/lustre/include/obd_cksum.h @@ -34,9 +34,9 @@ #define __OBD_CKSUM #include #include -#include +#include -static inline unsigned char cksum_obd2cfs(cksum_type_t cksum_type) +static inline unsigned char cksum_obd2cfs(enum cksum_types cksum_type) { switch (cksum_type) { case OBD_CKSUM_CRC32: @@ -63,7 +63,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_types cksum_type) { unsigned int performance = 0, tmp; u32 flag = OBD_FL_CKSUM_ADLER; @@ -97,7 +97,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_types cksum_type_unpack(u32 o_flags) { switch (o_flags & OBD_FL_CKSUM_ALL) { case OBD_FL_CKSUM_CRC32C: @@ -115,9 +115,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_types cksum_types_supported_client(void) { - cksum_type_t ret = OBD_CKSUM_ADLER; + enum cksum_types 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)), @@ -133,10 +133,10 @@ static inline cksum_type_t cksum_types_supported_client(void) } /* Server uses algos that perform at 50% or better of the Adler */ -static inline cksum_type_t cksum_types_supported_server(void) +static inline enum cksum_types cksum_types_supported_server(void) { - int base_speed; - cksum_type_t ret = OBD_CKSUM_ADLER; + enum cksum_types ret = OBD_CKSUM_ADLER; + int base_speed; CDEBUG(D_INFO, "Crypto hash speed: crc %d, crc32c %d, adler %d\n", cfs_crypto_hash_speed(cksum_obd2cfs(OBD_CKSUM_CRC32)), @@ -163,7 +163,7 @@ static inline cksum_type_t cksum_types_supported_server(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_types cksum_type_select(enum cksum_types cksum_types) { return cksum_type_unpack(cksum_type_pack(cksum_types)); }