git.openpandora.org
/
pandora-kernel.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
hugetlbfs: handle pages higher order than MAX_ORDER
[pandora-kernel.git]
/
mm
/
tiny-shmem.c
diff --git
a/mm/tiny-shmem.c
b/mm/tiny-shmem.c
index
7020836
..
8d7a27a
100644
(file)
--- a/
mm/tiny-shmem.c
+++ b/
mm/tiny-shmem.c
@@
-39,12
+39,11
@@
static int __init init_tmpfs(void)
}
module_init(init_tmpfs)
}
module_init(init_tmpfs)
-/*
+/*
*
* shmem_file_setup - get an unlinked file living in tmpfs
* shmem_file_setup - get an unlinked file living in tmpfs
- *
* @name: name for dentry (to be seen in /proc/<pid>/maps
* @size: size to be set for the file
* @name: name for dentry (to be seen in /proc/<pid>/maps
* @size: size to be set for the file
- *
+ *
@flags: vm_flags
*/
struct file *shmem_file_setup(char *name, loff_t size, unsigned long flags)
{
*/
struct file *shmem_file_setup(char *name, loff_t size, unsigned long flags)
{
@@
-66,25
+65,27
@@
struct file *shmem_file_setup(char *name, loff_t size, unsigned long flags)
if (!dentry)
goto put_memory;
if (!dentry)
goto put_memory;
+ error = -ENFILE;
+ file = get_empty_filp();
+ if (!file)
+ goto put_dentry;
+
error = -ENOSPC;
inode = ramfs_get_inode(root->d_sb, S_IFREG | S_IRWXUGO, 0);
if (!inode)
error = -ENOSPC;
inode = ramfs_get_inode(root->d_sb, S_IFREG | S_IRWXUGO, 0);
if (!inode)
- goto
put_dentry
;
+ goto
close_file
;
d_instantiate(dentry, inode);
d_instantiate(dentry, inode);
- error = -ENFILE;
- file = alloc_file(shm_mnt, dentry, FMODE_WRITE | FMODE_READ,
- &ramfs_file_operations);
- if (!file)
- goto put_dentry;
-
+ inode->i_size = size;
inode->i_nlink = 0; /* It is unlinked */
inode->i_nlink = 0; /* It is unlinked */
+ init_file(file, shm_mnt, dentry, FMODE_WRITE | FMODE_READ,
+ &ramfs_file_operations);
- /* notify everyone as to the change of file size */
- error =
do_truncate(dentry, size, 0, fil
e);
- if (error
< 0
)
+#ifndef CONFIG_MMU
+ error =
ramfs_nommu_expand_for_mapping(inode, siz
e);
+ if (error)
goto close_file;
goto close_file;
-
+#endif
return file;
close_file:
return file;
close_file:
@@
-95,9
+96,8
@@
put_memory:
return ERR_PTR(error);
}
return ERR_PTR(error);
}
-/*
+/*
*
* shmem_zero_setup - setup a shared anonymous mapping
* shmem_zero_setup - setup a shared anonymous mapping
- *
* @vma: the vma to be mmapped is prepared by do_mmap_pgoff
*/
int shmem_zero_setup(struct vm_area_struct *vma)
* @vma: the vma to be mmapped is prepared by do_mmap_pgoff
*/
int shmem_zero_setup(struct vm_area_struct *vma)