summaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>1997-12-01 04:02:08 +0000
committerRalf Baechle <ralf@linux-mips.org>1997-12-01 04:02:08 +0000
commitfd095d09f2d475dc2e8599b1b8bae1cd65e91685 (patch)
tree217f87a997699505e0dd752931409b9f10fffe65 /mm
parentc02e0599c4233f97071928f8118841954bacdadf (diff)
Merge with 2.1.56 as first part of merging back my code.
Diffstat (limited to 'mm')
-rw-r--r--mm/filemap.c19
-rw-r--r--mm/mmap.c2
2 files changed, 14 insertions, 7 deletions
diff --git a/mm/filemap.c b/mm/filemap.c
index e6e4cd424..c02a31696 100644
--- a/mm/filemap.c
+++ b/mm/filemap.c
@@ -1175,9 +1175,11 @@ static struct vm_operations_struct file_private_mmap = {
};
/* This is used for a general mmap of a disk file */
-int generic_file_mmap(struct inode * inode, struct file * file, struct vm_area_struct * vma)
+
+int generic_file_mmap(struct file * file, struct vm_area_struct * vma)
{
struct vm_operations_struct * ops;
+ struct inode *inode = file->f_dentry->d_inode;
if ((vma->vm_flags & VM_SHARED) && (vma->vm_flags & VM_MAYWRITE)) {
ops = &file_shared_mmap;
@@ -1213,11 +1215,16 @@ static int msync_interval(struct vm_area_struct * vma,
if (vma->vm_ops->sync) {
int error;
error = vma->vm_ops->sync(vma, start, end-start, flags);
- if (error)
- return error;
- if (flags & MS_SYNC)
- return file_fsync(vma->vm_dentry->d_inode, NULL);
- return 0;
+ if (!error && (flags & MS_SYNC)) {
+ struct dentry * dentry = vma->vm_dentry;
+ if (dentry) {
+ struct inode * inode = dentry->d_inode;
+ down(&inode->i_sem);
+ error = file_fsync(NULL,dentry);
+ up(&inode->i_sem);
+ }
+ }
+ return error;
}
return 0;
}
diff --git a/mm/mmap.c b/mm/mmap.c
index 212fc5150..10481ef95 100644
--- a/mm/mmap.c
+++ b/mm/mmap.c
@@ -296,7 +296,7 @@ unsigned long do_mmap(struct file * file, unsigned long addr, unsigned long len,
}
}
if (!error)
- error = file->f_op->mmap(file->f_dentry->d_inode, file, vma);
+ error = file->f_op->mmap(file, vma);
if (error) {
if (correct_wcount)