summaryrefslogtreecommitdiffstats
path: root/fs/fat
diff options
context:
space:
mode:
Diffstat (limited to 'fs/fat')
-rw-r--r--fs/fat/file.c13
-rw-r--r--fs/fat/mmap.c2
2 files changed, 13 insertions, 2 deletions
diff --git a/fs/fat/file.c b/fs/fat/file.c
index f3a4f6cec..c1357f784 100644
--- a/fs/fat/file.c
+++ b/fs/fat/file.c
@@ -155,7 +155,7 @@ static void fat_prefetch (
/*
Read a file into user space
*/
-ssize_t fat_file_read(
+static ssize_t fat_file_read_text(
struct file *filp,
char *buf,
size_t count,
@@ -270,6 +270,17 @@ ssize_t fat_file_read(
return buf-start;
}
+ssize_t fat_file_read(
+ struct file *filp,
+ char *buf,
+ size_t count,
+ loff_t *ppos)
+{
+ struct inode *inode = filp->f_dentry->d_inode;
+ if (!MSDOS_I(inode)->i_binary)
+ return fat_file_read_text(filp, buf, count, ppos);
+ return generic_file_read(filp, buf, count, ppos);
+}
/*
Write to a file either from user space
*/
diff --git a/fs/fat/mmap.c b/fs/fat/mmap.c
index 545874a04..48cbc7b4f 100644
--- a/fs/fat/mmap.c
+++ b/fs/fat/mmap.c
@@ -60,7 +60,7 @@ static unsigned long fat_file_mmap_nopage(
filp.f_pos = pos;
need_read = PAGE_SIZE - clear;
{
- unsigned long cur_fs = get_fs();
+ mm_segment_t cur_fs = get_fs();
set_fs (KERNEL_DS);
cur_read = fat_file_read (&filp, (char*)page,
need_read, &filp.f_pos);