diff options
author | Dave Kleikamp <shaggy@austin.ibm.com> | 2006-01-24 14:34:47 -0600 |
---|---|---|
committer | Dave Kleikamp <shaggy@austin.ibm.com> | 2006-01-24 14:34:47 -0600 |
commit | 0a0fc0ddbe732779366ab6b1b879f62195e65967 (patch) | |
tree | 7b42490a676cf39ae0691b6859ecf7fd410f229b /fs/attr.c | |
parent | 4d5dbd0945d9e0833dd7964a3d6ee33157f7cc7a (diff) | |
parent | 3ee68c4af3fd7228c1be63254b9f884614f9ebb2 (diff) | |
download | kernel_samsung_smdk4412-0a0fc0ddbe732779366ab6b1b879f62195e65967.tar.gz kernel_samsung_smdk4412-0a0fc0ddbe732779366ab6b1b879f62195e65967.tar.bz2 kernel_samsung_smdk4412-0a0fc0ddbe732779366ab6b1b879f62195e65967.zip |
Merge with /home/shaggy/git/linus-clean/
Diffstat (limited to 'fs/attr.c')
-rw-r--r-- | fs/attr.c | 26 |
1 files changed, 9 insertions, 17 deletions
diff --git a/fs/attr.c b/fs/attr.c index 67bcd9b14ea..97de9467087 100644 --- a/fs/attr.c +++ b/fs/attr.c @@ -10,11 +10,11 @@ #include <linux/mm.h> #include <linux/string.h> #include <linux/smp_lock.h> +#include <linux/capability.h> #include <linux/fsnotify.h> #include <linux/fcntl.h> #include <linux/quotaops.h> #include <linux/security.h> -#include <linux/time.h> /* 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); |