* [PATCH v3] ocfs2: use get_random_u32() where appropriate
@ 2026-04-05 15:47 David Carlier
2026-04-07 1:57 ` Joseph Qi
0 siblings, 1 reply; 2+ messages in thread
From: David Carlier @ 2026-04-05 15:47 UTC (permalink / raw)
To: Joseph Qi
Cc: Mark Fasheh, Joel Becker, ocfs2-devel, linux-kernel,
David Carlier
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>
---
fs/ocfs2/super.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/ocfs2/super.c b/fs/ocfs2/super.c
index d7c58fd7d438..b875f01c9756 100644
--- a/fs/ocfs2/super.c
+++ b/fs/ocfs2/super.c
@@ -2124,7 +2124,7 @@ static int ocfs2_initialize_super(struct super_block *sb,
osb->osb_cluster_stack[0] = '\0';
}
- get_random_bytes(&osb->s_next_generation, sizeof(u32));
+ osb->s_next_generation = get_random_u32();
/*
* FIXME
--
2.53.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH v3] ocfs2: use get_random_u32() where appropriate
2026-04-05 15:47 [PATCH v3] ocfs2: use get_random_u32() where appropriate David Carlier
@ 2026-04-07 1:57 ` Joseph Qi
0 siblings, 0 replies; 2+ messages in thread
From: Joseph Qi @ 2026-04-07 1:57 UTC (permalink / raw)
To: David Carlier, akpm; +Cc: Mark Fasheh, Joel Becker, ocfs2-devel, linux-kernel
On 4/5/26 11:47 PM, David Carlier wrote:
> 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>
Acked-by: Joseph Qi <joseph.qi@linux.alibaba.com>
> ---
> fs/ocfs2/super.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/fs/ocfs2/super.c b/fs/ocfs2/super.c
> index d7c58fd7d438..b875f01c9756 100644
> --- a/fs/ocfs2/super.c
> +++ b/fs/ocfs2/super.c
> @@ -2124,7 +2124,7 @@ static int ocfs2_initialize_super(struct super_block *sb,
> osb->osb_cluster_stack[0] = '\0';
> }
>
> - get_random_bytes(&osb->s_next_generation, sizeof(u32));
> + osb->s_next_generation = get_random_u32();
>
> /*
> * FIXME
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-04-07 1:57 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-05 15:47 [PATCH v3] ocfs2: use get_random_u32() where appropriate David Carlier
2026-04-07 1:57 ` Joseph Qi
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.