mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-09 08:02:05 +00:00
ext4: use prandom_u32() instead of get_random_bytes()
Many of the uses of get_random_bytes() do not actually need cryptographically secure random numbers. Replace those uses with a call to prandom_u32(), which is faster and which doesn't consume entropy from the /dev/random driver. Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
This commit is contained in:
parent
f275411440
commit
dd1f723bf5
3 changed files with 4 additions and 7 deletions
|
@ -432,7 +432,7 @@ static int find_group_orlov(struct super_block *sb, struct inode *parent,
|
|||
ext4fs_dirhash(qstr->name, qstr->len, &hinfo);
|
||||
grp = hinfo.hash;
|
||||
} else
|
||||
get_random_bytes(&grp, sizeof(grp));
|
||||
grp = prandom_u32();
|
||||
parent_group = (unsigned)grp % ngroups;
|
||||
for (i = 0; i < ngroups; i++) {
|
||||
g = (parent_group + i) % ngroups;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue