diff options
| author | Ingo Molnar <mingo@elte.hu> | 2010-08-12 15:38:56 -0400 |
|---|---|---|
| committer | Ingo Molnar <mingo@elte.hu> | 2010-08-12 15:39:04 -0400 |
| commit | f46a6804135795f77d096ab0128f27531c7d051c (patch) | |
| tree | 7cd33f69e3661327739ae4c96e5a8389e7fc912e /fs/sysv/file.c | |
| parent | b3e84ffa21f916e3354a12a7f19169c9febe96d0 (diff) | |
| parent | ad41a1e0cab07c5125456e8d38e5b1ab148d04aa (diff) | |
Merge branch 'linus' into perf/urgent
Merge reason: Fix upstream breakage introduced by:
de5d9bf: Move list types from <linux/list.h> to <linux/types.h>.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'fs/sysv/file.c')
| -rw-r--r-- | fs/sysv/file.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/fs/sysv/file.c b/fs/sysv/file.c index 750cc22349bd..0a65939508e9 100644 --- a/fs/sysv/file.c +++ b/fs/sysv/file.c | |||
| @@ -30,7 +30,29 @@ const struct file_operations sysv_file_operations = { | |||
| 30 | .splice_read = generic_file_splice_read, | 30 | .splice_read = generic_file_splice_read, |
| 31 | }; | 31 | }; |
| 32 | 32 | ||
| 33 | static int sysv_setattr(struct dentry *dentry, struct iattr *attr) | ||
| 34 | { | ||
| 35 | struct inode *inode = dentry->d_inode; | ||
| 36 | int error; | ||
| 37 | |||
| 38 | error = inode_change_ok(inode, attr); | ||
| 39 | if (error) | ||
| 40 | return error; | ||
| 41 | |||
| 42 | if ((attr->ia_valid & ATTR_SIZE) && | ||
| 43 | attr->ia_size != i_size_read(inode)) { | ||
| 44 | error = vmtruncate(inode, attr->ia_size); | ||
| 45 | if (error) | ||
| 46 | return error; | ||
| 47 | } | ||
| 48 | |||
| 49 | setattr_copy(inode, attr); | ||
| 50 | mark_inode_dirty(inode); | ||
| 51 | return 0; | ||
| 52 | } | ||
| 53 | |||
| 33 | const struct inode_operations sysv_file_inode_operations = { | 54 | const struct inode_operations sysv_file_inode_operations = { |
| 34 | .truncate = sysv_truncate, | 55 | .truncate = sysv_truncate, |
| 56 | .setattr = sysv_setattr, | ||
| 35 | .getattr = sysv_getattr, | 57 | .getattr = sysv_getattr, |
| 36 | }; | 58 | }; |
