X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=wrapper%2Fgenhd.h;h=7559faaedd2e3fa52f9a288746e58c859c99262c;hb=93607d62a1d7ff9a1912c2a97626a778ae789084;hp=4eac2c1a14c62ed74a316a98ff4228f4478352da;hpb=3bcb1fb34fc8904413476afd87afbdeab3806e56;p=lttng-modules.git diff --git a/wrapper/genhd.h b/wrapper/genhd.h index 4eac2c1a..7559faae 100644 --- a/wrapper/genhd.h +++ b/wrapper/genhd.h @@ -14,6 +14,12 @@ #include +#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,17,0)) +#define LTTNG_GENHD_FL_HIDDEN GENHD_FL_HIDDEN +#else +#define LTTNG_GENHD_FL_HIDDEN GENHD_FL_SUPPRESS_PARTITION_INFO +#endif + #ifdef CONFIG_KALLSYMS_ALL #include @@ -32,6 +38,19 @@ struct class *wrapper_get_block_class(void) return ptr_block_class; } +/* + * Canary function to check for 'block_class' at compile time. + * + * From 'include/linux/genhd.h': + * + * extern struct class block_class; + */ +static inline +struct class *__canary__get_block_class(void) +{ + return &block_class; +} + static inline struct device_type *wrapper_get_disk_type(void) { @@ -45,6 +64,16 @@ struct device_type *wrapper_get_disk_type(void) return ptr_disk_type; } +/* + * No canary for 'disk_type', it's only defined in 'block/genhd.c'. + * + * static inline + * struct device_type *__canary__get_disk_type(void) + * { + * return &disk_type; + * } + */ + #else static inline