From: Andreas Dilger Date: Fri, 27 Mar 2020 08:08:26 +0000 (-0600) Subject: LU-11986 libcfs: provide QSTR_INIT compat macro X-Git-Tag: 2.12.5-RC1~53 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=fd50d435119f0993ee05a4653315e1a55627817b;p=fs%2Flustre-release.git LU-11986 libcfs: provide QSTR_INIT compat macro Provide a compat macro for QSTR_INIT() for older kernels. Fixes: 9d42660e173e ("LU-11986 lnet: properly cleanup lnet debugfs files") Test-Parameters: trivial Signed-off-by: Andreas Dilger Change-Id: Ice19a4dad8456551ba398034a8d3942068006512 Reviewed-on: https://review.whamcloud.com/38090 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Serguei Smirnov Reviewed-by: Oleg Drokin --- diff --git a/libcfs/include/libcfs/linux/linux-fs.h b/libcfs/include/libcfs/linux/linux-fs.h index 32ef1e0..ce36011 100644 --- a/libcfs/include/libcfs/linux/linux-fs.h +++ b/libcfs/include/libcfs/linux/linux-fs.h @@ -50,6 +50,10 @@ static inline struct dentry *file_dentry(const struct file *file) } #endif +#ifndef QSTR_INIT +#define QSTR_INIT(n, l) { .len = l, .name = n } +#endif + #if defined(HAVE_FILE_FSYNC_4ARGS) || defined(HAVE_FILE_FSYNC_2ARGS) #define ll_vfs_fsync_range(fp, start, end, datasync) \ vfs_fsync_range(fp, start, end, datasync) diff --git a/libcfs/libcfs/module.c b/libcfs/libcfs/module.c index 882b177..44e949e 100644 --- a/libcfs/libcfs/module.c +++ b/libcfs/libcfs/module.c @@ -53,6 +53,7 @@ #include #include +#include #include #include "tracefile.h"