Whamcloud - gitweb
LU-3709 lmv: update coding style
[fs/lustre-release.git] / lustre / lmv / lmv_obd.c
index 5f8a2ee..3bcc81f 100644 (file)
@@ -45,7 +45,6 @@
 #include <asm/div64.h>
 #include <linux/seq_file.h>
 #include <linux/namei.h>
-#include <asm/uaccess.h>
 #else
 #include <liblustre.h>
 #endif
@@ -842,10 +841,10 @@ static void lmv_hsm_req_build(struct lmv_obd *lmv,
        nr_out = 0;
        for (i = 0; i < hur_in->hur_request.hr_itemcount; i++) {
                curr_tgt = lmv_find_target(lmv,
-                                       &hur_in->hur_user_item[i].hui_fid);
+                                          &hur_in->hur_user_item[i].hui_fid);
                if (obd_uuid_equals(&curr_tgt->ltd_uuid, &tgt_mds->ltd_uuid)) {
                        hur_out->hur_user_item[nr_out] =
-                               hur_in->hur_user_item[i];
+                                               hur_in->hur_user_item[i];
                        nr_out++;
                }
        }
@@ -893,17 +892,18 @@ static int lmv_hsm_ct_register(struct lmv_obd *lmv, unsigned int cmd, int len,
                if (err) {
                        if (lmv->tgts[i]->ltd_active) {
                                /* permanent error */
-                               CERROR("error: iocontrol MDC %s on MDT"
-                                      "idx %d cmd %x: err = %d\n",
-                                       lmv->tgts[i]->ltd_uuid.uuid,
-                                       i, cmd, err);
+                               CERROR("%s: iocontrol MDC %s on MDT"
+                                      " idx %d cmd %x: err = %d\n",
+                                      class_exp2obd(lmv->exp)->obd_name,
+                                      lmv->tgts[i]->ltd_uuid.uuid,
+                                      i, cmd, err);
                                rc = err;
                                lk->lk_flags |= LK_FLG_STOP;
                                /* unregister from previous MDS */
                                for (j = 0; j < i; j++)
                                        obd_iocontrol(cmd,
-                                                 lmv->tgts[j]->ltd_exp,
-                                                 len, lk, uarg);
+                                                     lmv->tgts[j]->ltd_exp,
+                                                     len, lk, uarg);
                                RETURN(rc);
                        }
                        /* else: transient error.
@@ -967,8 +967,8 @@ static int lmv_iocontrol(unsigned int cmd, struct obd_export *exp,
 
                /* copy UUID */
                if (copy_to_user(data->ioc_pbuf2, obd2cli_tgt(mdc_obd),
-                                    min((int) data->ioc_plen2,
-                                        (int) sizeof(struct obd_uuid))))
+                                min((int) data->ioc_plen2,
+                                    (int) sizeof(struct obd_uuid))))
                        RETURN(-EFAULT);
 
                rc = obd_statfs(NULL, lmv->tgts[index]->ltd_exp, &stat_buf,
@@ -977,8 +977,8 @@ static int lmv_iocontrol(unsigned int cmd, struct obd_export *exp,
                if (rc)
                        RETURN(rc);
                if (copy_to_user(data->ioc_pbuf1, &stat_buf,
-                                    min((int) data->ioc_plen1,
-                                        (int) sizeof(stat_buf))))
+                                min((int) data->ioc_plen1,
+                                    (int) sizeof(stat_buf))))
                        RETURN(-EFAULT);
                break;
         }
@@ -1063,10 +1063,10 @@ static int lmv_iocontrol(unsigned int cmd, struct obd_export *exp,
 
                tgt = lmv_find_target(lmv, &op_data->op_fid1);
                if (IS_ERR(tgt))
-                               RETURN(PTR_ERR(tgt));
+                       RETURN(PTR_ERR(tgt));
 
                if (tgt->ltd_exp == NULL)
-                               RETURN(-EINVAL);
+                       RETURN(-EINVAL);
 
                rc = obd_iocontrol(cmd, tgt->ltd_exp, len, karg, uarg);
                break;
@@ -1112,7 +1112,7 @@ static int lmv_iocontrol(unsigned int cmd, struct obd_export *exp,
                                /* build a request with fids for this MDS */
                                reqlen = offsetof(typeof(*hur),
                                                  hur_user_item[nr])
-                                        + hur->hur_request.hr_data_len;
+                                               + hur->hur_request.hr_data_len;
                                OBD_ALLOC_LARGE(req, reqlen);
                                if (req == NULL)
                                        RETURN(-ENOMEM);
@@ -1177,9 +1177,9 @@ static int lmv_iocontrol(unsigned int cmd, struct obd_export *exp,
                        } else if (err) {
                                if (lmv->tgts[i]->ltd_active) {
                                        CERROR("error: iocontrol MDC %s on MDT"
-                                              "idx %d cmd %x: err = %d\n",
-                                               lmv->tgts[i]->ltd_uuid.uuid,
-                                               i, cmd, err);
+                                              " idx %d cmd %x: err = %d\n",
+                                              lmv->tgts[i]->ltd_uuid.uuid,
+                                              i, cmd, err);
                                        if (!rc)
                                                rc = err;
                                }
@@ -1385,13 +1385,13 @@ static int lmv_setup(struct obd_device *obd, struct lustre_cfg *lcfg)
 
        lprocfs_obd_setup(obd, lvars.obd_vars);
 #ifdef LPROCFS
-        {
-                rc = lprocfs_seq_create(obd->obd_proc_entry, "target_obd",
-                                        0444, &lmv_proc_target_fops, obd);
-                if (rc)
-                        CWARN("%s: error adding LMV target_obd file: rc = %d\n",
-                               obd->obd_name, rc);
-       }
+       {
+               rc = lprocfs_seq_create(obd->obd_proc_entry, "target_obd",
+                                       0444, &lmv_proc_target_fops, obd);
+               if (rc)
+                       CWARN("%s: error adding LMV target_obd file: rc = %d\n",
+                             obd->obd_name, rc);
+       }
 #endif
        rc = fld_client_init(&lmv->lmv_fld, obd->obd_name,
                             LUSTRE_CLI_FLD_HASH_DHT);