1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
|
--- 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);
}
|