Skip to content

Commit ebc11f7

Browse files
cgxu519tytso
authored andcommitted
ext4: code cleanup for get_next_id
Now the checks in ext4_get_next_id() and dquot_get_next_id() are almost the same, so just call dquot_get_next_id() instead of ext4_get_next_id(). Signed-off-by: Chengguang Xu <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Theodore Ts'o <[email protected]>
1 parent f4c2d37 commit ebc11f7

File tree

1 file changed

+1
-14
lines changed

1 file changed

+1
-14
lines changed

fs/ext4/super.c

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1374,7 +1374,6 @@ static ssize_t ext4_quota_write(struct super_block *sb, int type,
13741374
static int ext4_quota_enable(struct super_block *sb, int type, int format_id,
13751375
unsigned int flags);
13761376
static int ext4_enable_quotas(struct super_block *sb);
1377-
static int ext4_get_next_id(struct super_block *sb, struct kqid *qid);
13781377

13791378
static struct dquot **ext4_get_dquots(struct inode *inode)
13801379
{
@@ -1392,7 +1391,7 @@ static const struct dquot_operations ext4_quota_operations = {
13921391
.destroy_dquot = dquot_destroy,
13931392
.get_projid = ext4_get_projid,
13941393
.get_inode_usage = ext4_get_inode_usage,
1395-
.get_next_id = ext4_get_next_id,
1394+
.get_next_id = dquot_get_next_id,
13961395
};
13971396

13981397
static const struct quotactl_ops ext4_qctl_operations = {
@@ -6002,18 +6001,6 @@ static ssize_t ext4_quota_write(struct super_block *sb, int type,
60026001
}
60036002
return len;
60046003
}
6005-
6006-
static int ext4_get_next_id(struct super_block *sb, struct kqid *qid)
6007-
{
6008-
const struct quota_format_ops *ops;
6009-
6010-
if (!sb_has_quota_loaded(sb, qid->type))
6011-
return -ESRCH;
6012-
ops = sb_dqopt(sb)->ops[qid->type];
6013-
if (!ops || !ops->get_next_id)
6014-
return -ENOSYS;
6015-
return dquot_get_next_id(sb, qid);
6016-
}
60176004
#endif
60186005

60196006
static struct dentry *ext4_mount(struct file_system_type *fs_type, int flags,

0 commit comments

Comments
 (0)