aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/quotaops.h
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 /include/linux/quotaops.h
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 'include/linux/quotaops.h')
-rw-r--r--include/linux/quotaops.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/linux/quotaops.h b/include/linux/quotaops.h
index 82c70c42d035..8a7818764a67 100644
--- a/include/linux/quotaops.h
+++ b/include/linux/quotaops.h
@@ -14,6 +14,14 @@ static inline struct quota_info *sb_dqopt(struct super_block *sb)
14 return &sb->s_dquot; 14 return &sb->s_dquot;
15} 15}
16 16
17/* i_mutex must being held */
18static inline bool is_quota_modification(struct inode *inode, struct iattr *ia)
19{
20 return (ia->ia_valid & ATTR_SIZE && ia->ia_size != inode->i_size) ||
21 (ia->ia_valid & ATTR_UID && ia->ia_uid != inode->i_uid) ||
22 (ia->ia_valid & ATTR_GID && ia->ia_gid != inode->i_gid);
23}
24
17#if defined(CONFIG_QUOTA) 25#if defined(CONFIG_QUOTA)
18 26
19/* 27/*