X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=blobdiff_plain;f=lustre%2Finclude%2Fobd_cksum.h;h=15353a3fb4241c7d105e445e84d3927c5c121614;hp=6e807d762c354cb60fa41c2b358d32555ad9d496;hb=c438fba7f068b0713d96dce1f0183ec6da7ab000;hpb=e0fb3133372e5bff434ac7a467304d9ba954bac6 diff --git a/lustre/include/obd_cksum.h b/lustre/include/obd_cksum.h index 6e807d7..15353a3 100644 --- a/lustre/include/obd_cksum.h +++ b/lustre/include/obd_cksum.h @@ -112,10 +112,17 @@ enum cksum_types obd_cksum_types_supported_server(const char *obd_name); * 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 enum cksum_types -obd_cksum_type_select(const char *obd_name, enum cksum_types cksum_types) +static inline +enum cksum_types obd_cksum_type_select(const char *obd_name, + enum cksum_types cksum_types, + enum cksum_types preferred) { - u32 flag = obd_cksum_type_pack(obd_name, cksum_types); + u32 flag; + + if (preferred & cksum_types) + return preferred; + + flag = obd_cksum_type_pack(obd_name, cksum_types); return obd_cksum_type_unpack(flag); }