瀏覽代碼

mconsole: switch to kernel_read

Instead of playing with address limits.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Christoph Hellwig 8 年之前
父節點
當前提交
21cb2559eb
共有 1 個文件被更改,包括 1 次插入6 次删除
  1. 1 6
      arch/um/drivers/mconsole_kern.c

+ 1 - 6
arch/um/drivers/mconsole_kern.c

@@ -148,12 +148,7 @@ void mconsole_proc(struct mc_request *req)
 	}
 	}
 
 
 	do {
 	do {
-		loff_t pos = file->f_pos;
-		mm_segment_t old_fs = get_fs();
-		set_fs(KERNEL_DS);
-		len = vfs_read(file, buf, PAGE_SIZE - 1, &pos);
-		set_fs(old_fs);
-		file->f_pos = pos;
+		len = kernel_read(file, buf, PAGE_SIZE - 1, &file->f_pos);
 		if (len < 0) {
 		if (len < 0) {
 			mconsole_reply(req, "Read of file failed", 1, 0);
 			mconsole_reply(req, "Read of file failed", 1, 0);
 			goto out_free;
 			goto out_free;