summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Kara <jack@suse.cz>2014-09-10 14:48:02 -0400
committerJan Kara <jack@suse.cz>2014-09-17 05:59:11 -0400
commita93114e4688f8ff7aba3a1012f17cfadc054d08b (patch)
tree93eb3580a2fe2a49d2b11295fcfa2ee3f0dcb8ec
parent6fb1ca92a6409a9d5b0696447cd4997bc9aaf5a2 (diff)
ext3: Don't use MAXQUOTAS value
MAXQUOTAS value defines maximum number of quota types VFS supports. This isn't necessarily the number of types ext3 supports and with addition of project quotas these two numbers stop matching. So make ext3 use its private definition. CC: linux-ext4@vger.kernel.org Signed-off-by: Jan Kara <jack@suse.cz>
-rw-r--r--fs/ext3/ext3.h12
-rw-r--r--fs/ext3/super.c14
2 files changed, 14 insertions, 12 deletions
diff --git a/fs/ext3/ext3.h b/fs/ext3/ext3.h
index e85ff15a060e..fc3cdcf24aed 100644
--- a/fs/ext3/ext3.h
+++ b/fs/ext3/ext3.h
@@ -237,6 +237,8 @@ struct ext3_new_group_data {
237#define EXT3_IOC32_GETVERSION_OLD FS_IOC32_GETVERSION 237#define EXT3_IOC32_GETVERSION_OLD FS_IOC32_GETVERSION
238#define EXT3_IOC32_SETVERSION_OLD FS_IOC32_SETVERSION 238#define EXT3_IOC32_SETVERSION_OLD FS_IOC32_SETVERSION
239 239
240/* Number of supported quota types */
241#define EXT3_MAXQUOTAS 2
240 242
241/* 243/*
242 * Mount options 244 * Mount options
@@ -248,7 +250,7 @@ struct ext3_mount_options {
248 unsigned long s_commit_interval; 250 unsigned long s_commit_interval;
249#ifdef CONFIG_QUOTA 251#ifdef CONFIG_QUOTA
250 int s_jquota_fmt; 252 int s_jquota_fmt;
251 char *s_qf_names[MAXQUOTAS]; 253 char *s_qf_names[EXT3_MAXQUOTAS];
252#endif 254#endif
253}; 255};
254 256
@@ -669,7 +671,7 @@ struct ext3_sb_info {
669 unsigned long s_commit_interval; 671 unsigned long s_commit_interval;
670 struct block_device *journal_bdev; 672 struct block_device *journal_bdev;
671#ifdef CONFIG_QUOTA 673#ifdef CONFIG_QUOTA
672 char *s_qf_names[MAXQUOTAS]; /* Names of quota files with journalled quota */ 674 char *s_qf_names[EXT3_MAXQUOTAS]; /* Names of quota files with journalled quota */
673 int s_jquota_fmt; /* Format of quota to use */ 675 int s_jquota_fmt; /* Format of quota to use */
674#endif 676#endif
675}; 677};
@@ -1183,9 +1185,9 @@ extern const struct inode_operations ext3_fast_symlink_inode_operations;
1183#define EXT3_QUOTA_INIT_BLOCKS(sb) 0 1185#define EXT3_QUOTA_INIT_BLOCKS(sb) 0
1184#define EXT3_QUOTA_DEL_BLOCKS(sb) 0 1186#define EXT3_QUOTA_DEL_BLOCKS(sb) 0
1185#endif 1187#endif
1186#define EXT3_MAXQUOTAS_TRANS_BLOCKS(sb) (MAXQUOTAS*EXT3_QUOTA_TRANS_BLOCKS(sb)) 1188#define EXT3_MAXQUOTAS_TRANS_BLOCKS(sb) (EXT3_MAXQUOTAS*EXT3_QUOTA_TRANS_BLOCKS(sb))
1187#define EXT3_MAXQUOTAS_INIT_BLOCKS(sb) (MAXQUOTAS*EXT3_QUOTA_INIT_BLOCKS(sb)) 1189#define EXT3_MAXQUOTAS_INIT_BLOCKS(sb) (EXT3_MAXQUOTAS*EXT3_QUOTA_INIT_BLOCKS(sb))
1188#define EXT3_MAXQUOTAS_DEL_BLOCKS(sb) (MAXQUOTAS*EXT3_QUOTA_DEL_BLOCKS(sb)) 1190#define EXT3_MAXQUOTAS_DEL_BLOCKS(sb) (EXT3_MAXQUOTAS*EXT3_QUOTA_DEL_BLOCKS(sb))
1189 1191
1190int 1192int
1191ext3_mark_iloc_dirty(handle_t *handle, 1193ext3_mark_iloc_dirty(handle_t *handle,
diff --git a/fs/ext3/super.c b/fs/ext3/super.c
index 622e88249024..b79f04bf72fc 100644
--- a/fs/ext3/super.c
+++ b/fs/ext3/super.c
@@ -441,7 +441,7 @@ static void ext3_put_super (struct super_block * sb)
441 percpu_counter_destroy(&sbi->s_dirs_counter); 441 percpu_counter_destroy(&sbi->s_dirs_counter);
442 brelse(sbi->s_sbh); 442 brelse(sbi->s_sbh);
443#ifdef CONFIG_QUOTA 443#ifdef CONFIG_QUOTA
444 for (i = 0; i < MAXQUOTAS; i++) 444 for (i = 0; i < EXT3_MAXQUOTAS; i++)
445 kfree(sbi->s_qf_names[i]); 445 kfree(sbi->s_qf_names[i]);
446#endif 446#endif
447 447
@@ -1555,7 +1555,7 @@ static void ext3_orphan_cleanup (struct super_block * sb,
1555 /* Needed for iput() to work correctly and not trash data */ 1555 /* Needed for iput() to work correctly and not trash data */
1556 sb->s_flags |= MS_ACTIVE; 1556 sb->s_flags |= MS_ACTIVE;
1557 /* Turn on quotas so that they are updated correctly */ 1557 /* Turn on quotas so that they are updated correctly */
1558 for (i = 0; i < MAXQUOTAS; i++) { 1558 for (i = 0; i < EXT3_MAXQUOTAS; i++) {
1559 if (EXT3_SB(sb)->s_qf_names[i]) { 1559 if (EXT3_SB(sb)->s_qf_names[i]) {
1560 int ret = ext3_quota_on_mount(sb, i); 1560 int ret = ext3_quota_on_mount(sb, i);
1561 if (ret < 0) 1561 if (ret < 0)
@@ -1606,7 +1606,7 @@ static void ext3_orphan_cleanup (struct super_block * sb,
1606 PLURAL(nr_truncates)); 1606 PLURAL(nr_truncates));
1607#ifdef CONFIG_QUOTA 1607#ifdef CONFIG_QUOTA
1608 /* Turn quotas off */ 1608 /* Turn quotas off */
1609 for (i = 0; i < MAXQUOTAS; i++) { 1609 for (i = 0; i < EXT3_MAXQUOTAS; i++) {
1610 if (sb_dqopt(sb)->files[i]) 1610 if (sb_dqopt(sb)->files[i])
1611 dquot_quota_off(sb, i); 1611 dquot_quota_off(sb, i);
1612 } 1612 }
@@ -2139,7 +2139,7 @@ failed_mount2:
2139 kfree(sbi->s_group_desc); 2139 kfree(sbi->s_group_desc);
2140failed_mount: 2140failed_mount:
2141#ifdef CONFIG_QUOTA 2141#ifdef CONFIG_QUOTA
2142 for (i = 0; i < MAXQUOTAS; i++) 2142 for (i = 0; i < EXT3_MAXQUOTAS; i++)
2143 kfree(sbi->s_qf_names[i]); 2143 kfree(sbi->s_qf_names[i]);
2144#endif 2144#endif
2145 ext3_blkdev_remove(sbi); 2145 ext3_blkdev_remove(sbi);
@@ -2659,7 +2659,7 @@ static int ext3_remount (struct super_block * sb, int * flags, char * data)
2659 old_opts.s_commit_interval = sbi->s_commit_interval; 2659 old_opts.s_commit_interval = sbi->s_commit_interval;
2660#ifdef CONFIG_QUOTA 2660#ifdef CONFIG_QUOTA
2661 old_opts.s_jquota_fmt = sbi->s_jquota_fmt; 2661 old_opts.s_jquota_fmt = sbi->s_jquota_fmt;
2662 for (i = 0; i < MAXQUOTAS; i++) 2662 for (i = 0; i < EXT3_MAXQUOTAS; i++)
2663 if (sbi->s_qf_names[i]) { 2663 if (sbi->s_qf_names[i]) {
2664 old_opts.s_qf_names[i] = kstrdup(sbi->s_qf_names[i], 2664 old_opts.s_qf_names[i] = kstrdup(sbi->s_qf_names[i],
2665 GFP_KERNEL); 2665 GFP_KERNEL);
@@ -2763,7 +2763,7 @@ static int ext3_remount (struct super_block * sb, int * flags, char * data)
2763 } 2763 }
2764#ifdef CONFIG_QUOTA 2764#ifdef CONFIG_QUOTA
2765 /* Release old quota file names */ 2765 /* Release old quota file names */
2766 for (i = 0; i < MAXQUOTAS; i++) 2766 for (i = 0; i < EXT3_MAXQUOTAS; i++)
2767 kfree(old_opts.s_qf_names[i]); 2767 kfree(old_opts.s_qf_names[i]);
2768#endif 2768#endif
2769 if (enable_quota) 2769 if (enable_quota)
@@ -2777,7 +2777,7 @@ restore_opts:
2777 sbi->s_commit_interval = old_opts.s_commit_interval; 2777 sbi->s_commit_interval = old_opts.s_commit_interval;
2778#ifdef CONFIG_QUOTA 2778#ifdef CONFIG_QUOTA
2779 sbi->s_jquota_fmt = old_opts.s_jquota_fmt; 2779 sbi->s_jquota_fmt = old_opts.s_jquota_fmt;
2780 for (i = 0; i < MAXQUOTAS; i++) { 2780 for (i = 0; i < EXT3_MAXQUOTAS; i++) {
2781 kfree(sbi->s_qf_names[i]); 2781 kfree(sbi->s_qf_names[i]);
2782 sbi->s_qf_names[i] = old_opts.s_qf_names[i]; 2782 sbi->s_qf_names[i] = old_opts.s_qf_names[i];
2783 } 2783 }