aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ocfs2/journal.c
diff options
context:
space:
mode:
authorJan Kara <jack@suse.cz>2008-08-21 14:13:17 -0400
committerMark Fasheh <mfasheh@suse.com>2009-01-05 11:40:24 -0500
commit19ece546a418997226bd91552fbc41abcb05cea6 (patch)
treef10ba25a07d020551833f53720bbba475788f957 /fs/ocfs2/journal.c
parent2205363dce7447b8e85f1ead14387664c1a98753 (diff)
ocfs2: Enable quota accounting on mount, disable on umount
Enable quota usage tracking on mount and disable it on umount. Also add support for quota on and quota off quotactls and usrquota and grpquota mount options. Add quota features among supported ones. Signed-off-by: Jan Kara <jack@suse.cz> Signed-off-by: Mark Fasheh <mfasheh@suse.com>
Diffstat (limited to 'fs/ocfs2/journal.c')
-rw-r--r--fs/ocfs2/journal.c20
1 files changed, 17 insertions, 3 deletions
diff --git a/fs/ocfs2/journal.c b/fs/ocfs2/journal.c
index c60242018d9a..302f1144a708 100644
--- a/fs/ocfs2/journal.c
+++ b/fs/ocfs2/journal.c
@@ -56,7 +56,7 @@ static int ocfs2_recover_node(struct ocfs2_super *osb,
56 int node_num, int slot_num); 56 int node_num, int slot_num);
57static int __ocfs2_recovery_thread(void *arg); 57static int __ocfs2_recovery_thread(void *arg);
58static int ocfs2_commit_cache(struct ocfs2_super *osb); 58static int ocfs2_commit_cache(struct ocfs2_super *osb);
59static int ocfs2_wait_on_mount(struct ocfs2_super *osb); 59static int __ocfs2_wait_on_mount(struct ocfs2_super *osb, int quota);
60static int ocfs2_journal_toggle_dirty(struct ocfs2_super *osb, 60static int ocfs2_journal_toggle_dirty(struct ocfs2_super *osb,
61 int dirty, int replayed); 61 int dirty, int replayed);
62static int ocfs2_trylock_journal(struct ocfs2_super *osb, 62static int ocfs2_trylock_journal(struct ocfs2_super *osb,
@@ -65,6 +65,17 @@ static int ocfs2_recover_orphans(struct ocfs2_super *osb,
65 int slot); 65 int slot);
66static int ocfs2_commit_thread(void *arg); 66static int ocfs2_commit_thread(void *arg);
67 67
68static inline int ocfs2_wait_on_mount(struct ocfs2_super *osb)
69{
70 return __ocfs2_wait_on_mount(osb, 0);
71}
72
73static inline int ocfs2_wait_on_quotas(struct ocfs2_super *osb)
74{
75 return __ocfs2_wait_on_mount(osb, 1);
76}
77
78
68 79
69/* 80/*
70 * The recovery_list is a simple linked list of node numbers to recover. 81 * The recovery_list is a simple linked list of node numbers to recover.
@@ -895,6 +906,8 @@ void ocfs2_complete_recovery(struct work_struct *work)
895 906
896 mlog(0, "Complete recovery for slot %d\n", item->lri_slot); 907 mlog(0, "Complete recovery for slot %d\n", item->lri_slot);
897 908
909 ocfs2_wait_on_quotas(osb);
910
898 la_dinode = item->lri_la_dinode; 911 la_dinode = item->lri_la_dinode;
899 if (la_dinode) { 912 if (la_dinode) {
900 mlog(0, "Clean up local alloc %llu\n", 913 mlog(0, "Clean up local alloc %llu\n",
@@ -1701,13 +1714,14 @@ static int ocfs2_recover_orphans(struct ocfs2_super *osb,
1701 return ret; 1714 return ret;
1702} 1715}
1703 1716
1704static int ocfs2_wait_on_mount(struct ocfs2_super *osb) 1717static int __ocfs2_wait_on_mount(struct ocfs2_super *osb, int quota)
1705{ 1718{
1706 /* This check is good because ocfs2 will wait on our recovery 1719 /* This check is good because ocfs2 will wait on our recovery
1707 * thread before changing it to something other than MOUNTED 1720 * thread before changing it to something other than MOUNTED
1708 * or DISABLED. */ 1721 * or DISABLED. */
1709 wait_event(osb->osb_mount_event, 1722 wait_event(osb->osb_mount_event,
1710 atomic_read(&osb->vol_state) == VOLUME_MOUNTED || 1723 (!quota && atomic_read(&osb->vol_state) == VOLUME_MOUNTED) ||
1724 atomic_read(&osb->vol_state) == VOLUME_MOUNTED_QUOTAS ||
1711 atomic_read(&osb->vol_state) == VOLUME_DISABLED); 1725 atomic_read(&osb->vol_state) == VOLUME_DISABLED);
1712 1726
1713 /* If there's an error on mount, then we may never get to the 1727 /* If there's an error on mount, then we may never get to the