Whamcloud - gitweb
LU-6142 lov: Fix style issues for lovsub_dev.c 43/33543/2
authorArshad Hussain <arshad.super@gmail.com>
Sun, 21 Oct 2018 20:53:21 +0000 (02:23 +0530)
committerOleg Drokin <green@whamcloud.com>
Tue, 6 Nov 2018 06:40:51 +0000 (06:40 +0000)
This patch fixes issues reported by checkpatch for file
lustre/lov/lovsub_dev.c

Change-Id: Ideacff81ab326602f9889ef48be123851950ae8e
Test-Parameters: trivial
Signed-off-by: Arshad Hussain <arshad.super@gmail.com>
Reviewed-on: https://review.whamcloud.com/33543
Tested-by: Jenkins
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Ben Evans <bevans@cray.com>
lustre/lov/lovsub_dev.c

index a21aeeb..90a11e7 100644 (file)
  */
 
 static int lovsub_device_init(const struct lu_env *env, struct lu_device *d,
-                              const char *name, struct lu_device *next)
+                             const char *name, struct lu_device *next)
 {
-        struct lovsub_device  *lsd = lu2lovsub_dev(d);
-        struct lu_device_type *ldt;
-        int rc;
-
-        ENTRY;
-        next->ld_site = d->ld_site;
-        ldt = next->ld_type;
-        LASSERT(ldt != NULL);
-        rc = ldt->ldt_ops->ldto_device_init(env, next, ldt->ldt_name, NULL);
-        if (rc) {
-                next->ld_site = NULL;
-                RETURN(rc);
-        }
-
-        lu_device_get(next);
-        lu_ref_add(&next->ld_reference, "lu-stack", &lu_site_init);
-        lsd->acid_next = lu2cl_dev(next);
-        RETURN(rc);
+       struct lovsub_device  *lsd = lu2lovsub_dev(d);
+       struct lu_device_type *ldt;
+       int rc;
+
+       ENTRY;
+       next->ld_site = d->ld_site;
+       ldt = next->ld_type;
+       LASSERT(ldt != NULL);
+       rc = ldt->ldt_ops->ldto_device_init(env, next, ldt->ldt_name, NULL);
+       if (rc) {
+               next->ld_site = NULL;
+               RETURN(rc);
+       }
+
+       lu_device_get(next);
+       lu_ref_add(&next->ld_reference, "lu-stack", &lu_site_init);
+       lsd->acid_next = lu2cl_dev(next);
+       RETURN(rc);
 }
 
 static struct lu_device *lovsub_device_fini(const struct lu_env *env,
-                                            struct lu_device *d)
+                                           struct lu_device *d)
 {
-        struct lu_device *next;
-        struct lovsub_device *lsd;
+       struct lu_device *next;
+       struct lovsub_device *lsd;
 
        ENTRY;
        lsd = lu2lovsub_dev(d);
@@ -87,8 +87,8 @@ static struct lu_device *lovsub_device_fini(const struct lu_env *env,
 static struct lu_device *lovsub_device_free(const struct lu_env *env,
                                            struct lu_device *d)
 {
-       struct lovsub_device *lsd  = lu2lovsub_dev(d);
-       struct lu_device     *next = cl2lu_dev(lsd->acid_next);
+       struct lovsub_device *lsd = lu2lovsub_dev(d);
+       struct lu_device *next = cl2lu_dev(lsd->acid_next);
 
        if (atomic_read(&d->ld_ref) && d->ld_site) {
                LIBCFS_DEBUG_MSG_DATA_DECL(msgdata, D_ERROR, NULL);
@@ -100,48 +100,48 @@ static struct lu_device *lovsub_device_free(const struct lu_env *env,
 }
 
 static const struct lu_device_operations lovsub_lu_ops = {
-        .ldo_object_alloc      = lovsub_object_alloc,
-        .ldo_process_config    = NULL,
-        .ldo_recovery_complete = NULL
+       .ldo_object_alloc      = lovsub_object_alloc,
+       .ldo_process_config    = NULL,
+       .ldo_recovery_complete = NULL
 };
 
 static struct lu_device *lovsub_device_alloc(const struct lu_env *env,
-                                             struct lu_device_type *t,
-                                             struct lustre_cfg *cfg)
+                                            struct lu_device_type *t,
+                                            struct lustre_cfg *cfg)
 {
-        struct lu_device     *d;
-        struct lovsub_device *lsd;
-
-        OBD_ALLOC_PTR(lsd);
-        if (lsd != NULL) {
-                int result;
-
-                result = cl_device_init(&lsd->acid_cl, t);
-                if (result == 0) {
-                        d = lovsub2lu_dev(lsd);
-                        d->ld_ops         = &lovsub_lu_ops;
-                } else
-                        d = ERR_PTR(result);
-        } else
-                d = ERR_PTR(-ENOMEM);
-        return d;
+       struct lu_device *d;
+       struct lovsub_device *lsd;
+
+       OBD_ALLOC_PTR(lsd);
+       if (lsd) {
+               int result;
+
+               result = cl_device_init(&lsd->acid_cl, t);
+               if (result == 0) {
+                       d = lovsub2lu_dev(lsd);
+                       d->ld_ops         = &lovsub_lu_ops;
+               } else
+                       d = ERR_PTR(result);
+       } else
+               d = ERR_PTR(-ENOMEM);
+       return d;
 }
 
 static const struct lu_device_type_operations lovsub_device_type_ops = {
-        .ldto_device_alloc = lovsub_device_alloc,
-        .ldto_device_free  = lovsub_device_free,
+       .ldto_device_alloc = lovsub_device_alloc,
+       .ldto_device_free = lovsub_device_free,
 
-        .ldto_device_init    = lovsub_device_init,
-        .ldto_device_fini    = lovsub_device_fini
+       .ldto_device_init = lovsub_device_init,
+       .ldto_device_fini = lovsub_device_fini
 };
 
 #define LUSTRE_LOVSUB_NAME         "lovsub"
 
 struct lu_device_type lovsub_device_type = {
-        .ldt_tags     = LU_DEVICE_CL,
-        .ldt_name     = LUSTRE_LOVSUB_NAME,
-        .ldt_ops      = &lovsub_device_type_ops,
-        .ldt_ctx_tags = LCT_CL_THREAD
+       .ldt_tags     = LU_DEVICE_CL,
+       .ldt_name     = LUSTRE_LOVSUB_NAME,
+       .ldt_ops      = &lovsub_device_type_ops,
+       .ldt_ctx_tags = LCT_CL_THREAD
 };