|
|
@@ -2204,7 +2204,9 @@ static int isFileReadable(const char *path, u32 *sz)
|
|
|
{
|
|
|
struct file *fp;
|
|
|
int ret = 0;
|
|
|
+ #if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 18, 0))
|
|
|
mm_segment_t oldfs;
|
|
|
+ #endif
|
|
|
char buf;
|
|
|
|
|
|
fp = filp_open(path, O_RDONLY, 0);
|
|
|
@@ -2249,7 +2251,9 @@ static int isFileReadable(const char *path, u32 *sz)
|
|
|
static int retriveFromFile(const char *path, u8 *buf, u32 sz)
|
|
|
{
|
|
|
int ret = -1;
|
|
|
+ #if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 18, 0))
|
|
|
mm_segment_t oldfs;
|
|
|
+ #endif
|
|
|
struct file *fp;
|
|
|
|
|
|
if (path && buf) {
|
|
|
@@ -2267,7 +2271,7 @@ static int retriveFromFile(const char *path, u8 *buf, u32 sz)
|
|
|
#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 10, 0))
|
|
|
set_fs(oldfs);
|
|
|
#elif (LINUX_VERSION_CODE < KERNEL_VERSION(5, 18, 0))
|
|
|
- force_uaccess_end(oldfs);
|
|
|
+ force_uaccess_end(oldfs);
|
|
|
#endif
|
|
|
closeFile(fp);
|
|
|
|
|
|
@@ -2292,7 +2296,9 @@ static int retriveFromFile(const char *path, u8 *buf, u32 sz)
|
|
|
static int storeToFile(const char *path, u8 *buf, u32 sz)
|
|
|
{
|
|
|
int ret = 0;
|
|
|
+ #if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 18, 0))
|
|
|
mm_segment_t oldfs;
|
|
|
+ #endif
|
|
|
struct file *fp;
|
|
|
|
|
|
if (path && buf) {
|