X-Git-Url: https://git.openpandora.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=fs%2Fattr.c;h=97de946708781df074388be1da5e4f811872766a;hb=1b9bb3c14c60324b54645ffefbe6d270f9fd191c;hp=b1796fb9e524031614a44f26e3ac44d5e1e48c53;hpb=6c89cce75c6f93088a5a2a25bb9674a9194592cc;p=pandora-kernel.git diff --git a/fs/attr.c b/fs/attr.c index b1796fb9e524..97de94670878 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); @@ -117,9 +109,6 @@ int notify_change(struct dentry * dentry, struct iattr * attr) struct timespec now; unsigned int ia_valid = attr->ia_valid; - if (!inode) - BUG(); - mode = inode->i_mode; now = current_fs_time(inode->i_sb);