diff options
author | Jan Kara <jack@suse.cz> | 2008-10-20 17:50:38 -0400 |
---|---|---|
committer | Mark Fasheh <mfasheh@suse.com> | 2009-01-05 11:40:24 -0500 |
commit | 2205363dce7447b8e85f1ead14387664c1a98753 (patch) | |
tree | 729b2716f2e31bda2e035a11cc39aa5472dff2c4 /fs/ocfs2/quota.h | |
parent | 171bf93ce11f4c9929fdce6ce63df8da2f3c4475 (diff) |
ocfs2: Implement quota recovery
Implement functions for recovery after a crash. Functions just
read local quota file and sync info to global quota file.
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Mark Fasheh <mfasheh@suse.com>
Diffstat (limited to 'fs/ocfs2/quota.h')
-rw-r--r-- | fs/ocfs2/quota.h | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/fs/ocfs2/quota.h b/fs/ocfs2/quota.h index e2233d51507f..04872b45b990 100644 --- a/fs/ocfs2/quota.h +++ b/fs/ocfs2/quota.h | |||
@@ -33,6 +33,17 @@ struct ocfs2_dquot { | |||
33 | s64 dq_originodes; /* Last globally synced inode usage */ | 33 | s64 dq_originodes; /* Last globally synced inode usage */ |
34 | }; | 34 | }; |
35 | 35 | ||
36 | /* Description of one chunk to recover in memory */ | ||
37 | struct ocfs2_recovery_chunk { | ||
38 | struct list_head rc_list; /* List of chunks */ | ||
39 | int rc_chunk; /* Chunk number */ | ||
40 | unsigned long *rc_bitmap; /* Bitmap of entries to recover */ | ||
41 | }; | ||
42 | |||
43 | struct ocfs2_quota_recovery { | ||
44 | struct list_head r_list[MAXQUOTAS]; /* List of chunks to recover */ | ||
45 | }; | ||
46 | |||
36 | /* In-memory structure with quota header information */ | 47 | /* In-memory structure with quota header information */ |
37 | struct ocfs2_mem_dqinfo { | 48 | struct ocfs2_mem_dqinfo { |
38 | unsigned int dqi_type; /* Quota type this structure describes */ | 49 | unsigned int dqi_type; /* Quota type this structure describes */ |
@@ -49,6 +60,10 @@ struct ocfs2_mem_dqinfo { | |||
49 | struct buffer_head *dqi_ibh; /* Buffer with information header */ | 60 | struct buffer_head *dqi_ibh; /* Buffer with information header */ |
50 | struct qtree_mem_dqinfo dqi_gi; /* Info about global file */ | 61 | struct qtree_mem_dqinfo dqi_gi; /* Info about global file */ |
51 | struct delayed_work dqi_sync_work; /* Work for syncing dquots */ | 62 | struct delayed_work dqi_sync_work; /* Work for syncing dquots */ |
63 | struct ocfs2_quota_recovery *dqi_rec; /* Pointer to recovery | ||
64 | * information, in case we | ||
65 | * enable quotas on file | ||
66 | * needing it */ | ||
52 | }; | 67 | }; |
53 | 68 | ||
54 | static inline struct ocfs2_dquot *OCFS2_DQUOT(struct dquot *dquot) | 69 | static inline struct ocfs2_dquot *OCFS2_DQUOT(struct dquot *dquot) |
@@ -67,6 +82,12 @@ extern struct kmem_cache *ocfs2_qf_chunk_cachep; | |||
67 | 82 | ||
68 | extern struct qtree_fmt_operations ocfs2_global_ops; | 83 | extern struct qtree_fmt_operations ocfs2_global_ops; |
69 | 84 | ||
85 | struct ocfs2_quota_recovery *ocfs2_begin_quota_recovery( | ||
86 | struct ocfs2_super *osb, int slot_num); | ||
87 | int ocfs2_finish_quota_recovery(struct ocfs2_super *osb, | ||
88 | struct ocfs2_quota_recovery *rec, | ||
89 | int slot_num); | ||
90 | void ocfs2_free_quota_recovery(struct ocfs2_quota_recovery *rec); | ||
70 | ssize_t ocfs2_quota_read(struct super_block *sb, int type, char *data, | 91 | ssize_t ocfs2_quota_read(struct super_block *sb, int type, char *data, |
71 | size_t len, loff_t off); | 92 | size_t len, loff_t off); |
72 | ssize_t ocfs2_quota_write(struct super_block *sb, int type, | 93 | ssize_t ocfs2_quota_write(struct super_block *sb, int type, |