Whamcloud - gitweb
Branch b1_6
[fs/lustre-release.git] / lustre / liblustre / lutil.c
index b4689d5..250c70e 100644 (file)
@@ -104,11 +104,11 @@ static int get_ipv4_addr()
 
 void liblustre_init_random()
 {
-        int _rand_dev_fd;
         int seed[2];
         struct timeval tv;
 
 #ifdef LIBLUSTRE_USE_URANDOM
+        int _rand_dev_fd;
         _rand_dev_fd = syscall(SYS_open, "/dev/urandom", O_RDONLY);
         if (_rand_dev_fd >= 0) {
                 if (syscall(SYS_read, _rand_dev_fd,
@@ -129,32 +129,6 @@ void liblustre_init_random()
         ll_srand(tv.tv_sec ^ __swab32(seed[0]), tv.tv_usec ^__swab32(getpid()));
 }
 
-void get_random_bytes(void *buf, int size)
-{
-        int *p = buf;
-        int rem;
-        LASSERT(size >= 0);
-
-        rem = min((unsigned long)buf & (sizeof(int) - 1), size);
-        if (rem) {
-                int val = ll_rand();
-                memcpy(buf, &val, rem);
-                p = buf + rem;
-                size -= rem;
-        }
-
-        while (size >= sizeof(int)) {
-                *p = ll_rand();
-                size -= sizeof(int);
-                p++;
-        }
-        buf = p;
-        if (size) {
-                int val = ll_rand();
-                memcpy(buf, &val, size);
-        }
-}
 static void init_capability(int *res)
 {
 #ifdef HAVE_LIBCAP
@@ -238,11 +212,6 @@ int liblustre_init_current(char *comm)
         return 0;
 }
 
-void generate_random_uuid(unsigned char uuid_out[16])
-{
-        get_random_bytes(uuid_out, sizeof(uuid_out));
-}
-
 int init_lib_portals()
 {
         int rc;