openwrtv4/package/kernel/mwlwifi/patches/001-remove-vfs_write.patch

41 lines
1 KiB
Diff
Raw Normal View History

--- a/debugfs.c
+++ b/debugfs.c
@@ -87,7 +87,6 @@ static void core_dump_file(u8 *valbuf, u
u32 append, u32 totallen, bool textmode)
{
struct file *filp_core = NULL;
- mm_segment_t oldfs;
char file_name[40];
u8 *buf = kmalloc(length * 3, GFP_KERNEL);
u8 *data_p = buf;
@@ -100,9 +99,6 @@ static void core_dump_file(u8 *valbuf, u
sprintf(file_name, "/dev/shm/coredump-%x-%x",
region, (region + totallen));
- oldfs = get_fs();
- set_fs(KERNEL_DS);
-
if (append)
filp_core = filp_open(file_name, O_RDWR | O_APPEND, 0);
else
@@ -125,15 +121,15 @@ static void core_dump_file(u8 *valbuf, u
}
data_p = buf + j;
data_p += sprintf(data_p, "\n");
- vfs_write(filp_core, buf, strlen(buf),
- &filp_core->f_pos);
+ kernel_write(filp_core, buf, strlen(buf),
+ &filp_core->f_pos);
} else
- vfs_write(filp_core, valbuf, length, &filp_core->f_pos);
+ kernel_write(filp_core, valbuf, length,
+ &filp_core->f_pos);
filp_close(filp_core, current->files);
}
- set_fs(oldfs);
kfree(buf);
}