]> Pileus Git - ~andy/linux/blobdiff - drivers/staging/lustre/lustre/lmv/lmv_obd.c
staging: lustre: remove ENTRY macro
[~andy/linux] / drivers / staging / lustre / lustre / lmv / lmv_obd.c
index 1eebfbf34871fa9a24ae0d543d00843d8f4323c9..2970f584539d9f88a9291bb49e71e86baa8dcc65 100644 (file)
 #include <linux/slab.h>
 #include <linux/module.h>
 #include <linux/init.h>
-#include <linux/slab.h>
 #include <linux/pagemap.h>
 #include <linux/mm.h>
 #include <asm/div64.h>
 #include <linux/seq_file.h>
 #include <linux/namei.h>
+#include <asm/uaccess.h>
 
 #include <lustre/lustre_idl.h>
 #include <obd_support.h>
@@ -80,7 +80,6 @@ static int lmv_set_mdc_active(struct lmv_obd *lmv, struct obd_uuid *uuid,
        struct obd_device      *obd;
        int                  i;
        int                  rc = 0;
-       ENTRY;
 
        CDEBUG(D_INFO, "Searching in lmv %p for uuid %s (activate=%d)\n",
               lmv, uuid->uuid, activate);
@@ -140,7 +139,6 @@ static int lmv_notify(struct obd_device *obd, struct obd_device *watched,
        struct lmv_obd    *lmv = &obd->u.lmv;
        struct obd_uuid  *uuid;
        int                   rc = 0;
-       ENTRY;
 
        if (strcmp(watched->obd_type->typ_name, LUSTRE_MDC_NAME)) {
                CERROR("unexpected notification of %s %s!\n",
@@ -202,7 +200,6 @@ static int lmv_connect(const struct lu_env *env,
        struct lmv_obd  *lmv = &obd->u.lmv;
        struct lustre_handle  conn = { 0 };
        int                 rc = 0;
-       ENTRY;
 
        /*
         * We don't want to actually do the underlying connections more than
@@ -291,7 +288,6 @@ static int lmv_init_ea_size(struct obd_export *exp, int easize,
        int               i;
        int               rc = 0;
        int               change = 0;
-       ENTRY;
 
        if (lmv->max_easize < easize) {
                lmv->max_easize = easize;
@@ -342,7 +338,6 @@ int lmv_connect_mdc(struct obd_device *obd, struct lmv_tgt_desc *tgt)
        struct obd_export       *mdc_exp;
        struct lu_fld_target     target;
        int                   rc;
-       ENTRY;
 
        mdc_obd = class_find_client_obd(&tgt->ltd_uuid, LUSTRE_MDC_NAME,
                                        &obd->obd_uuid);
@@ -452,7 +447,6 @@ static int lmv_add_target(struct obd_device *obd, struct obd_uuid *uuidp,
        struct lmv_obd      *lmv = &obd->u.lmv;
        struct lmv_tgt_desc *tgt;
        int               rc = 0;
-       ENTRY;
 
        CDEBUG(D_CONFIG, "Target uuid: %s. index %d\n", uuidp->uuid, index);
 
@@ -551,7 +545,6 @@ int lmv_check_connect(struct obd_device *obd)
        int                i;
        int                rc;
        int                easize;
-       ENTRY;
 
        if (lmv->connected)
                RETURN(0);
@@ -618,7 +611,6 @@ static int lmv_disconnect_mdc(struct obd_device *obd, struct lmv_tgt_desc *tgt)
        struct lmv_obd   *lmv = &obd->u.lmv;
        struct obd_device      *mdc_obd;
        int                  rc;
-       ENTRY;
 
        LASSERT(tgt != NULL);
        LASSERT(obd != NULL);
@@ -663,7 +655,6 @@ static int lmv_disconnect(struct obd_export *exp)
        struct lmv_obd  *lmv = &obd->u.lmv;
        int                 rc;
        int                 i;
-       ENTRY;
 
        if (!lmv->tgts)
                goto out_local;
@@ -783,6 +774,123 @@ out_fid2path:
        RETURN(rc);
 }
 
+static int lmv_hsm_req_count(struct lmv_obd *lmv,
+                            const struct hsm_user_request *hur,
+                            const struct lmv_tgt_desc *tgt_mds)
+{
+       int                     i, nr = 0;
+       struct lmv_tgt_desc    *curr_tgt;
+
+       /* count how many requests must be sent to the given target */
+       for (i = 0; i < hur->hur_request.hr_itemcount; i++) {
+               curr_tgt = lmv_find_target(lmv, &hur->hur_user_item[i].hui_fid);
+               if (obd_uuid_equals(&curr_tgt->ltd_uuid, &tgt_mds->ltd_uuid))
+                       nr++;
+       }
+       return nr;
+}
+
+static void lmv_hsm_req_build(struct lmv_obd *lmv,
+                             struct hsm_user_request *hur_in,
+                             const struct lmv_tgt_desc *tgt_mds,
+                             struct hsm_user_request *hur_out)
+{
+       int                     i, nr_out;
+       struct lmv_tgt_desc    *curr_tgt;
+
+       /* build the hsm_user_request for the given target */
+       hur_out->hur_request = hur_in->hur_request;
+       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);
+               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];
+                       nr_out++;
+               }
+       }
+       hur_out->hur_request.hr_itemcount = nr_out;
+       memcpy(hur_data(hur_out), hur_data(hur_in),
+              hur_in->hur_request.hr_data_len);
+}
+
+static int lmv_hsm_ct_unregister(struct lmv_obd *lmv, unsigned int cmd, int len,
+                                struct lustre_kernelcomm *lk, void *uarg)
+{
+       int     i, rc = 0;
+
+       /* unregister request (call from llapi_hsm_copytool_fini) */
+       for (i = 0; i < lmv->desc.ld_tgt_count; i++) {
+               /* best effort: try to clean as much as possible
+                * (continue on error) */
+               obd_iocontrol(cmd, lmv->tgts[i]->ltd_exp, len, lk, uarg);
+       }
+
+       /* Whatever the result, remove copytool from kuc groups.
+        * Unreached coordinators will get EPIPE on next requests
+        * and will unregister automatically.
+        */
+       rc = libcfs_kkuc_group_rem(lk->lk_uid, lk->lk_group);
+       RETURN(rc);
+}
+
+static int lmv_hsm_ct_register(struct lmv_obd *lmv, unsigned int cmd, int len,
+                              struct lustre_kernelcomm *lk, void *uarg)
+{
+       struct file     *filp;
+       int              i, j, err;
+       int              rc = 0;
+       bool             any_set = false;
+
+       /* All or nothing: try to register to all MDS.
+        * In case of failure, unregister from previous MDS,
+        * except if it because of inactive target. */
+       for (i = 0; i < lmv->desc.ld_tgt_count; i++) {
+               err = obd_iocontrol(cmd, lmv->tgts[i]->ltd_exp,
+                                  len, lk, uarg);
+               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);
+                               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);
+                               RETURN(rc);
+                       }
+                       /* else: transient error.
+                        * kuc will register to the missing MDT
+                        * when it is back */
+               } else {
+                       any_set = true;
+               }
+       }
+
+       if (!any_set)
+               /* no registration done: return error */
+               RETURN(-ENOTCONN);
+
+       /* at least one registration done, with no failure */
+       filp = fget(lk->lk_wfd);
+       if (filp == NULL) {
+               RETURN(-EBADF);
+       }
+       rc = libcfs_kkuc_group_add(filp, lk->lk_uid, lk->lk_group, lk->lk_data);
+       if (rc != 0 && filp != NULL)
+               fput(filp);
+       RETURN(rc);
+}
+
+
+
+
 static int lmv_iocontrol(unsigned int cmd, struct obd_export *exp,
                         int len, void *karg, void *uarg)
 {
@@ -792,7 +900,6 @@ static int lmv_iocontrol(unsigned int cmd, struct obd_export *exp,
        int                rc = 0;
        int                set = 0;
        int                count = lmv->desc.ld_tgt_count;
-       ENTRY;
 
        if (count == 0)
                RETURN(-ENOTTY);
@@ -908,7 +1015,77 @@ static int lmv_iocontrol(unsigned int cmd, struct obd_export *exp,
        }
        case LL_IOC_HSM_STATE_GET:
        case LL_IOC_HSM_STATE_SET:
-       case LL_IOC_HSM_ACTION:
+       case LL_IOC_HSM_ACTION: {
+               struct md_op_data       *op_data = karg;
+               struct lmv_tgt_desc     *tgt;
+
+               tgt = lmv_find_target(lmv, &op_data->op_fid1);
+               if (IS_ERR(tgt))
+                               RETURN(PTR_ERR(tgt));
+
+               if (tgt->ltd_exp == NULL)
+                               RETURN(-EINVAL);
+
+               rc = obd_iocontrol(cmd, tgt->ltd_exp, len, karg, uarg);
+               break;
+       }
+       case LL_IOC_HSM_PROGRESS: {
+               const struct hsm_progress_kernel *hpk = karg;
+               struct lmv_tgt_desc     *tgt;
+
+               tgt = lmv_find_target(lmv, &hpk->hpk_fid);
+               if (IS_ERR(tgt))
+                       RETURN(PTR_ERR(tgt));
+               rc = obd_iocontrol(cmd, tgt->ltd_exp, len, karg, uarg);
+               break;
+       }
+       case LL_IOC_HSM_REQUEST: {
+               struct hsm_user_request *hur = karg;
+               struct lmv_tgt_desc     *tgt;
+               unsigned int reqcount = hur->hur_request.hr_itemcount;
+
+               if (reqcount == 0)
+                       RETURN(0);
+
+               /* if the request is about a single fid
+                * or if there is a single MDS, no need to split
+                * the request. */
+               if (reqcount == 1 || count == 1) {
+                       tgt = lmv_find_target(lmv,
+                                             &hur->hur_user_item[0].hui_fid);
+                       if (IS_ERR(tgt))
+                               RETURN(PTR_ERR(tgt));
+                       rc = obd_iocontrol(cmd, tgt->ltd_exp, len, karg, uarg);
+               } else {
+                       /* split fid list to their respective MDS */
+                       for (i = 0; i < count; i++) {
+                               unsigned int            nr, reqlen;
+                               int                     rc1;
+                               struct hsm_user_request *req;
+
+                               nr = lmv_hsm_req_count(lmv, hur, lmv->tgts[i]);
+                               if (nr == 0) /* nothing for this MDS */
+                                       continue;
+
+                               /* build a request with fids for this MDS */
+                               reqlen = offsetof(typeof(*hur),
+                                                 hur_user_item[nr])
+                                        + hur->hur_request.hr_data_len;
+                               OBD_ALLOC_LARGE(req, reqlen);
+                               if (req == NULL)
+                                       RETURN(-ENOMEM);
+
+                               lmv_hsm_req_build(lmv, hur, lmv->tgts[i], req);
+
+                               rc1 = obd_iocontrol(cmd, lmv->tgts[i]->ltd_exp,
+                                                   reqlen, req, uarg);
+                               if (rc1 != 0 && rc == 0)
+                                       rc = rc1;
+                               OBD_FREE_LARGE(req, reqlen);
+                       }
+               }
+               break;
+       }
        case LL_IOC_LOV_SWAP_LAYOUTS: {
                struct md_op_data       *op_data = karg;
                struct lmv_tgt_desc     *tgt1, *tgt2;
@@ -931,6 +1108,14 @@ static int lmv_iocontrol(unsigned int cmd, struct obd_export *exp,
                rc = obd_iocontrol(cmd, tgt1->ltd_exp, len, karg, uarg);
                break;
        }
+       case LL_IOC_HSM_CT_START: {
+               struct lustre_kernelcomm *lk = karg;
+               if (lk->lk_flags & LK_FLG_STOP)
+                       rc = lmv_hsm_ct_unregister(lmv, cmd, len, lk, uarg);
+               else
+                       rc = lmv_hsm_ct_register(lmv, cmd, len, lk, uarg);
+               break;
+       }
        default:
                for (i = 0; i < count; i++) {
                        struct obd_device *mdc_obd;
@@ -1018,7 +1203,6 @@ static int lmv_placement_policy(struct obd_device *obd,
                                mdsno_t *mds)
 {
        struct lmv_obd    *lmv = &obd->u.lmv;
-       ENTRY;
 
        LASSERT(mds != NULL);
 
@@ -1060,7 +1244,6 @@ int __lmv_fid_alloc(struct lmv_obd *lmv, struct lu_fid *fid,
 {
        struct lmv_tgt_desc     *tgt;
        int                      rc;
-       ENTRY;
 
        tgt = lmv_get_target(lmv, mds);
        if (IS_ERR(tgt))
@@ -1097,7 +1280,6 @@ int lmv_fid_alloc(struct obd_export *exp, struct lu_fid *fid,
        struct lmv_obd  *lmv = &obd->u.lmv;
        mdsno_t         mds = 0;
        int                 rc;
-       ENTRY;
 
        LASSERT(op_data != NULL);
        LASSERT(fid != NULL);
@@ -1124,7 +1306,6 @@ static int lmv_setup(struct obd_device *obd, struct lustre_cfg *lcfg)
        struct lprocfs_static_vars  lvars;
        struct lmv_desc     *desc;
        int                      rc;
-       ENTRY;
 
        if (LUSTRE_CFG_BUFLEN(lcfg, 1) < 1) {
                CERROR("LMV setup requires a descriptor\n");
@@ -1182,7 +1363,6 @@ out:
 static int lmv_cleanup(struct obd_device *obd)
 {
        struct lmv_obd   *lmv = &obd->u.lmv;
-       ENTRY;
 
        fld_client_fini(&lmv->lmv_fld);
        if (lmv->tgts != NULL) {
@@ -1205,7 +1385,6 @@ static int lmv_process_config(struct obd_device *obd, obd_count len, void *buf)
        int                     gen;
        __u32                   index;
        int                     rc;
-       ENTRY;
 
        switch (lcfg->lcfg_command) {
        case LCFG_ADD_MDC:
@@ -1238,7 +1417,6 @@ static int lmv_statfs(const struct lu_env *env, struct obd_export *exp,
        struct obd_statfs     *temp;
        int                 rc = 0;
        int                 i;
-       ENTRY;
 
        rc = lmv_check_connect(obd);
        if (rc)
@@ -1292,7 +1470,6 @@ static int lmv_getstatus(struct obd_export *exp,
        struct obd_device    *obd = exp->exp_obd;
        struct lmv_obd       *lmv = &obd->u.lmv;
        int                rc;
-       ENTRY;
 
        rc = lmv_check_connect(obd);
        if (rc)
@@ -1311,7 +1488,6 @@ static int lmv_getxattr(struct obd_export *exp, const struct lu_fid *fid,
        struct lmv_obd   *lmv = &obd->u.lmv;
        struct lmv_tgt_desc    *tgt;
        int                  rc;
-       ENTRY;
 
        rc = lmv_check_connect(obd);
        if (rc)
@@ -1337,7 +1513,6 @@ static int lmv_setxattr(struct obd_export *exp, const struct lu_fid *fid,
        struct lmv_obd   *lmv = &obd->u.lmv;
        struct lmv_tgt_desc    *tgt;
        int                  rc;
-       ENTRY;
 
        rc = lmv_check_connect(obd);
        if (rc)
@@ -1361,7 +1536,6 @@ static int lmv_getattr(struct obd_export *exp, struct md_op_data *op_data,
        struct lmv_obd    *lmv = &obd->u.lmv;
        struct lmv_tgt_desc     *tgt;
        int                   rc;
-       ENTRY;
 
        rc = lmv_check_connect(obd);
        if (rc)
@@ -1387,7 +1561,6 @@ static int lmv_null_inode(struct obd_export *exp, const struct lu_fid *fid)
        struct lmv_obd      *lmv = &obd->u.lmv;
        int               i;
        int               rc;
-       ENTRY;
 
        rc = lmv_check_connect(obd);
        if (rc)
@@ -1416,7 +1589,6 @@ static int lmv_find_cbdata(struct obd_export *exp, const struct lu_fid *fid,
        struct lmv_obd      *lmv = &obd->u.lmv;
        int               i;
        int               rc;
-       ENTRY;
 
        rc = lmv_check_connect(obd);
        if (rc)
@@ -1448,7 +1620,6 @@ static int lmv_close(struct obd_export *exp, struct md_op_data *op_data,
        struct lmv_obd  *lmv = &obd->u.lmv;
        struct lmv_tgt_desc   *tgt;
        int                 rc;
-       ENTRY;
 
        rc = lmv_check_connect(obd);
        if (rc)
@@ -1487,7 +1658,6 @@ int lmv_create(struct obd_export *exp, struct md_op_data *op_data,
        struct lmv_obd    *lmv = &obd->u.lmv;
        struct lmv_tgt_desc     *tgt;
        int                   rc;
-       ENTRY;
 
        rc = lmv_check_connect(obd);
        if (rc)
@@ -1528,7 +1698,6 @@ static int lmv_done_writing(struct obd_export *exp,
        struct lmv_obd  *lmv = &obd->u.lmv;
        struct lmv_tgt_desc   *tgt;
        int                 rc;
-       ENTRY;
 
        rc = lmv_check_connect(obd);
        if (rc)
@@ -1558,7 +1727,6 @@ lmv_enqueue_remote(struct obd_export *exp, struct ldlm_enqueue_info *einfo,
        struct mdt_body     *body;
        int                      rc = 0;
        int                      pmode;
-       ENTRY;
 
        body = req_capsule_server_get(&req->rq_pill, &RMF_MDT_BODY);
        LASSERT(body != NULL);
@@ -1612,7 +1780,6 @@ lmv_enqueue(struct obd_export *exp, struct ldlm_enqueue_info *einfo,
        struct lmv_obd     *lmv = &obd->u.lmv;
        struct lmv_tgt_desc      *tgt;
        int                    rc;
-       ENTRY;
 
        rc = lmv_check_connect(obd);
        if (rc)
@@ -1648,7 +1815,6 @@ lmv_getattr_name(struct obd_export *exp,struct md_op_data *op_data,
        struct lmv_tgt_desc     *tgt;
        struct mdt_body  *body;
        int                   rc;
-       ENTRY;
 
        rc = lmv_check_connect(obd);
        if (rc)
@@ -1709,7 +1875,6 @@ static int lmv_early_cancel(struct obd_export *exp, struct md_op_data *op_data,
        struct lmv_tgt_desc    *tgt;
        ldlm_policy_data_t      policy = {{0}};
        int                  rc = 0;
-       ENTRY;
 
        if (!fid_is_sane(fid))
                RETURN(0);
@@ -1745,7 +1910,6 @@ static int lmv_link(struct obd_export *exp, struct md_op_data *op_data,
        struct lmv_obd    *lmv = &obd->u.lmv;
        struct lmv_tgt_desc     *tgt;
        int                   rc;
-       ENTRY;
 
        rc = lmv_check_connect(obd);
        if (rc)
@@ -1757,8 +1921,8 @@ static int lmv_link(struct obd_export *exp, struct md_op_data *op_data,
               PFID(&op_data->op_fid2), op_data->op_namelen,
               op_data->op_name, PFID(&op_data->op_fid1));
 
-       op_data->op_fsuid = current_fsuid();
-       op_data->op_fsgid = current_fsgid();
+       op_data->op_fsuid = from_kuid(&init_user_ns, current_fsuid());
+       op_data->op_fsgid = from_kgid(&init_user_ns, current_fsgid());
        op_data->op_cap = cfs_curproc_cap_pack();
        tgt = lmv_locate_mds(lmv, op_data, &op_data->op_fid2);
        if (IS_ERR(tgt))
@@ -1787,7 +1951,6 @@ static int lmv_rename(struct obd_export *exp, struct md_op_data *op_data,
        struct lmv_tgt_desc     *src_tgt;
        struct lmv_tgt_desc     *tgt_tgt;
        int                     rc;
-       ENTRY;
 
        LASSERT(oldlen != 0);
 
@@ -1799,8 +1962,8 @@ static int lmv_rename(struct obd_export *exp, struct md_op_data *op_data,
        if (rc)
                RETURN(rc);
 
-       op_data->op_fsuid = current_fsuid();
-       op_data->op_fsgid = current_fsgid();
+       op_data->op_fsuid = from_kuid(&init_user_ns, current_fsuid());
+       op_data->op_fsgid = from_kgid(&init_user_ns, current_fsgid());
        op_data->op_cap = cfs_curproc_cap_pack();
        src_tgt = lmv_locate_mds(lmv, op_data, &op_data->op_fid1);
        if (IS_ERR(src_tgt))
@@ -1855,7 +2018,6 @@ static int lmv_setattr(struct obd_export *exp, struct md_op_data *op_data,
        struct lmv_obd    *lmv = &obd->u.lmv;
        struct lmv_tgt_desc     *tgt;
        int                   rc = 0;
-       ENTRY;
 
        rc = lmv_check_connect(obd);
        if (rc)
@@ -1882,7 +2044,6 @@ static int lmv_sync(struct obd_export *exp, const struct lu_fid *fid,
        struct lmv_obd      *lmv = &obd->u.lmv;
        struct lmv_tgt_desc       *tgt;
        int                     rc;
-       ENTRY;
 
        rc = lmv_check_connect(obd);
        if (rc)
@@ -1959,7 +2120,7 @@ static void lmv_adjust_dirpages(struct page **pages, int ncfspgs, int nlupgs)
                __u64                   hash_end = dp->ldp_hash_end;
                __u32                   flags = dp->ldp_flags;
 
-               for (; nlupgs > 1; nlupgs--) {
+               while (--nlupgs > 0) {
                        ent = lu_dirent_start(dp);
                        for (end_dirent = ent; ent != NULL;
                             end_dirent = ent, ent = lu_dirent_next(ent));
@@ -1993,6 +2154,7 @@ static void lmv_adjust_dirpages(struct page **pages, int ncfspgs, int nlupgs)
 
                kunmap(pages[i]);
        }
+       LASSERTF(nlupgs == 0, "left = %d", nlupgs);
 }
 #else
 #define lmv_adjust_dirpages(pages, ncfspgs, nlupgs) do {} while (0)
@@ -2008,7 +2170,6 @@ static int lmv_readpage(struct obd_export *exp, struct md_op_data *op_data,
        int                     ncfspgs; /* pages read in PAGE_CACHE_SIZE */
        int                     nlupgs; /* pages read in LU_PAGE_SIZE */
        struct lmv_tgt_desc     *tgt;
-       ENTRY;
 
        rc = lmv_check_connect(obd);
        if (rc)
@@ -2047,7 +2208,6 @@ static int lmv_unlink(struct obd_export *exp, struct md_op_data *op_data,
        struct lmv_tgt_desc     *tgt = NULL;
        struct mdt_body         *body;
        int                  rc;
-       ENTRY;
 
        rc = lmv_check_connect(obd);
        if (rc)
@@ -2061,8 +2221,8 @@ retry:
        if (IS_ERR(tgt))
                RETURN(PTR_ERR(tgt));
 
-       op_data->op_fsuid = current_fsuid();
-       op_data->op_fsgid = current_fsgid();
+       op_data->op_fsuid = from_kuid(&init_user_ns, current_fsuid());
+       op_data->op_fsgid = from_kgid(&init_user_ns, current_fsgid());
        op_data->op_cap = cfs_curproc_cap_pack();
 
        /*
@@ -2154,7 +2314,6 @@ static int lmv_get_info(const struct lu_env *env, struct obd_export *exp,
        struct obd_device       *obd;
        struct lmv_obd    *lmv;
        int                   rc = 0;
-       ENTRY;
 
        obd = class_exp2obd(exp);
        if (obd == NULL) {
@@ -2217,7 +2376,6 @@ int lmv_set_info_async(const struct lu_env *env, struct obd_export *exp,
        struct obd_device      *obd;
        struct lmv_obd   *lmv;
        int rc = 0;
-       ENTRY;
 
        obd = class_exp2obd(exp);
        if (obd == NULL) {
@@ -2257,7 +2415,6 @@ int lmv_packmd(struct obd_export *exp, struct lov_mds_md **lmmp,
        struct lmv_stripe_md      *lsmp;
        int                     mea_size;
        int                     i;
-       ENTRY;
 
        mea_size = lmv_get_easize(lmv);
        if (!lmmp)
@@ -2307,7 +2464,6 @@ int lmv_unpackmd(struct obd_export *exp, struct lov_stripe_md **lsmp,
        int                      mea_size;
        int                      i;
        __u32                  magic;
-       ENTRY;
 
        mea_size = lmv_get_easize(lmv);
        if (lsmp == NULL)
@@ -2361,7 +2517,6 @@ static int lmv_cancel_unused(struct obd_export *exp, const struct lu_fid *fid,
        int                   rc = 0;
        int                   err;
        int                   i;
-       ENTRY;
 
        LASSERT(fid != NULL);
 
@@ -2383,7 +2538,6 @@ int lmv_set_lock_data(struct obd_export *exp, __u64 *lockh, void *data,
 {
        struct lmv_obd    *lmv = &exp->exp_obd->u.lmv;
        int                   rc;
-       ENTRY;
 
        rc =  md_set_lock_data(lmv->tgts[0]->ltd_exp, lockh, data, bits);
        RETURN(rc);
@@ -2398,7 +2552,6 @@ ldlm_mode_t lmv_lock_match(struct obd_export *exp, __u64 flags,
        struct lmv_obd    *lmv = &obd->u.lmv;
        ldlm_mode_t           rc;
        int                   i;
-       ENTRY;
 
        CDEBUG(D_INODE, "Lock match for "DFID"\n", PFID(fid));
 
@@ -2436,7 +2589,6 @@ int lmv_free_lustre_md(struct obd_export *exp, struct lustre_md *md)
 {
        struct obd_device       *obd = exp->exp_obd;
        struct lmv_obd    *lmv = &obd->u.lmv;
-       ENTRY;
 
        if (md->mea)
                obd_free_memmd(exp, (void *)&md->mea);
@@ -2450,7 +2602,6 @@ int lmv_set_open_replay_data(struct obd_export *exp,
        struct obd_device       *obd = exp->exp_obd;
        struct lmv_obd    *lmv = &obd->u.lmv;
        struct lmv_tgt_desc     *tgt;
-       ENTRY;
 
        tgt = lmv_find_target(lmv, &och->och_fid);
        if (IS_ERR(tgt))
@@ -2465,7 +2616,6 @@ int lmv_clear_open_replay_data(struct obd_export *exp,
        struct obd_device       *obd = exp->exp_obd;
        struct lmv_obd    *lmv = &obd->u.lmv;
        struct lmv_tgt_desc     *tgt;
-       ENTRY;
 
        tgt = lmv_find_target(lmv, &och->och_fid);
        if (IS_ERR(tgt))
@@ -2483,7 +2633,6 @@ static int lmv_get_remote_perm(struct obd_export *exp,
        struct lmv_obd    *lmv = &obd->u.lmv;
        struct lmv_tgt_desc     *tgt;
        int                   rc;
-       ENTRY;
 
        rc = lmv_check_connect(obd);
        if (rc)
@@ -2504,7 +2653,6 @@ static int lmv_renew_capa(struct obd_export *exp, struct obd_capa *oc,
        struct lmv_obd    *lmv = &obd->u.lmv;
        struct lmv_tgt_desc     *tgt;
        int                   rc;
-       ENTRY;
 
        rc = lmv_check_connect(obd);
        if (rc)
@@ -2535,7 +2683,6 @@ int lmv_intent_getattr_async(struct obd_export *exp,
        struct lmv_obd    *lmv = &obd->u.lmv;
        struct lmv_tgt_desc     *tgt = NULL;
        int                   rc;
-       ENTRY;
 
        rc = lmv_check_connect(obd);
        if (rc)
@@ -2556,7 +2703,6 @@ int lmv_revalidate_lock(struct obd_export *exp, struct lookup_intent *it,
        struct lmv_obd    *lmv = &obd->u.lmv;
        struct lmv_tgt_desc     *tgt;
        int                   rc;
-       ENTRY;
 
        rc = lmv_check_connect(obd);
        if (rc)
@@ -2583,7 +2729,6 @@ int lmv_quotactl(struct obd_device *unused, struct obd_export *exp,
        struct lmv_tgt_desc *tgt = lmv->tgts[0];
        int               rc = 0, i;
        __u64           curspace, curinodes;
-       ENTRY;
 
        if (!lmv->desc.ld_tgt_count || !tgt->ltd_active) {
                CERROR("master lmv inactive\n");
@@ -2630,7 +2775,6 @@ int lmv_quotacheck(struct obd_device *unused, struct obd_export *exp,
        struct lmv_obd      *lmv = &obd->u.lmv;
        struct lmv_tgt_desc *tgt;
        int               i, rc = 0;
-       ENTRY;
 
        for (i = 0; i < lmv->desc.ld_tgt_count; i++) {
                int err;