Linux Headquarters
[ Register ]
[ About us ] [ Home Page ]

Advertisement
[ Kernel ] [ Documentation ] [ Links ] [ Books ]

Advertisement

Kernel v2.4.13-pre2 /mm/filemap.c

Filename:/mm/filemap.c
Lines Added:7
Lines Deleted:9
Also changed in: (Previous) 2.4.13-pre1  2.4.12-ac1  2.4.11  2.4.11-pre6  2.4.11-pre5  2.4.11-pre4 
(Following) 2.4.13-pre3  2.4.13-pre4  2.4.13-pre5  2.4.13-pre6  2.4.13  2.4.13-ac1 

Location
[  2.4.13-pre2
  [  mm
     o  filemap.c

Patch

diff -u --recursive --new-file v2.4.12/linux/mm/filemap.c linux/mm/filemap.c
--- v2.4.12/linux/mm/filemap.c   Tue Oct  9 17:06:53 2001
+++ linux/mm/filemap.c   Thu Oct 11 08:02:06 2001
@@ -667,8 +667,7 @@
 static int FASTCALL(page_cache_read(struct file * file, unsigned long offset));
 static int page_cache_read(struct file * file, unsigned long offset)
 {
-   struct inode *inode = file->f_dentry->d_inode;
-   struct address_space *mapping = inode->i_mapping;
+   struct address_space *mapping = file->f_dentry->d_inode->i_mapping;
    struct page **hash = page_hash(mapping, offset);
    struct page *page; 
 
@@ -1589,8 +1588,8 @@
 {
    int error;
    struct file *file = area->vm_file;
-   struct inode *inode = file->f_dentry->d_inode;
-   struct address_space *mapping = inode->i_mapping;
+   struct address_space *mapping = file->f_dentry->d_inode->i_mapping;
+   struct inode *inode = mapping->host;
    struct page *page, **hash, *old_page;
    unsigned long size, pgoff;
 
@@ -1851,15 +1850,14 @@
 
 int generic_file_mmap(struct file * file, struct vm_area_struct * vma)
 {
-   struct inode *inode = file->f_dentry->d_inode;
+   struct address_space *mapping = file->f_dentry->d_inode->i_mapping;
+   struct inode *inode = mapping->host;
 
    if ((vma->vm_flags & VM_SHARED) && (vma->vm_flags & VM_MAYWRITE)) {
-      if (!inode->i_mapping->a_ops->writepage)
+      if (!mapping->a_ops->writepage)
          return -EINVAL;
    }
-   if (!inode->i_sb || !S_ISREG(inode->i_mode))
-      return -EACCES;
-   if (!inode->i_mapping->a_ops->readpage)
+   if (!mapping->a_ops->readpage)
       return -ENOEXEC;
    UPDATE_ATIME(inode);
    vma->vm_ops = &generic_file_vm_ops;


Comments: webmaster (at) linuxhq.com.
Advertising: banners (at) linuxhq.com.
Compilation ©1998-2008 Linux Headquarters, Inc.