diff options
author | Dmitry Monakhov <dmonakhov@openvz.org> | 2010-04-08 22:04:20 +0400 |
---|---|---|
committer | Jan Kara <jack@suse.cz> | 2010-05-21 19:30:45 +0200 |
commit | 12755627bdcddcdb30a1bfb9a09395a52b1d6838 (patch) | |
tree | b2d69696975d5457648020324f683a45302fbf3c /fs/ocfs2 | |
parent | fcbc59f96e38a0999e827be9d04d46b62b53b20a (diff) | |
download | linux-3.10-12755627bdcddcdb30a1bfb9a09395a52b1d6838.tar.gz linux-3.10-12755627bdcddcdb30a1bfb9a09395a52b1d6838.tar.bz2 linux-3.10-12755627bdcddcdb30a1bfb9a09395a52b1d6838.zip |
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/ocfs2')
-rw-r--r-- | fs/ocfs2/file.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/ocfs2/file.c b/fs/ocfs2/file.c index f74f1400ecc..e127c53ec2e 100644 --- a/fs/ocfs2/file.c +++ b/fs/ocfs2/file.c @@ -966,10 +966,10 @@ int ocfs2_setattr(struct dentry *dentry, struct iattr *attr) if (status) return status; + if (is_quota_modification(inode, attr)) + dquot_initialize(inode); size_change = S_ISREG(inode->i_mode) && attr->ia_valid & ATTR_SIZE; if (size_change) { - dquot_initialize(inode); - status = ocfs2_rw_lock(inode, 1); if (status < 0) { mlog_errno(status); |