Skip to content

Commit 9829995

Browse files
devnexenjankara
authored andcommitted
ext2: use get_random_u32() where appropriate
Use the typed random integer helpers instead of get_random_bytes() when filling a single integer variable. The helpers return the value directly, require no pointer or size argument, and better express intent. Signed-off-by: David Carlier <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jan Kara <[email protected]>
1 parent e93ab40 commit 9829995

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

fs/ext2/super.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1151,7 +1151,7 @@ static int ext2_fill_super(struct super_block *sb, struct fs_context *fc)
11511151
goto failed_mount2;
11521152
}
11531153
sbi->s_gdb_count = db_count;
1154-
get_random_bytes(&sbi->s_next_generation, sizeof(u32));
1154+
sbi->s_next_generation = get_random_u32();
11551155
spin_lock_init(&sbi->s_next_gen_lock);
11561156

11571157
/* per filesystem reservation list head & lock */

0 commit comments

Comments
 (0)