diff options
author | Len Brown <len.brown@intel.com> | 2010-08-15 01:06:31 -0400 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2010-08-15 01:06:31 -0400 |
commit | 95ee46aa8698f2000647dfb362400fadbb5807cf (patch) | |
tree | e5a05c7297f997e191c73091934e42e3195c0e40 /fs/udf/file.c | |
parent | cfa806f059801dbe7e435745eb2e187c8bfe1e7f (diff) | |
parent | 92fa5bd9a946b6e7aab6764e7312e4e3d9bed295 (diff) |
Merge branch 'linus' into release
Conflicts:
drivers/acpi/debug.c
Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'fs/udf/file.c')
-rw-r--r-- | fs/udf/file.c | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/fs/udf/file.c b/fs/udf/file.c index 94e06d6bddbd..66b9e7e7e4c5 100644 --- a/fs/udf/file.c +++ b/fs/udf/file.c | |||
@@ -36,7 +36,6 @@ | |||
36 | #include <linux/pagemap.h> | 36 | #include <linux/pagemap.h> |
37 | #include <linux/buffer_head.h> | 37 | #include <linux/buffer_head.h> |
38 | #include <linux/aio.h> | 38 | #include <linux/aio.h> |
39 | #include <linux/smp_lock.h> | ||
40 | 39 | ||
41 | #include "udf_i.h" | 40 | #include "udf_i.h" |
42 | #include "udf_sb.h" | 41 | #include "udf_sb.h" |
@@ -228,6 +227,28 @@ const struct file_operations udf_file_operations = { | |||
228 | .llseek = generic_file_llseek, | 227 | .llseek = generic_file_llseek, |
229 | }; | 228 | }; |
230 | 229 | ||
230 | static int udf_setattr(struct dentry *dentry, struct iattr *attr) | ||
231 | { | ||
232 | struct inode *inode = dentry->d_inode; | ||
233 | int error; | ||
234 | |||
235 | error = inode_change_ok(inode, attr); | ||
236 | if (error) | ||
237 | return error; | ||
238 | |||
239 | if ((attr->ia_valid & ATTR_SIZE) && | ||
240 | attr->ia_size != i_size_read(inode)) { | ||
241 | error = vmtruncate(inode, attr->ia_size); | ||
242 | if (error) | ||
243 | return error; | ||
244 | } | ||
245 | |||
246 | setattr_copy(inode, attr); | ||
247 | mark_inode_dirty(inode); | ||
248 | return 0; | ||
249 | } | ||
250 | |||
231 | const struct inode_operations udf_file_inode_operations = { | 251 | const struct inode_operations udf_file_inode_operations = { |
252 | .setattr = udf_setattr, | ||
232 | .truncate = udf_truncate, | 253 | .truncate = udf_truncate, |
233 | }; | 254 | }; |