Skip to content

Commit

Permalink
swapfile: let others seed random
Browse files Browse the repository at this point in the history
Remove the srandom32((u32)get_seconds()) from non-rotational swapon:
there's been a coincidental discussion of earlier randomization, assume
that goes ahead, let swapon be a client rather than stirring for itself.

Signed-off-by: Hugh Dickins <hugh@veritas.com>
Cc: David Woodhouse <dwmw2@infradead.org>
Cc: Donjun Shin <djshin90@gmail.com>
Cc: James Bottomley <James.Bottomley@HansenPartnership.com>
Cc: Jens Axboe <jens.axboe@oracle.com>
Cc: Joern Engel <joern@logfs.org>
Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: Matthew Wilcox <matthew@wil.cx>
Cc: Nick Piggin <nickpiggin@yahoo.com.au>
Cc: Tejun Heo <teheo@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Hugh Dickins authored and torvalds committed Jan 6, 2009
1 parent 858a299 commit f0d7a4b
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion mm/swapfile.c
Original file line number Diff line number Diff line change
Expand Up @@ -1851,7 +1851,6 @@ asmlinkage long sys_swapon(const char __user * specialfile, int swap_flags)

if (blk_queue_nonrot(bdev_get_queue(p->bdev))) {
p->flags |= SWP_SOLIDSTATE;
srandom32((u32)get_seconds());
p->cluster_next = 1 + (random32() % p->highest_bit);
}
if (discard_swap(p) == 0)
Expand Down

0 comments on commit f0d7a4b

Please sign in to comment.