*/
#define DEBUG_SUBSYSTEM S_RPC
+
+#include <linux/random.h>
+
#include <obd_support.h>
#include <obd_class.h>
#include "ptlrpc_internal.h"
if (delay_data->delay_pct == 0 || /* Not delaying anything */
(delay_data->delay_pct != 100 &&
- delay_data->delay_pct < cfs_rand() % 100))
+ delay_data->delay_pct < prandom_u32_max(100)))
return 1;
- nrq->nr_u.delay.req_start_time = ktime_get_real_seconds() + cfs_rand() %
- (delay_data->max_delay -
- delay_data->min_delay + 1) +
+ nrq->nr_u.delay.req_start_time = ktime_get_real_seconds() +
+ prandom_u32_max(delay_data->max_delay - delay_data->min_delay + 1) +
delay_data->min_delay;
return cfs_binheap_insert(delay_data->delay_binheap, &nrq->nr_node);
{ NULL }
};
- if (IS_ERR_OR_NULL(svc->srv_debugfs_entry))
+ if (!svc->srv_debugfs_entry)
return 0;
return ldebugfs_add_vars(svc->srv_debugfs_entry, nrs_delay_lprocfs_vars,