aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ocfs2/quota_local.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/ocfs2/quota_local.c')
-rw-r--r--fs/ocfs2/quota_local.c33
1 files changed, 17 insertions, 16 deletions
diff --git a/fs/ocfs2/quota_local.c b/fs/ocfs2/quota_local.c
index 2001862bf2b1..10b653930ee2 100644
--- a/fs/ocfs2/quota_local.c
+++ b/fs/ocfs2/quota_local.c
@@ -166,12 +166,12 @@ static int ocfs2_read_quota_block(struct inode *inode, u64 v_block,
166/* Check whether we understand format of quota files */ 166/* Check whether we understand format of quota files */
167static int ocfs2_local_check_quota_file(struct super_block *sb, int type) 167static int ocfs2_local_check_quota_file(struct super_block *sb, int type)
168{ 168{
169 unsigned int lmagics[MAXQUOTAS] = OCFS2_LOCAL_QMAGICS; 169 unsigned int lmagics[OCFS2_MAXQUOTAS] = OCFS2_LOCAL_QMAGICS;
170 unsigned int lversions[MAXQUOTAS] = OCFS2_LOCAL_QVERSIONS; 170 unsigned int lversions[OCFS2_MAXQUOTAS] = OCFS2_LOCAL_QVERSIONS;
171 unsigned int gmagics[MAXQUOTAS] = OCFS2_GLOBAL_QMAGICS; 171 unsigned int gmagics[OCFS2_MAXQUOTAS] = OCFS2_GLOBAL_QMAGICS;
172 unsigned int gversions[MAXQUOTAS] = OCFS2_GLOBAL_QVERSIONS; 172 unsigned int gversions[OCFS2_MAXQUOTAS] = OCFS2_GLOBAL_QVERSIONS;
173 unsigned int ino[MAXQUOTAS] = { USER_QUOTA_SYSTEM_INODE, 173 unsigned int ino[OCFS2_MAXQUOTAS] = { USER_QUOTA_SYSTEM_INODE,
174 GROUP_QUOTA_SYSTEM_INODE }; 174 GROUP_QUOTA_SYSTEM_INODE };
175 struct buffer_head *bh = NULL; 175 struct buffer_head *bh = NULL;
176 struct inode *linode = sb_dqopt(sb)->files[type]; 176 struct inode *linode = sb_dqopt(sb)->files[type];
177 struct inode *ginode = NULL; 177 struct inode *ginode = NULL;
@@ -336,7 +336,7 @@ void ocfs2_free_quota_recovery(struct ocfs2_quota_recovery *rec)
336{ 336{
337 int type; 337 int type;
338 338
339 for (type = 0; type < MAXQUOTAS; type++) 339 for (type = 0; type < OCFS2_MAXQUOTAS; type++)
340 free_recovery_list(&(rec->r_list[type])); 340 free_recovery_list(&(rec->r_list[type]));
341 kfree(rec); 341 kfree(rec);
342} 342}
@@ -382,7 +382,7 @@ static struct ocfs2_quota_recovery *ocfs2_alloc_quota_recovery(void)
382 rec = kmalloc(sizeof(struct ocfs2_quota_recovery), GFP_NOFS); 382 rec = kmalloc(sizeof(struct ocfs2_quota_recovery), GFP_NOFS);
383 if (!rec) 383 if (!rec)
384 return NULL; 384 return NULL;
385 for (type = 0; type < MAXQUOTAS; type++) 385 for (type = 0; type < OCFS2_MAXQUOTAS; type++)
386 INIT_LIST_HEAD(&(rec->r_list[type])); 386 INIT_LIST_HEAD(&(rec->r_list[type]));
387 return rec; 387 return rec;
388} 388}
@@ -392,10 +392,11 @@ struct ocfs2_quota_recovery *ocfs2_begin_quota_recovery(
392 struct ocfs2_super *osb, 392 struct ocfs2_super *osb,
393 int slot_num) 393 int slot_num)
394{ 394{
395 unsigned int feature[MAXQUOTAS] = { OCFS2_FEATURE_RO_COMPAT_USRQUOTA, 395 unsigned int feature[OCFS2_MAXQUOTAS] = {
396 OCFS2_FEATURE_RO_COMPAT_GRPQUOTA}; 396 OCFS2_FEATURE_RO_COMPAT_USRQUOTA,
397 unsigned int ino[MAXQUOTAS] = { LOCAL_USER_QUOTA_SYSTEM_INODE, 397 OCFS2_FEATURE_RO_COMPAT_GRPQUOTA};
398 LOCAL_GROUP_QUOTA_SYSTEM_INODE }; 398 unsigned int ino[OCFS2_MAXQUOTAS] = { LOCAL_USER_QUOTA_SYSTEM_INODE,
399 LOCAL_GROUP_QUOTA_SYSTEM_INODE };
399 struct super_block *sb = osb->sb; 400 struct super_block *sb = osb->sb;
400 struct ocfs2_local_disk_dqinfo *ldinfo; 401 struct ocfs2_local_disk_dqinfo *ldinfo;
401 struct inode *lqinode; 402 struct inode *lqinode;
@@ -412,7 +413,7 @@ struct ocfs2_quota_recovery *ocfs2_begin_quota_recovery(
412 return ERR_PTR(-ENOMEM); 413 return ERR_PTR(-ENOMEM);
413 /* First init... */ 414 /* First init... */
414 415
415 for (type = 0; type < MAXQUOTAS; type++) { 416 for (type = 0; type < OCFS2_MAXQUOTAS; type++) {
416 if (!OCFS2_HAS_RO_COMPAT_FEATURE(sb, feature[type])) 417 if (!OCFS2_HAS_RO_COMPAT_FEATURE(sb, feature[type]))
417 continue; 418 continue;
418 /* At this point, journal of the slot is already replayed so 419 /* At this point, journal of the slot is already replayed so
@@ -589,8 +590,8 @@ int ocfs2_finish_quota_recovery(struct ocfs2_super *osb,
589 struct ocfs2_quota_recovery *rec, 590 struct ocfs2_quota_recovery *rec,
590 int slot_num) 591 int slot_num)
591{ 592{
592 unsigned int ino[MAXQUOTAS] = { LOCAL_USER_QUOTA_SYSTEM_INODE, 593 unsigned int ino[OCFS2_MAXQUOTAS] = { LOCAL_USER_QUOTA_SYSTEM_INODE,
593 LOCAL_GROUP_QUOTA_SYSTEM_INODE }; 594 LOCAL_GROUP_QUOTA_SYSTEM_INODE };
594 struct super_block *sb = osb->sb; 595 struct super_block *sb = osb->sb;
595 struct ocfs2_local_disk_dqinfo *ldinfo; 596 struct ocfs2_local_disk_dqinfo *ldinfo;
596 struct buffer_head *bh; 597 struct buffer_head *bh;
@@ -604,7 +605,7 @@ int ocfs2_finish_quota_recovery(struct ocfs2_super *osb,
604 "slot %u\n", osb->dev_str, slot_num); 605 "slot %u\n", osb->dev_str, slot_num);
605 606
606 mutex_lock(&sb_dqopt(sb)->dqonoff_mutex); 607 mutex_lock(&sb_dqopt(sb)->dqonoff_mutex);
607 for (type = 0; type < MAXQUOTAS; type++) { 608 for (type = 0; type < OCFS2_MAXQUOTAS; type++) {
608 if (list_empty(&(rec->r_list[type]))) 609 if (list_empty(&(rec->r_list[type])))
609 continue; 610 continue;
610 trace_ocfs2_finish_quota_recovery(slot_num); 611 trace_ocfs2_finish_quota_recovery(slot_num);