summaryrefslogtreecommitdiff
path: root/fs/ext4/mmp.c
diff options
context:
space:
mode:
authorTheodore Ts'o <tytso@mit.edu>2013-11-08 09:14:53 +0400
committerTheodore Ts'o <tytso@mit.edu>2013-11-08 09:14:53 +0400
commitdd1f723bf56bd96efc9d90e9e60dc511c79de48f (patch)
tree3860500165c69c225ccd5121f2ffde93dfbf4f02 /fs/ext4/mmp.c
parentf2754114400afe38ad5ade3b588451c4f36a61af (diff)
downloadlinux-dd1f723bf56bd96efc9d90e9e60dc511c79de48f.tar.xz
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/mmp.c')
-rw-r--r--fs/ext4/mmp.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/ext4/mmp.c b/fs/ext4/mmp.c
index 214461e42a05..04434ad3e8e0 100644
--- a/fs/ext4/mmp.c
+++ b/fs/ext4/mmp.c
@@ -259,7 +259,7 @@ static unsigned int mmp_new_seq(void)
u32 new_seq;
do {
- get_random_bytes(&new_seq, sizeof(u32));
+ new_seq = prandom_u32();
} while (new_seq > EXT4_MMP_SEQ_MAX);
return new_seq;