summaryrefslogtreecommitdiff
path: root/fs/ext2/inode.c
diff options
context:
space:
mode:
authorDmitry Monakhov <dmonakhov@openvz.org>2010-04-08 22:04:20 +0400
committerJan Kara <jack@suse.cz>2010-05-21 21:30:45 +0400
commit12755627bdcddcdb30a1bfb9a09395a52b1d6838 (patch)
treeb2d69696975d5457648020324f683a45302fbf3c /fs/ext2/inode.c
parentfcbc59f96e38a0999e827be9d04d46b62b53b20a (diff)
downloadlinux-12755627bdcddcdb30a1bfb9a09395a52b1d6838.tar.xz
quota: unify quota init condition in setattr
Quota must being initialized if size or uid/git changes requested. But initialization performed in two different places: in case of i_size file system is responsible for dquot init , but in case of uid/gid init will be called internally in dquot_transfer(). This ambiguity makes code harder to understand. Let's move this logic to one common helper function. Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org> Signed-off-by: Jan Kara <jack@suse.cz>
Diffstat (limited to 'fs/ext2/inode.c')
-rw-r--r--fs/ext2/inode.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/ext2/inode.c b/fs/ext2/inode.c
index b90c3bf6e9ba..527c46d9bc1f 100644
--- a/fs/ext2/inode.c
+++ b/fs/ext2/inode.c
@@ -1466,7 +1466,7 @@ int ext2_setattr(struct dentry *dentry, struct iattr *iattr)
if (error)
return error;
- if (iattr->ia_valid & ATTR_SIZE)
+ if (is_quota_modification(inode, iattr))
dquot_initialize(inode);
if ((iattr->ia_valid & ATTR_UID && iattr->ia_uid != inode->i_uid) ||
(iattr->ia_valid & ATTR_GID && iattr->ia_gid != inode->i_gid)) {