Skip to content

Commit

Permalink
udf: Convert UDF to new truncate calling sequence
Browse files Browse the repository at this point in the history
Use new truncation sequence in UDF and fix up error handling in the
code.

Signed-off-by: Jan Kara <[email protected]>
  • Loading branch information
jankara committed Feb 23, 2011
1 parent 4a508dd commit 7e49b6f
Show file tree
Hide file tree
Showing 4 changed files with 234 additions and 170 deletions.
7 changes: 3 additions & 4 deletions fs/udf/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,8 @@ static ssize_t udf_file_aio_write(struct kiocb *iocb, const struct iovec *iov,
if (inode->i_sb->s_blocksize <
(udf_file_entry_alloc_offset(inode) +
pos + count)) {
udf_expand_file_adinicb(inode, pos + count, &err);
if (iinfo->i_alloc_type == ICBTAG_FLAG_AD_IN_ICB) {
err = udf_expand_file_adinicb(inode);
if (err) {
udf_debug("udf_expand_adinicb: err=%d\n", err);
up_write(&iinfo->i_data_sem);
return err;
Expand Down Expand Up @@ -237,7 +237,7 @@ static int udf_setattr(struct dentry *dentry, struct iattr *attr)

if ((attr->ia_valid & ATTR_SIZE) &&
attr->ia_size != i_size_read(inode)) {
error = vmtruncate(inode, attr->ia_size);
error = udf_setsize(inode, attr->ia_size);
if (error)
return error;
}
Expand All @@ -249,5 +249,4 @@ static int udf_setattr(struct dentry *dentry, struct iattr *attr)

const struct inode_operations udf_file_inode_operations = {
.setattr = udf_setattr,
.truncate = udf_truncate,
};
Loading

0 comments on commit 7e49b6f

Please sign in to comment.