Whamcloud - gitweb
LU-6142 obdclass: Fix style issues for lustre_handles.c 80/33080/2
authorArshad Hussain <arshad.super@gmail.com>
Sat, 25 Aug 2018 21:39:24 +0000 (03:09 +0530)
committerOleg Drokin <green@whamcloud.com>
Sat, 1 Sep 2018 03:29:12 +0000 (03:29 +0000)
This patch fixes issues reported by checkpatch
for file lustre/obdclass/lustre_handles.c

Change-Id: I6e6ad8c56e225dcdd3707bf5f3b233eda3f90320
Test-Parameters: trivial
Signed-off-by: Arshad Hussain <arshad.super@gmail.com>
Reviewed-on: https://review.whamcloud.com/33080
Tested-by: Jenkins
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: James Simmons <uja.ornl@yahoo.com>
lustre/obdclass/lustre_handles.c

index 386931b..4161b2d 100644 (file)
@@ -46,7 +46,7 @@ static __u64 handle_base;
 static DEFINE_SPINLOCK(handle_base_lock);
 
 static struct handle_bucket {
-       spinlock_t       lock;
+       spinlock_t lock;
        struct list_head head;
 } *handle_hash;
 
@@ -60,16 +60,17 @@ static struct handle_bucket {
 void class_handle_hash(struct portals_handle *h,
                       struct portals_handle_ops *ops)
 {
-        struct handle_bucket *bucket;
-        ENTRY;
+       struct handle_bucket *bucket;
+
+       ENTRY;
 
-        LASSERT(h != NULL);
+       LASSERT(h != NULL);
        LASSERT(list_empty(&h->h_link));
 
-        /*
-         * This is fast, but simplistic cookie generation algorithm, it will
-         * need a re-do at some point in the future for security.
-         */
+       /*
+        * This is fast, but simplistic cookie generation algorithm, it will
+        * need a re-do at some point in the future for security.
+        */
        spin_lock(&handle_base_lock);
        handle_base += HANDLE_INCR;
 
@@ -104,12 +105,12 @@ static void class_handle_unhash_nolock(struct portals_handle *h)
 {
        if (list_empty(&h->h_link)) {
                CERROR("removing an already-removed handle (%#llx)\n",
-                       h->h_cookie);
-                return;
-        }
+                      h->h_cookie);
+               return;
+       }
 
        CDEBUG(D_INFO, "removing object %p with handle %#llx from hash\n",
-               h, h->h_cookie);
+              h, h->h_cookie);
 
        spin_lock(&h->h_lock);
        if (h->h_in == 0) {
@@ -150,21 +151,24 @@ EXPORT_SYMBOL(class_handle_hash_back);
 
 void *class_handle2object(__u64 cookie, const void *owner)
 {
-        struct handle_bucket *bucket;
-        struct portals_handle *h;
-        void *retval = NULL;
-        ENTRY;
+       struct handle_bucket *bucket;
+       struct portals_handle *h;
+       void *retval = NULL;
+
+       ENTRY;
 
-        LASSERT(handle_hash != NULL);
+       LASSERT(handle_hash != NULL);
 
-       /* Be careful when you want to change this code. See the
-        * rcu_read_lock() definition on top this file. - jxiong */
-        bucket = handle_hash + (cookie & HANDLE_HASH_MASK);
+       /*
+        * Be careful when you want to change this code. See the
+        * rcu_read_lock() definition on top this file. - jxiong
+        */
+       bucket = handle_hash + (cookie & HANDLE_HASH_MASK);
 
-        rcu_read_lock();
-        list_for_each_entry_rcu(h, &bucket->head, h_link) {
+       rcu_read_lock();
+       list_for_each_entry_rcu(h, &bucket->head, h_link) {
                if (h->h_cookie != cookie || h->h_owner != owner)
-                        continue;
+                       continue;
 
                spin_lock(&h->h_lock);
                if (likely(h->h_in != 0)) {
@@ -197,15 +201,15 @@ EXPORT_SYMBOL(class_handle_free_cb);
 
 int class_handle_init(void)
 {
-        struct handle_bucket *bucket;
+       struct handle_bucket *bucket;
        struct timespec64 ts;
-        int seed[2];
+       int seed[2];
 
-        LASSERT(handle_hash == NULL);
+       LASSERT(handle_hash == NULL);
 
-        OBD_ALLOC_LARGE(handle_hash, sizeof(*bucket) * HANDLE_HASH_SIZE);
-        if (handle_hash == NULL)
-                return -ENOMEM;
+       OBD_ALLOC_LARGE(handle_hash, sizeof(*bucket) * HANDLE_HASH_SIZE);
+       if (handle_hash == NULL)
+               return -ENOMEM;
 
        for (bucket = handle_hash + HANDLE_HASH_SIZE - 1; bucket >= handle_hash;
             bucket--) {
@@ -218,10 +222,10 @@ int class_handle_init(void)
        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);
+       cfs_get_random_bytes(&handle_base, sizeof(handle_base));
+       LASSERT(handle_base != 0ULL);
 
-        return 0;
+       return 0;
 }
 
 static int cleanup_all_handles(void)
@@ -248,14 +252,15 @@ static int cleanup_all_handles(void)
 
 void class_handle_cleanup(void)
 {
-        int count;
-        LASSERT(handle_hash != NULL);
+       int count;
+
+       LASSERT(handle_hash != NULL);
 
-        count = cleanup_all_handles();
+       count = cleanup_all_handles();
 
-        OBD_FREE_LARGE(handle_hash, sizeof(*handle_hash) * HANDLE_HASH_SIZE);
-        handle_hash = NULL;
+       OBD_FREE_LARGE(handle_hash, sizeof(*handle_hash) * HANDLE_HASH_SIZE);
+       handle_hash = NULL;
 
-        if (count != 0)
-                CERROR("handle_count at cleanup: %d\n", count);
+       if (count != 0)
+               CERROR("handle_count at cleanup: %d\n", count);
 }