mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-17 20:25:19 +00:00
new helper: read_code()
switch binfmts that use ->read() to that (and to kernel_read() in several cases in binfmt_flat - sure, it's nommu, but still, doing ->read() into kmalloc'ed buffer...) Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
parent
3af0761307
commit
3dc20cb282
6 changed files with 42 additions and 67 deletions
|
@ -802,6 +802,15 @@ int kernel_read(struct file *file, loff_t offset,
|
|||
|
||||
EXPORT_SYMBOL(kernel_read);
|
||||
|
||||
ssize_t read_code(struct file *file, unsigned long addr, loff_t pos, size_t len)
|
||||
{
|
||||
ssize_t res = file->f_op->read(file, (void __user *)addr, len, &pos);
|
||||
if (res > 0)
|
||||
flush_icache_range(addr, addr + len);
|
||||
return res;
|
||||
}
|
||||
EXPORT_SYMBOL(read_code);
|
||||
|
||||
static int exec_mmap(struct mm_struct *mm)
|
||||
{
|
||||
struct task_struct *tsk;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue