diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-09-24 11:32:11 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-09-24 11:32:11 -0400 |
commit | 6c5daf012c9155aafd2c7973e4278766c30dfad0 (patch) | |
tree | 33959d7b36d03e1610615641a2940cb2de5e8603 /mm/nommu.c | |
parent | 6d39b27f0ac7e805ae3bd9efa51d7da04bec0360 (diff) | |
parent | c08d3b0e33edce28e9cfa7b64f7fe5bdeeb29248 (diff) |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6:
truncate: use new helpers
truncate: new helpers
fs: fix overflow in sys_mount() for in-kernel calls
fs: Make unload_nls() NULL pointer safe
freeze_bdev: grab active reference to frozen superblocks
freeze_bdev: kill bd_mount_sem
exofs: remove BKL from super operations
fs/romfs: correct error-handling code
vfs: seq_file: add helpers for data filling
vfs: remove redundant position check in do_sendfile
vfs: change sb->s_maxbytes to a loff_t
vfs: explicitly cast s_maxbytes in fiemap_check_ranges
libfs: return error code on failed attr set
seq_file: return a negative error code when seq_path_root() fails.
vfs: optimize touch_time() too
vfs: optimization for touch_atime()
vfs: split generic_forget_inode() so that hugetlbfs does not have to copy it
fs/inode.c: add dev-id and inode number for debugging in init_special_inode()
libfs: make simple_read_from_buffer conventional
Diffstat (limited to 'mm/nommu.c')
-rw-r--r-- | mm/nommu.c | 40 |
1 files changed, 0 insertions, 40 deletions
diff --git a/mm/nommu.c b/mm/nommu.c index 8d484241d034..56a446f05971 100644 --- a/mm/nommu.c +++ b/mm/nommu.c | |||
@@ -83,46 +83,6 @@ struct vm_operations_struct generic_file_vm_ops = { | |||
83 | }; | 83 | }; |
84 | 84 | ||
85 | /* | 85 | /* |
86 | * Handle all mappings that got truncated by a "truncate()" | ||
87 | * system call. | ||
88 | * | ||
89 | * NOTE! We have to be ready to update the memory sharing | ||
90 | * between the file and the memory map for a potential last | ||
91 | * incomplete page. Ugly, but necessary. | ||
92 | */ | ||
93 | int vmtruncate(struct inode *inode, loff_t offset) | ||
94 | { | ||
95 | struct address_space *mapping = inode->i_mapping; | ||
96 | unsigned long limit; | ||
97 | |||
98 | if (inode->i_size < offset) | ||
99 | goto do_expand; | ||
100 | i_size_write(inode, offset); | ||
101 | |||
102 | truncate_inode_pages(mapping, offset); | ||
103 | goto out_truncate; | ||
104 | |||
105 | do_expand: | ||
106 | limit = current->signal->rlim[RLIMIT_FSIZE].rlim_cur; | ||
107 | if (limit != RLIM_INFINITY && offset > limit) | ||
108 | goto out_sig; | ||
109 | if (offset > inode->i_sb->s_maxbytes) | ||
110 | goto out; | ||
111 | i_size_write(inode, offset); | ||
112 | |||
113 | out_truncate: | ||
114 | if (inode->i_op->truncate) | ||
115 | inode->i_op->truncate(inode); | ||
116 | return 0; | ||
117 | out_sig: | ||
118 | send_sig(SIGXFSZ, current, 0); | ||
119 | out: | ||
120 | return -EFBIG; | ||
121 | } | ||
122 | |||
123 | EXPORT_SYMBOL(vmtruncate); | ||
124 | |||
125 | /* | ||
126 | * Return the total memory allocated for this pointer, not | 86 | * Return the total memory allocated for this pointer, not |
127 | * just what the caller asked for. | 87 | * just what the caller asked for. |
128 | * | 88 | * |