summaryrefslogtreecommitdiff
path: root/fs/quota/dquot.c
diff options
context:
space:
mode:
authorJan Kara <jack@suse.cz>2017-08-03 12:18:23 +0300
committerJan Kara <jack@suse.cz>2017-08-17 23:00:45 +0300
commit834057bf846691552a8906f7ed3f67546e5f897c (patch)
tree2cabc0f1d1d7325e7efb61db7a6b32c7e9cc6941 /fs/quota/dquot.c
parent503330f3820fab13aa2a7b1f9e7633686acc7c79 (diff)
downloadlinux-834057bf846691552a8906f7ed3f67546e5f897c.tar.xz
quota: Allow disabling tracking of dirty dquots in a list
Filesystems that are journalling quotas generally don't need tracking of dirty dquots in a list since forcing a transaction commit flushes all quotas anyway. Allow filesystem to say it doesn't want dquots to be tracked as it reduces contention on the dq_list_lock. Signed-off-by: Jan Kara <jack@suse.cz>
Diffstat (limited to 'fs/quota/dquot.c')
-rw-r--r--fs/quota/dquot.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/fs/quota/dquot.c b/fs/quota/dquot.c
index 361a2a6f13e1..b867578e62c0 100644
--- a/fs/quota/dquot.c
+++ b/fs/quota/dquot.c
@@ -344,6 +344,9 @@ int dquot_mark_dquot_dirty(struct dquot *dquot)
if (!test_bit(DQ_ACTIVE_B, &dquot->dq_flags))
return 0;
+ if (sb_dqopt(dquot->dq_sb)->flags & DQUOT_NOLIST_DIRTY)
+ return test_and_set_bit(DQ_MOD_B, &dquot->dq_flags);
+
/* If quota is dirty already, we don't have to acquire dq_list_lock */
if (test_bit(DQ_MOD_B, &dquot->dq_flags))
return 1;
@@ -385,6 +388,9 @@ static inline void dqput_all(struct dquot **dquot)
static inline int clear_dquot_dirty(struct dquot *dquot)
{
+ if (sb_dqopt(dquot->dq_sb)->flags & DQUOT_NOLIST_DIRTY)
+ return test_and_clear_bit(DQ_MOD_B, &dquot->dq_flags);
+
spin_lock(&dq_list_lock);
if (!test_and_clear_bit(DQ_MOD_B, &dquot->dq_flags)) {
spin_unlock(&dq_list_lock);