From: Jason A. Donenfeld Date: Wed, 15 Mar 2023 14:31:07 +0000 (+0100) Subject: treewide: use get_random_u32_below() instead of deprecated function X-Git-Tag: v6.2.0~10 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=9a046f967f9f312acec6963947e98f9e69d4b58c;p=thirdparty%2Fxfsprogs-dev.git treewide: use get_random_u32_below() instead of deprecated function Source kernel commit: 8032bf1233a74627ce69b803608e650f3f35971c This is a simple mechanical transformation done by: @@ expression E; @@ - prandom_u32_max + get_random_u32_below (E) Reviewed-by: Kees Cook Reviewed-by: Greg Kroah-Hartman Acked-by: Darrick J. Wong # for xfs Reviewed-by: SeongJae Park # for damon Reviewed-by: Jason Gunthorpe # for infiniband Reviewed-by: Russell King (Oracle) # for arm Acked-by: Ulf Hansson # for mmc Signed-off-by: Jason A. Donenfeld Signed-off-by: Carlos Maiolino --- diff --git a/libxfs/xfs_alloc.c b/libxfs/xfs_alloc.c index 8c2c2e832..80915ab47 100644 --- a/libxfs/xfs_alloc.c +++ b/libxfs/xfs_alloc.c @@ -1512,7 +1512,7 @@ xfs_alloc_ag_vextent_lastblock( #ifdef DEBUG /* Randomly don't execute the first algorithm. */ - if (prandom_u32_max(2)) + if (get_random_u32_below(2)) return 0; #endif diff --git a/libxfs/xfs_ialloc.c b/libxfs/xfs_ialloc.c index e05aa0c11..fe7a689a6 100644 --- a/libxfs/xfs_ialloc.c +++ b/libxfs/xfs_ialloc.c @@ -631,7 +631,7 @@ xfs_ialloc_ag_alloc( /* randomly do sparse inode allocations */ if (xfs_has_sparseinodes(tp->t_mountp) && igeo->ialloc_min_blks < igeo->ialloc_blks) - do_sparse = prandom_u32_max(2); + do_sparse = get_random_u32_below(2); #endif /*