Whamcloud - gitweb
LU-6027 mdt: Allow user EAs with empty values
[fs/lustre-release.git] / lustre / mdd / mdd_compat.c
index 76b5511..1051f0e 100644 (file)
@@ -20,7 +20,7 @@
  * GPL HEADER END
  */
 /*
- * Copyright (c) 2012, Intel Corporation.
+ * Copyright (c) 2013, 2014, Intel Corporation.
  */
 #define DEBUG_SUBSYSTEM S_MDS
 
@@ -110,7 +110,7 @@ static int mdd_convert_linkea(const struct lu_env *env,
        if (IS_ERR(th))
                RETURN(PTR_ERR(th));
 
-       rc = mdd_declare_links_add(env, o, th, NULL);
+       rc = mdd_declare_links_add(env, o, th, NULL, MLAO_IGNORE);
        if (rc)
                GOTO(out, rc);
        rc = dt_trans_start_local(env, mdd->mdd_child, th);
@@ -136,7 +136,7 @@ static int mdd_convert_object(const struct lu_env *env,
                              const struct lu_name *name)
 {
        struct mdd_object       *o;
-       struct lu_attr          *la = &mdd_env_info(env)->mti_la;
+       struct lu_attr          *la = MDD_ENV_VAR(env, cattr);
        int                      rc;
        ENTRY;
 
@@ -182,7 +182,7 @@ static int mdd_convert_lma(const struct lu_env *env, struct mdd_device *mdd,
        lu_root_fid(&fid);
 
        lma = (struct lustre_mdt_attrs *)&mdd_env_info(env)->mti_xattr_buf;
-       lustre_lma_init(lma, &fid, 0);
+       lustre_lma_init(lma, &fid, 0, 0);
        lustre_lma_swab(lma);
        buf.lb_buf = lma;
        buf.lb_len = sizeof(*lma);
@@ -231,13 +231,15 @@ static int mdd_fix_children(const struct lu_env *env,
                GOTO(out_put, rc);
 
        do {
+               size_t lu_dirent_size;
+
                rc = iops->key_size(env, it);
                if (rc == 0)
                        goto next;
 
                /* calculate max space required for lu_dirent */
-               rc = lu_dirent_calc_size(rc, 0);
-               LASSERT(rc <= sizeof(info->mti_xattr_buf));
+               lu_dirent_size = lu_dirent_calc_size(rc, 0);
+               LASSERT(lu_dirent_size <= sizeof(info->mti_xattr_buf));
 
                rc = iops->rec(env, it, (struct dt_rec *)ent, LUDA_TYPE);
                if (rc == 0) {