summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Carlier <devnexen@gmail.com>2026-04-05 18:47:17 +0300
committerJan Kara <jack@suse.cz>2026-04-07 14:19:53 +0300
commit982999538269d5adbd7574098bd12e2c506bacfe (patch)
treeaaeb491fd8f45839e4a1bb079b076eb694549674
parente93ab401da4b2e2c1b8ef2424de2f238d51c8b2d (diff)
downloadlinux-982999538269d5adbd7574098bd12e2c506bacfe.tar.xz
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 <devnexen@gmail.com> Link: https://patch.msgid.link/20260405154717.4705-1-devnexen@gmail.com Signed-off-by: Jan Kara <jack@suse.cz>
-rw-r--r--fs/ext2/super.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/ext2/super.c b/fs/ext2/super.c
index 603f2641fe10..e4136490c883 100644
--- a/fs/ext2/super.c
+++ b/fs/ext2/super.c
@@ -1151,7 +1151,7 @@ static int ext2_fill_super(struct super_block *sb, struct fs_context *fc)
goto failed_mount2;
}
sbi->s_gdb_count = db_count;
- get_random_bytes(&sbi->s_next_generation, sizeof(u32));
+ sbi->s_next_generation = get_random_u32();
spin_lock_init(&sbi->s_next_gen_lock);
/* per filesystem reservation list head & lock */