]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - fs/ext4/file.c
Merge git://git.kernel.org/pub/scm/linux/kernel/git/bart/ide-2.6
[linux-2.6-omap-h63xx.git] / fs / ext4 / file.c
index 4159be6366ab8c7fb39493827765544d818b0ecc..430eb7978db4c92f0503b92895a59000d8f97b3e 100644 (file)
@@ -123,6 +123,23 @@ force_commit:
        return ret;
 }
 
+static struct vm_operations_struct ext4_file_vm_ops = {
+       .fault          = filemap_fault,
+       .page_mkwrite   = ext4_page_mkwrite,
+};
+
+static int ext4_file_mmap(struct file *file, struct vm_area_struct *vma)
+{
+       struct address_space *mapping = file->f_mapping;
+
+       if (!mapping->a_ops->readpage)
+               return -ENOEXEC;
+       file_accessed(file);
+       vma->vm_ops = &ext4_file_vm_ops;
+       vma->vm_flags |= VM_CAN_NONLINEAR;
+       return 0;
+}
+
 const struct file_operations ext4_file_operations = {
        .llseek         = generic_file_llseek,
        .read           = do_sync_read,
@@ -133,7 +150,7 @@ const struct file_operations ext4_file_operations = {
 #ifdef CONFIG_COMPAT
        .compat_ioctl   = ext4_compat_ioctl,
 #endif
-       .mmap           = generic_file_mmap,
+       .mmap           = ext4_file_mmap,
        .open           = generic_file_open,
        .release        = ext4_release_file,
        .fsync          = ext4_sync_file,
@@ -144,6 +161,7 @@ const struct file_operations ext4_file_operations = {
 const struct inode_operations ext4_file_inode_operations = {
        .truncate       = ext4_truncate,
        .setattr        = ext4_setattr,
+       .getattr        = ext4_getattr,
 #ifdef CONFIG_EXT4DEV_FS_XATTR
        .setxattr       = generic_setxattr,
        .getxattr       = generic_getxattr,