Skip to content

Commit d0359e4

Browse files
committed
Merge tag 'fs_for_v6.12-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs
Pull quota and isofs updates from Jan Kara: "A few small cleanups in quota and isofs" * tag 'fs_for_v6.12-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs: isofs: Annotate struct SL_component with __counted_by() quota: remove unnecessary error code translation in dquot_quota_enable quota: remove redundant return at end of void function quota: remove unneeded return value of register_quota_format quota: avoid missing put_quota_format when DQUOT_SUSPENDED is passed
2 parents b3f391f + 116249b commit d0359e4

File tree

7 files changed

+15
-28
lines changed

7 files changed

+15
-28
lines changed

fs/isofs/rock.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ struct RR_PN_s {
4444
struct SL_component {
4545
__u8 flags;
4646
__u8 len;
47-
__u8 text[];
47+
__u8 text[] __counted_by(len);
4848
} __attribute__ ((packed));
4949

5050
struct RR_SL_s {

fs/ocfs2/super.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1571,15 +1571,13 @@ static int __init ocfs2_init(void)
15711571

15721572
ocfs2_set_locking_protocol();
15731573

1574-
status = register_quota_format(&ocfs2_quota_format);
1575-
if (status < 0)
1576-
goto out3;
1574+
register_quota_format(&ocfs2_quota_format);
1575+
15771576
status = register_filesystem(&ocfs2_fs_type);
15781577
if (!status)
15791578
return 0;
15801579

15811580
unregister_quota_format(&ocfs2_quota_format);
1582-
out3:
15831581
debugfs_remove(ocfs2_debugfs_root);
15841582
ocfs2_free_mem_caches();
15851583
out2:

fs/quota/dquot.c

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -163,13 +163,12 @@ static struct quota_module_name module_names[] = INIT_QUOTA_MODULE_NAMES;
163163
/* SLAB cache for dquot structures */
164164
static struct kmem_cache *dquot_cachep;
165165

166-
int register_quota_format(struct quota_format_type *fmt)
166+
void register_quota_format(struct quota_format_type *fmt)
167167
{
168168
spin_lock(&dq_list_lock);
169169
fmt->qf_next = quota_formats;
170170
quota_formats = fmt;
171171
spin_unlock(&dq_list_lock);
172-
return 0;
173172
}
174173
EXPORT_SYMBOL(register_quota_format);
175174

@@ -1831,7 +1830,6 @@ void dquot_claim_space_nodirty(struct inode *inode, qsize_t number)
18311830
spin_unlock(&inode->i_lock);
18321831
mark_all_dquot_dirty(dquots);
18331832
srcu_read_unlock(&dquot_srcu, index);
1834-
return;
18351833
}
18361834
EXPORT_SYMBOL(dquot_claim_space_nodirty);
18371835

@@ -1873,7 +1871,6 @@ void dquot_reclaim_space_nodirty(struct inode *inode, qsize_t number)
18731871
spin_unlock(&inode->i_lock);
18741872
mark_all_dquot_dirty(dquots);
18751873
srcu_read_unlock(&dquot_srcu, index);
1876-
return;
18771874
}
18781875
EXPORT_SYMBOL(dquot_reclaim_space_nodirty);
18791876

@@ -2406,7 +2403,7 @@ static int vfs_setup_quota_inode(struct inode *inode, int type)
24062403
int dquot_load_quota_sb(struct super_block *sb, int type, int format_id,
24072404
unsigned int flags)
24082405
{
2409-
struct quota_format_type *fmt = find_quota_format(format_id);
2406+
struct quota_format_type *fmt;
24102407
struct quota_info *dqopt = sb_dqopt(sb);
24112408
int error;
24122409

@@ -2416,6 +2413,7 @@ int dquot_load_quota_sb(struct super_block *sb, int type, int format_id,
24162413
if (WARN_ON_ONCE(flags & DQUOT_SUSPENDED))
24172414
return -EINVAL;
24182415

2416+
fmt = find_quota_format(format_id);
24192417
if (!fmt)
24202418
return -ESRCH;
24212419
if (!sb->dq_op || !sb->s_qcop ||
@@ -2596,7 +2594,8 @@ static int dquot_quota_enable(struct super_block *sb, unsigned int flags)
25962594
goto out_err;
25972595
}
25982596
if (sb_has_quota_limits_enabled(sb, type)) {
2599-
ret = -EBUSY;
2597+
/* compatible with XFS */
2598+
ret = -EEXIST;
26002599
goto out_err;
26012600
}
26022601
spin_lock(&dq_state_lock);
@@ -2610,9 +2609,6 @@ static int dquot_quota_enable(struct super_block *sb, unsigned int flags)
26102609
if (flags & qtype_enforce_flag(type))
26112610
dquot_disable(sb, type, DQUOT_LIMITS_ENABLED);
26122611
}
2613-
/* Error code translation for better compatibility with XFS */
2614-
if (ret == -EBUSY)
2615-
ret = -EEXIST;
26162612
return ret;
26172613
}
26182614

fs/quota/quota_v1.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,8 @@ static struct quota_format_type v1_quota_format = {
235235

236236
static int __init init_v1_quota_format(void)
237237
{
238-
return register_quota_format(&v1_quota_format);
238+
register_quota_format(&v1_quota_format);
239+
return 0;
239240
}
240241

241242
static void __exit exit_v1_quota_format(void)

fs/quota/quota_v2.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -440,12 +440,9 @@ static struct quota_format_type v2r1_quota_format = {
440440

441441
static int __init init_v2_quota_format(void)
442442
{
443-
int ret;
444-
445-
ret = register_quota_format(&v2r0_quota_format);
446-
if (ret)
447-
return ret;
448-
return register_quota_format(&v2r1_quota_format);
443+
register_quota_format(&v2r0_quota_format);
444+
register_quota_format(&v2r1_quota_format);
445+
return 0;
449446
}
450447

451448
static void __exit exit_v2_quota_format(void)

include/linux/quota.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -526,7 +526,7 @@ struct quota_info {
526526
const struct quota_format_ops *ops[MAXQUOTAS]; /* Operations for each type */
527527
};
528528

529-
int register_quota_format(struct quota_format_type *fmt);
529+
void register_quota_format(struct quota_format_type *fmt);
530530
void unregister_quota_format(struct quota_format_type *fmt);
531531

532532
struct quota_module_name {

mm/shmem.c

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4961,11 +4961,7 @@ void __init shmem_init(void)
49614961
shmem_init_inodecache();
49624962

49634963
#ifdef CONFIG_TMPFS_QUOTA
4964-
error = register_quota_format(&shmem_quota_format);
4965-
if (error < 0) {
4966-
pr_err("Could not register quota format\n");
4967-
goto out3;
4968-
}
4964+
register_quota_format(&shmem_quota_format);
49694965
#endif
49704966

49714967
error = register_filesystem(&shmem_fs_type);
@@ -5000,7 +4996,6 @@ void __init shmem_init(void)
50004996
out2:
50014997
#ifdef CONFIG_TMPFS_QUOTA
50024998
unregister_quota_format(&shmem_quota_format);
5003-
out3:
50044999
#endif
50055000
shmem_destroy_inodecache();
50065001
shm_mnt = ERR_PTR(error);

0 commit comments

Comments
 (0)