diff options
Diffstat (limited to 'fs/ufs/truncate.c')
| -rw-r--r-- | fs/ufs/truncate.c | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/fs/ufs/truncate.c b/fs/ufs/truncate.c index 589e01a465ba..34d5cb135320 100644 --- a/fs/ufs/truncate.c +++ b/fs/ufs/truncate.c | |||
| @@ -500,11 +500,6 @@ out: | |||
| 500 | return err; | 500 | return err; |
| 501 | } | 501 | } |
| 502 | 502 | ||
| 503 | /* | ||
| 504 | * TODO: | ||
| 505 | * - truncate case should use proper ordering instead of using | ||
| 506 | * simple_setsize | ||
| 507 | */ | ||
| 508 | int ufs_setattr(struct dentry *dentry, struct iattr *attr) | 503 | int ufs_setattr(struct dentry *dentry, struct iattr *attr) |
| 509 | { | 504 | { |
| 510 | struct inode *inode = dentry->d_inode; | 505 | struct inode *inode = dentry->d_inode; |
| @@ -518,14 +513,17 @@ int ufs_setattr(struct dentry *dentry, struct iattr *attr) | |||
| 518 | if (ia_valid & ATTR_SIZE && attr->ia_size != inode->i_size) { | 513 | if (ia_valid & ATTR_SIZE && attr->ia_size != inode->i_size) { |
| 519 | loff_t old_i_size = inode->i_size; | 514 | loff_t old_i_size = inode->i_size; |
| 520 | 515 | ||
| 521 | error = simple_setsize(inode, attr->ia_size); | 516 | /* XXX(truncate): truncate_setsize should be called last */ |
| 522 | if (error) | 517 | truncate_setsize(inode, attr->ia_size); |
| 523 | return error; | 518 | |
| 524 | error = ufs_truncate(inode, old_i_size); | 519 | error = ufs_truncate(inode, old_i_size); |
| 525 | if (error) | 520 | if (error) |
| 526 | return error; | 521 | return error; |
| 527 | } | 522 | } |
| 528 | return inode_setattr(inode, attr); | 523 | |
| 524 | setattr_copy(inode, attr); | ||
| 525 | mark_inode_dirty(inode); | ||
| 526 | return 0; | ||
| 529 | } | 527 | } |
| 530 | 528 | ||
| 531 | const struct inode_operations ufs_file_inode_operations = { | 529 | const struct inode_operations ufs_file_inode_operations = { |
