mirror of
https://github.com/andreas-abel/nanoBench.git
synced 2026-01-04 11:30:06 +01:00
compatibility with kernel 4.4
This commit is contained in:
@@ -15,10 +15,17 @@
|
|||||||
#include <linux/namei.h>
|
#include <linux/namei.h>
|
||||||
#include <linux/proc_fs.h>
|
#include <linux/proc_fs.h>
|
||||||
#include <linux/sched.h>
|
#include <linux/sched.h>
|
||||||
#include <linux/set_memory.h>
|
|
||||||
#include <linux/seq_file.h>
|
#include <linux/seq_file.h>
|
||||||
|
#include <linux/version.h>
|
||||||
|
#include <linux/vmalloc.h>
|
||||||
#include <../arch/x86/include/asm/fpu/api.h>
|
#include <../arch/x86/include/asm/fpu/api.h>
|
||||||
|
|
||||||
|
#if LINUX_VERSION_CODE <= KERNEL_VERSION(4,12,0)
|
||||||
|
#include <asm/cacheflush.h>
|
||||||
|
#else
|
||||||
|
#include <linux/set_memory.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "../common/nanoBench.h"
|
#include "../common/nanoBench.h"
|
||||||
|
|
||||||
MODULE_LICENSE("GPL");
|
MODULE_LICENSE("GPL");
|
||||||
@@ -52,7 +59,12 @@ static int read_file_into_buffer(const char *file_name, char **buf, size_t *buf_
|
|||||||
struct path p;
|
struct path p;
|
||||||
struct kstat ks;
|
struct kstat ks;
|
||||||
kern_path(file_name, 0, &p);
|
kern_path(file_name, 0, &p);
|
||||||
if (vfs_getattr(&p, &ks, 0, 0)) {
|
|
||||||
|
#if LINUX_VERSION_CODE <= KERNEL_VERSION(4,11,0)
|
||||||
|
if (vfs_getattr(&p, &ks)) {
|
||||||
|
#else
|
||||||
|
if (vfs_getattr(&p, &ks, 0, 0)) {
|
||||||
|
#endif
|
||||||
pr_debug("Error getting file attributes\n");
|
pr_debug("Error getting file attributes\n");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user