staging: lustre: replace cfs_get_random_bytes calls with get_random_byte()
authorNeilBrown <neilb@suse.com>
Mon, 18 Dec 2017 01:41:42 +0000 (12:41 +1100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 8 Jan 2018 15:03:44 +0000 (16:03 +0100)
The cfs_get_random_bytes() interface adds nothing of value
to get_random_byte() (which it uses internally).  So just use the
standard interface.

Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/lustre/lustre/include/obd_class.h
drivers/staging/lustre/lustre/obdclass/lustre_handles.c
drivers/staging/lustre/lustre/ptlrpc/client.c

index 67c535c5aa98698e1a4e37ff7cc933631d18f477..25db7ec6ecd055c2c738b7f2b134ac04ea992036 100644 (file)
@@ -1562,7 +1562,7 @@ int class_procfs_init(void);
 int class_procfs_clean(void);
 
 /* prng.c */
-#define ll_generate_random_uuid(uuid_out) cfs_get_random_bytes(uuid_out, sizeof(class_uuid_t))
+#define ll_generate_random_uuid(uuid_out) get_random_bytes(uuid_out, sizeof(class_uuid_t))
 
 /* statfs_pack.c */
 struct kstatfs;
index d1b6c2f134d70f80f806bbb367f1c87aa334b82d..2d6da2431a09e175a10204bbe7a9224e7e0c136d 100644 (file)
@@ -196,7 +196,7 @@ int class_handle_init(void)
                spin_lock_init(&bucket->lock);
        }
 
-       cfs_get_random_bytes(&handle_base, sizeof(handle_base));
+       get_random_bytes(&handle_base, sizeof(handle_base));
        LASSERT(handle_base != 0ULL);
 
        return 0;
index 2a9f2f2ebaa83308d7628e6e37672f756846a13b..bac4b2304bad749dfd44c649c0c67bd173350e68 100644 (file)
@@ -3067,7 +3067,7 @@ void ptlrpc_init_xid(void)
 
        spin_lock_init(&ptlrpc_last_xid_lock);
        if (now < YEAR_2004) {
-               cfs_get_random_bytes(&ptlrpc_last_xid, sizeof(ptlrpc_last_xid));
+               get_random_bytes(&ptlrpc_last_xid, sizeof(ptlrpc_last_xid));
                ptlrpc_last_xid >>= 2;
                ptlrpc_last_xid |= (1ULL << 61);
        } else {