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) {
* \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,
* \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.
* \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.
*/
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)
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);
}
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;
* \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)
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);
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;
}
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++) {
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");
}
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))