X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=include%2Fwrapper%2Fgenhd.h;h=689803881dbb0f9a950c651d48aa4b9a11e83564;hb=3dfec2289896ff0f1a05a9e486f1585cd16beb84;hp=30fc5cea60ec75a8bb1b0cf38d7e0657d513e1fb;hpb=876e2e9225074dede98488270dee7226e73d2a63;p=lttng-modules.git diff --git a/include/wrapper/genhd.h b/include/wrapper/genhd.h index 30fc5cea..68980388 100644 --- a/include/wrapper/genhd.h +++ b/include/wrapper/genhd.h @@ -32,6 +32,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 +58,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