diff options
author | Theodore Ts'o <tytso@mit.edu> | 2013-11-08 00:14:53 -0500 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2013-11-08 00:14:53 -0500 |
commit | dd1f723bf56bd96efc9d90e9e60dc511c79de48f (patch) | |
tree | 3860500165c69c225ccd5121f2ffde93dfbf4f02 /fs/ext4/ialloc.c | |
parent | f2754114400afe38ad5ade3b588451c4f36a61af (diff) | |
download | linux-dd1f723bf56bd96efc9d90e9e60dc511c79de48f.tar.bz2 |
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>
Diffstat (limited to 'fs/ext4/ialloc.c')
-rw-r--r-- | fs/ext4/ialloc.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/ext4/ialloc.c b/fs/ext4/ialloc.c index 137193ff389b..0ee59a6644e2 100644 --- a/fs/ext4/ialloc.c +++ b/fs/ext4/ialloc.c @@ -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; |