diff options
Diffstat (limited to 'drivers/staging/lustre/lustre/obdclass/lustre_handles.c')
-rw-r--r-- | drivers/staging/lustre/lustre/obdclass/lustre_handles.c | 22 |
1 files changed, 5 insertions, 17 deletions
diff --git a/drivers/staging/lustre/lustre/obdclass/lustre_handles.c b/drivers/staging/lustre/lustre/obdclass/lustre_handles.c index 35a94a8f4fd3..fb9147cc607f 100644 --- a/drivers/staging/lustre/lustre/obdclass/lustre_handles.c +++ b/drivers/staging/lustre/lustre/obdclass/lustre_handles.c @@ -44,7 +44,6 @@ #include "../include/lustre_handles.h" #include "../include/lustre_lib.h" - static __u64 handle_base; #define HANDLE_INCR 7 static spinlock_t handle_base_lock; @@ -126,6 +125,7 @@ static void class_handle_unhash_nolock(struct portals_handle *h) void class_handle_unhash(struct portals_handle *h) { struct handle_bucket *bucket; + bucket = handle_hash + (h->h_cookie & HANDLE_HASH_MASK); spin_lock(&bucket->lock); @@ -134,19 +134,6 @@ void class_handle_unhash(struct portals_handle *h) } EXPORT_SYMBOL(class_handle_unhash); -void class_handle_hash_back(struct portals_handle *h) -{ - struct handle_bucket *bucket; - - bucket = handle_hash + (h->h_cookie & HANDLE_HASH_MASK); - - spin_lock(&bucket->lock); - list_add_rcu(&h->h_link, &bucket->head); - h->h_in = 1; - spin_unlock(&bucket->lock); -} -EXPORT_SYMBOL(class_handle_hash_back); - void *class_handle2object(__u64 cookie) { struct handle_bucket *bucket; @@ -193,7 +180,7 @@ EXPORT_SYMBOL(class_handle_free_cb); int class_handle_init(void) { struct handle_bucket *bucket; - struct timeval tv; + struct timespec64 ts; int seed[2]; LASSERT(handle_hash == NULL); @@ -212,8 +199,8 @@ int class_handle_init(void) /** bug 21430: add randomness to the initial base */ cfs_get_random_bytes(seed, sizeof(seed)); - do_gettimeofday(&tv); - cfs_srand(tv.tv_sec ^ seed[0], tv.tv_usec ^ seed[1]); + ktime_get_ts64(&ts); + cfs_srand(ts.tv_sec ^ seed[0], ts.tv_nsec ^ seed[1]); cfs_get_random_bytes(&handle_base, sizeof(handle_base)); LASSERT(handle_base != 0ULL); @@ -246,6 +233,7 @@ static int cleanup_all_handles(void) void class_handle_cleanup(void) { int count; + LASSERT(handle_hash != NULL); count = cleanup_all_handles(); |