X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;ds=sidebyside;f=fs%2Fattr.c;h=97de946708781df074388be1da5e4f811872766a;hb=d27146dd5b72ab7d7e641f56f4bee1484dabd0b7;hp=67bcd9b14ea58046efa53cef41db47d96f36f9b2;hpb=d8762748cae4f85b3201c0304969d993b42d5258;p=powerpc.git diff --git a/fs/attr.c b/fs/attr.c index 67bcd9b14e..97de946708 100644 --- a/fs/attr.c +++ b/fs/attr.c @@ -10,11 +10,11 @@ #include #include #include +#include #include #include #include #include -#include /* Taken over from the old code... */ @@ -67,20 +67,12 @@ EXPORT_SYMBOL(inode_change_ok); int inode_setattr(struct inode * inode, struct iattr * attr) { unsigned int ia_valid = attr->ia_valid; - int error = 0; - - if (ia_valid & ATTR_SIZE) { - if (attr->ia_size != i_size_read(inode)) { - error = vmtruncate(inode, attr->ia_size); - if (error || (ia_valid == ATTR_SIZE)) - goto out; - } else { - /* - * We skipped the truncate but must still update - * timestamps - */ - ia_valid |= ATTR_MTIME|ATTR_CTIME; - } + + if (ia_valid & ATTR_SIZE && + attr->ia_size != i_size_read(inode)) { + int error = vmtruncate(inode, attr->ia_size); + if (error) + return error; } if (ia_valid & ATTR_UID) @@ -104,8 +96,8 @@ int inode_setattr(struct inode * inode, struct iattr * attr) inode->i_mode = mode; } mark_inode_dirty(inode); -out: - return error; + + return 0; } EXPORT_SYMBOL(inode_setattr);