+ seed *= GOLDEN_RATIO_PRIME;
+ seed >>= 3;
+ }
+}
+
+unsigned long fill_random_buf(struct frand_state *fs, void *buf,
+ unsigned int len)
+{
+ unsigned long r = __rand(fs);
+
+ if (sizeof(int) != sizeof(long *))
+ r *= (unsigned long) __rand(fs);
+
+ __fill_random_buf(buf, len, r);
+ return r;
+}
+
+unsigned long fill_random_buf_percentage(struct frand_state *fs, void *buf,
+ unsigned int percentage,
+ unsigned int segment, unsigned int len)
+{
+ unsigned long r = __rand(fs);
+ unsigned int this_len;
+
+ if (percentage == 100) {
+ memset(buf, 0, len);
+ return 0;