aboutsummaryrefslogtreecommitdiffstats
path: root/fs/quota
diff options
context:
space:
mode:
authorDmitry Monakhov <dmonakhov@openvz.org>2010-04-08 14:04:20 -0400
committerJan Kara <jack@suse.cz>2010-05-21 13:30:45 -0400
commit12755627bdcddcdb30a1bfb9a09395a52b1d6838 (patch)
treeb2d69696975d5457648020324f683a45302fbf3c /fs/quota
parentfcbc59f96e38a0999e827be9d04d46b62b53b20a (diff)
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/quota')
-rw-r--r--fs/quota/dquot.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/fs/quota/dquot.c b/fs/quota/dquot.c
index b1a5036560a9..1056a21f0300 100644
--- a/fs/quota/dquot.c
+++ b/fs/quota/dquot.c
@@ -1822,10 +1822,9 @@ int dquot_transfer(struct inode *inode, struct iattr *iattr)
1822 mask |= 1 << GRPQUOTA; 1822 mask |= 1 << GRPQUOTA;
1823 chid[GRPQUOTA] = iattr->ia_gid; 1823 chid[GRPQUOTA] = iattr->ia_gid;
1824 } 1824 }
1825 if (sb_any_quota_active(inode->i_sb) && !IS_NOQUOTA(inode)) { 1825 if (sb_any_quota_active(inode->i_sb) && !IS_NOQUOTA(inode))
1826 dquot_initialize(inode);
1827 return __dquot_transfer(inode, chid, mask); 1826 return __dquot_transfer(inode, chid, mask);
1828 } 1827
1829 return 0; 1828 return 0;
1830} 1829}
1831EXPORT_SYMBOL(dquot_transfer); 1830EXPORT_SYMBOL(dquot_transfer);