mm: tiny-shmem nommu fix
[linux-2.6.git] / mm / tiny-shmem.c
index d17cb6f6ab1029cdad5ef6a67523be159ff12211..8d7a27a6335c4c6076b38fc2ab990a82081ada5d 100644 (file)
@@ -80,6 +80,12 @@ struct file *shmem_file_setup(char *name, loff_t size, unsigned long flags)
        inode->i_nlink = 0;     /* It is unlinked */
        init_file(file, shm_mnt, dentry, FMODE_WRITE | FMODE_READ,
                        &ramfs_file_operations);
        inode->i_nlink = 0;     /* It is unlinked */
        init_file(file, shm_mnt, dentry, FMODE_WRITE | FMODE_READ,
                        &ramfs_file_operations);
+
+#ifndef CONFIG_MMU
+       error = ramfs_nommu_expand_for_mapping(inode, size);
+       if (error)
+               goto close_file;
+#endif
        return file;
 
 close_file:
        return file;
 
 close_file: