diff options
Diffstat (limited to 'fs/reiserfs')
-rw-r--r-- | fs/reiserfs/reiserfs.h | 5 | ||||
-rw-r--r-- | fs/reiserfs/super.c | 16 |
2 files changed, 12 insertions, 9 deletions
diff --git a/fs/reiserfs/reiserfs.h b/fs/reiserfs/reiserfs.h index 735c2c2b4536..1894d96ccb7c 100644 --- a/fs/reiserfs/reiserfs.h +++ b/fs/reiserfs/reiserfs.h | |||
@@ -506,6 +506,9 @@ typedef struct reiserfs_proc_info_data { | |||
506 | } reiserfs_proc_info_data_t; | 506 | } reiserfs_proc_info_data_t; |
507 | #endif | 507 | #endif |
508 | 508 | ||
509 | /* Number of quota types we support */ | ||
510 | #define REISERFS_MAXQUOTAS 2 | ||
511 | |||
509 | /* reiserfs union of in-core super block data */ | 512 | /* reiserfs union of in-core super block data */ |
510 | struct reiserfs_sb_info { | 513 | struct reiserfs_sb_info { |
511 | /* Buffer containing the super block */ | 514 | /* Buffer containing the super block */ |
@@ -615,7 +618,7 @@ struct reiserfs_sb_info { | |||
615 | spinlock_t old_work_lock; /* protects old_work and work_queued */ | 618 | spinlock_t old_work_lock; /* protects old_work and work_queued */ |
616 | 619 | ||
617 | #ifdef CONFIG_QUOTA | 620 | #ifdef CONFIG_QUOTA |
618 | char *s_qf_names[MAXQUOTAS]; | 621 | char *s_qf_names[REISERFS_MAXQUOTAS]; |
619 | int s_jquota_fmt; | 622 | int s_jquota_fmt; |
620 | #endif | 623 | #endif |
621 | char *s_jdev; /* Stored jdev for mount option showing */ | 624 | char *s_jdev; /* Stored jdev for mount option showing */ |
diff --git a/fs/reiserfs/super.c b/fs/reiserfs/super.c index d46e88a33b02..f1376c92cf74 100644 --- a/fs/reiserfs/super.c +++ b/fs/reiserfs/super.c | |||
@@ -206,7 +206,7 @@ static int finish_unfinished(struct super_block *s) | |||
206 | #ifdef CONFIG_QUOTA | 206 | #ifdef CONFIG_QUOTA |
207 | int i; | 207 | int i; |
208 | int ms_active_set; | 208 | int ms_active_set; |
209 | int quota_enabled[MAXQUOTAS]; | 209 | int quota_enabled[REISERFS_MAXQUOTAS]; |
210 | #endif | 210 | #endif |
211 | 211 | ||
212 | /* compose key to look for "save" links */ | 212 | /* compose key to look for "save" links */ |
@@ -227,7 +227,7 @@ static int finish_unfinished(struct super_block *s) | |||
227 | s->s_flags |= MS_ACTIVE; | 227 | s->s_flags |= MS_ACTIVE; |
228 | } | 228 | } |
229 | /* Turn on quotas so that they are updated correctly */ | 229 | /* Turn on quotas so that they are updated correctly */ |
230 | for (i = 0; i < MAXQUOTAS; i++) { | 230 | for (i = 0; i < REISERFS_MAXQUOTAS; i++) { |
231 | quota_enabled[i] = 1; | 231 | quota_enabled[i] = 1; |
232 | if (REISERFS_SB(s)->s_qf_names[i]) { | 232 | if (REISERFS_SB(s)->s_qf_names[i]) { |
233 | int ret; | 233 | int ret; |
@@ -370,7 +370,7 @@ static int finish_unfinished(struct super_block *s) | |||
370 | #ifdef CONFIG_QUOTA | 370 | #ifdef CONFIG_QUOTA |
371 | /* Turn quotas off */ | 371 | /* Turn quotas off */ |
372 | reiserfs_write_unlock(s); | 372 | reiserfs_write_unlock(s); |
373 | for (i = 0; i < MAXQUOTAS; i++) { | 373 | for (i = 0; i < REISERFS_MAXQUOTAS; i++) { |
374 | if (sb_dqopt(s)->files[i] && quota_enabled[i]) | 374 | if (sb_dqopt(s)->files[i] && quota_enabled[i]) |
375 | dquot_quota_off(s, i); | 375 | dquot_quota_off(s, i); |
376 | } | 376 | } |
@@ -1360,7 +1360,7 @@ static void handle_quota_files(struct super_block *s, char **qf_names, | |||
1360 | { | 1360 | { |
1361 | int i; | 1361 | int i; |
1362 | 1362 | ||
1363 | for (i = 0; i < MAXQUOTAS; i++) { | 1363 | for (i = 0; i < REISERFS_MAXQUOTAS; i++) { |
1364 | if (qf_names[i] != REISERFS_SB(s)->s_qf_names[i]) | 1364 | if (qf_names[i] != REISERFS_SB(s)->s_qf_names[i]) |
1365 | kfree(REISERFS_SB(s)->s_qf_names[i]); | 1365 | kfree(REISERFS_SB(s)->s_qf_names[i]); |
1366 | REISERFS_SB(s)->s_qf_names[i] = qf_names[i]; | 1366 | REISERFS_SB(s)->s_qf_names[i] = qf_names[i]; |
@@ -1381,7 +1381,7 @@ static int reiserfs_remount(struct super_block *s, int *mount_flags, char *arg) | |||
1381 | struct reiserfs_journal *journal = SB_JOURNAL(s); | 1381 | struct reiserfs_journal *journal = SB_JOURNAL(s); |
1382 | char *new_opts = kstrdup(arg, GFP_KERNEL); | 1382 | char *new_opts = kstrdup(arg, GFP_KERNEL); |
1383 | int err; | 1383 | int err; |
1384 | char *qf_names[MAXQUOTAS]; | 1384 | char *qf_names[REISERFS_MAXQUOTAS]; |
1385 | unsigned int qfmt = 0; | 1385 | unsigned int qfmt = 0; |
1386 | #ifdef CONFIG_QUOTA | 1386 | #ifdef CONFIG_QUOTA |
1387 | int i; | 1387 | int i; |
@@ -1400,7 +1400,7 @@ static int reiserfs_remount(struct super_block *s, int *mount_flags, char *arg) | |||
1400 | (s, arg, &mount_options, &blocks, NULL, &commit_max_age, | 1400 | (s, arg, &mount_options, &blocks, NULL, &commit_max_age, |
1401 | qf_names, &qfmt)) { | 1401 | qf_names, &qfmt)) { |
1402 | #ifdef CONFIG_QUOTA | 1402 | #ifdef CONFIG_QUOTA |
1403 | for (i = 0; i < MAXQUOTAS; i++) | 1403 | for (i = 0; i < REISERFS_MAXQUOTAS; i++) |
1404 | if (qf_names[i] != REISERFS_SB(s)->s_qf_names[i]) | 1404 | if (qf_names[i] != REISERFS_SB(s)->s_qf_names[i]) |
1405 | kfree(qf_names[i]); | 1405 | kfree(qf_names[i]); |
1406 | #endif | 1406 | #endif |
@@ -1844,7 +1844,7 @@ static int reiserfs_fill_super(struct super_block *s, void *data, int silent) | |||
1844 | char *jdev_name; | 1844 | char *jdev_name; |
1845 | struct reiserfs_sb_info *sbi; | 1845 | struct reiserfs_sb_info *sbi; |
1846 | int errval = -EINVAL; | 1846 | int errval = -EINVAL; |
1847 | char *qf_names[MAXQUOTAS] = {}; | 1847 | char *qf_names[REISERFS_MAXQUOTAS] = {}; |
1848 | unsigned int qfmt = 0; | 1848 | unsigned int qfmt = 0; |
1849 | 1849 | ||
1850 | save_mount_options(s, data); | 1850 | save_mount_options(s, data); |
@@ -2169,7 +2169,7 @@ error_unlocked: | |||
2169 | #ifdef CONFIG_QUOTA | 2169 | #ifdef CONFIG_QUOTA |
2170 | { | 2170 | { |
2171 | int j; | 2171 | int j; |
2172 | for (j = 0; j < MAXQUOTAS; j++) | 2172 | for (j = 0; j < REISERFS_MAXQUOTAS; j++) |
2173 | kfree(qf_names[j]); | 2173 | kfree(qf_names[j]); |
2174 | } | 2174 | } |
2175 | #endif | 2175 | #endif |