Whamcloud - gitweb
LU-4690 osp: some cleanup for patch 9511 61/10261/2
authorwang di <di.wang@intel.com>
Wed, 7 May 2014 20:23:11 +0000 (13:23 -0700)
committerOleg Drokin <oleg.drokin@intel.com>
Fri, 9 May 2014 21:07:19 +0000 (21:07 +0000)
cleanup patch 9511 according to the review

1. fix endian problem in osd-zfs and osp.
2. Few tab and typo fixes.
3. move mti_big_lmm_used back to mdt_stripe_get,
set it in mdt_big_xattr_get is a bit risky.

Signed-off-by: wang di <di.wang@intel.com>
Change-Id: I85982bf198dddc9e0442e392f3da25cca46dfe03
Reviewed-on: http://review.whamcloud.com/10261
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Fan Yong <fan.yong@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/lmv/lmv_obd.c
lustre/lod/lod_object.c
lustre/mdd/mdd_dir.c
lustre/mdt/mdt_handler.c
lustre/osd-ldiskfs/osd_handler.c
lustre/osd-zfs/osd_index.c
lustre/osp/osp_md_object.c
lustre/utils/liblustreapi.c

index b89a40a..a48307f 100644 (file)
@@ -1368,7 +1368,7 @@ int __lmv_fid_alloc(struct lmv_obd *lmv, struct lu_fid *fid,
                GOTO(out, rc = -ENODEV);
 
        /*
-        * Asking underlaying tgt layer to allocate new fid.
+        * Asking underlying tgt layer to allocate new fid.
         */
        rc = obd_fid_alloc(NULL, tgt->ltd_exp, fid, NULL);
        if (rc > 0) {
index 8b51dd8..d5d09b0 100644 (file)
@@ -260,12 +260,12 @@ static struct dt_index_operations lod_index_ops = {
  * \param[in] env      execution environment.
  * \param[in] dt       the striped directory object to be iterated.
  * \param[in] attr     the attribute of iterator, mostly used to indicate
- *                     the entry attribute in the object to be iterated.
+ *                      the entry attribute in the object to be iterated.
  * \param[in] capa     capability(useless in current implementation)
  *
  * \retval     initialized iterator(dt_it) if successful initialize the
- *             iteration. lit_stripe_index will be used to indicate the
- *             current iterate position among stripes.
+ *              iteration. lit_stripe_index will be used to indicate the
+ *              current iterate position among stripes.
  * \retval     ERR pointer if initialization is failed.
  */
 static struct dt_it *lod_striped_it_init(const struct lu_env *env,
@@ -538,7 +538,7 @@ static int lod_striped_it_key_size(const struct lu_env *env,
  * \param[in] env      execution environment.
  * \param[in] di       the iterator for striped directory.
  * \param[in] attr     the attribute of iterator, mostly used to indicate
- *                     the entry attribute in the object to be iterated.
+ *                      the entry attribute in the object to be iterated.
  * \param[out] rec     hold the return record.
  *
  * \retval     0 if successfully get the entry.
@@ -568,7 +568,7 @@ static int lod_striped_it_rec(const struct lu_env *env, const struct dt_it *di,
  * \param[in] env      execution environment.
  * \param[in] di       the iterator for striped directory.
  * \param[in] attr     the attribute of iterator, mostly used to indicate
- *                     the entry attribute in the object to be iterated.
+ *                      the entry attribute in the object to be iterated.
  *
  * \retval     rec_size if successfully get the entry size.
  * \retval     negative error if can not get entry size.
index 98e4e28..d1009a3 100644 (file)
@@ -1872,8 +1872,8 @@ static int mdd_create_sanity_check(const struct lu_env *env,
                  */
                rc = __mdd_lookup(env, pobj, pattr, lname, fid,
                                  MAY_WRITE | MAY_EXEC);
-                if (rc != -ENOENT)
-                        RETURN(rc ? : -EEXIST);
+               if (rc != -ENOENT)
+                       RETURN(rc ? : -EEXIST);
        } else {
                rc = mdd_may_create(env, obj, pattr, NULL, true, false);
                if (rc != 0)
index 0c9ab85..6b0c683 100644 (file)
@@ -543,8 +543,6 @@ int mdt_big_xattr_get(struct mdt_thread_info *info, struct mdt_object *o,
        info->mti_buf.lb_buf = info->mti_big_lmm;
        info->mti_buf.lb_len = info->mti_big_lmmsize;
        rc = mo_xattr_get(env, mdt_object_child(o), &info->mti_buf, name);
-       if (rc > 0)
-               info->mti_big_lmm_used = 1;
 
        RETURN(rc);
 }
@@ -596,6 +594,7 @@ int mdt_stripe_get(struct mdt_thread_info *info, struct mdt_object *o,
                        return rc;
                rc = mdt_big_xattr_get(info, o, name);
                if (rc > 0) {
+                       info->mti_big_lmm_used = 1;
                        if (!strcmp(name, XATTR_NAME_LOV)) {
                                ma->ma_valid |= MA_LOV;
                                ma->ma_lmm = info->mti_big_lmm;
index 9d20f5d..46aff66 100644 (file)
@@ -5412,10 +5412,10 @@ static inline int osd_it_ea_rec(const struct lu_env *env,
  * \param[in] env      execution environment
  * \param[in] di       iterator's in memory structure
  * \param[in] attr     attribute of the entry, only requires LUDA_TYPE to
- *                     calculate the lu_dirent size.
+ *                      calculate the lu_dirent size.
  *
  * \retval     record size(in bytes & in memory) of the current lu_dirent
- *             entry.
+ *              entry.
  */
 static int osd_it_ea_rec_size(const struct lu_env *env, const struct dt_it *di,
                              __u32 attr)
index dd1acf3..7fb8326 100644 (file)
@@ -978,9 +978,9 @@ static int osd_dir_it_rec_size(const struct lu_env *env, const struct dt_it *di,
        ENTRY;
 
        if (it->ozi_pos <= 1)
-               namelen = cpu_to_le16(1);
+               namelen = 1;
        else if (it->ozi_pos == 2)
-               namelen = cpu_to_le16(2);
+               namelen = 2;
 
        if (namelen > 0) {
                rc = lu_dirent_calc_size(namelen, attr);
index 26f8e32..ea5ef0a 100644 (file)
@@ -532,7 +532,7 @@ static int osp_md_index_it_rec(const struct lu_env *env, const struct dt_it *di,
        struct lu_dirent        *ent = (struct lu_dirent *)it->ooi_ent;
        int                     reclen;
 
-       reclen = lu_dirent_calc_size(ent->lde_namelen, attr);
+       reclen = lu_dirent_calc_size(le16_to_cpu(ent->lde_namelen), attr);
        memcpy(rec, ent, reclen);
        return 0;
 }
index e9d3b12..97d7fc7 100644 (file)
@@ -2387,7 +2387,7 @@ void lmv_dump_user_lmm(struct lmv_user_md *lum, char *pool_name,
        struct lmv_user_mds_data *objects = lum->lum_objects;
        char *prefix = lum->lum_magic == LMV_USER_MAGIC ? "(Default)" : "";
        int i, obdstripe = 0;
-       char *seperator = "";
+       char *separator = "";
 
        if (obdindex != OBD_NOT_FOUND) {
                for (i = 0; i < lum->lum_stripe_count; i++) {
@@ -2414,25 +2414,25 @@ void lmv_dump_user_lmm(struct lmv_user_md *lum, char *pool_name,
                llapi_printf(LLAPI_MSG_NORMAL, "%s%s\n", prefix, path);
 
        if (verbose & VERBOSE_COUNT) {
-               llapi_printf(LLAPI_MSG_NORMAL, "%s", seperator);
+               llapi_printf(LLAPI_MSG_NORMAL, "%s", separator);
                if (verbose & ~VERBOSE_COUNT)
                        llapi_printf(LLAPI_MSG_NORMAL, "lmv_stripe_count: ");
                llapi_printf(LLAPI_MSG_NORMAL, "%u",
                             (int)lum->lum_stripe_count);
-               seperator = "\n";
+               separator = "\n";
        }
 
        if (verbose & VERBOSE_OFFSET) {
-               llapi_printf(LLAPI_MSG_NORMAL, "%s", seperator);
+               llapi_printf(LLAPI_MSG_NORMAL, "%s", separator);
                if (verbose & ~VERBOSE_OFFSET)
                        llapi_printf(LLAPI_MSG_NORMAL, "lmv_stripe_offset: ");
                llapi_printf(LLAPI_MSG_NORMAL, "%d",
                             (int)lum->lum_stripe_offset);
-               seperator = "\n";
+               separator = "\n";
        }
 
        if (verbose & VERBOSE_OBJID && lum->lum_magic != LMV_USER_MAGIC) {
-               llapi_printf(LLAPI_MSG_NORMAL, "%s", seperator);
+               llapi_printf(LLAPI_MSG_NORMAL, "%s", separator);
                if (obdstripe == 1 && lum->lum_stripe_count > 0)
                        llapi_printf(LLAPI_MSG_NORMAL,
                                     "mdtidx\t\t FID[seq:oid:ver]\n");
@@ -2449,12 +2449,12 @@ void lmv_dump_user_lmm(struct lmv_user_md *lum, char *pool_name,
        }
 
        if ((verbose & VERBOSE_POOL) && (pool_name[0] != '\0')) {
-               llapi_printf(LLAPI_MSG_NORMAL, "%s", seperator);
+               llapi_printf(LLAPI_MSG_NORMAL, "%s", separator);
                if (verbose & ~VERBOSE_POOL)
                        llapi_printf(LLAPI_MSG_NORMAL, "%slmv_pool:           ",
                                     prefix);
                llapi_printf(LLAPI_MSG_NORMAL, "%s%c ", pool_name, ' ');
-               seperator = "\n";
+               separator = "\n";
        }
 
        if (!(verbose & VERBOSE_OBJID))