Whamcloud - gitweb
LU-4684 migrate: shrink dir layout after migration
[fs/lustre-release.git] / lustre / mdd / mdd_object.c
index a623314..e2c39af 100644 (file)
@@ -942,12 +942,12 @@ int mdd_changelog_data_store(const struct lu_env *env, struct mdd_device *mdd,
        RETURN(rc);
 }
 
-static int mdd_changelog_data_store_xattr(const struct lu_env *env,
-                                         struct mdd_device *mdd,
-                                         enum changelog_rec_type type,
-                                         int flags, struct mdd_object *mdd_obj,
-                                         const char *xattr_name,
-                                         struct thandle *handle)
+int mdd_changelog_data_store_xattr(const struct lu_env *env,
+                                  struct mdd_device *mdd,
+                                  enum changelog_rec_type type,
+                                  int flags, struct mdd_object *mdd_obj,
+                                  const char *xattr_name,
+                                  struct thandle *handle)
 {
        int                              rc;
 
@@ -1849,6 +1849,11 @@ static int mdd_xattr_set(const struct lu_env *env, struct md_object *obj,
                RETURN(rc);
        }
 
+       if (strcmp(name, XATTR_NAME_LMV) == 0) {
+               rc = mdd_dir_layout_shrink(env, obj, buf);
+               RETURN(rc);
+       }
+
        if (strcmp(name, XATTR_NAME_ACL_ACCESS) == 0 ||
            strcmp(name, XATTR_NAME_ACL_DEFAULT) == 0) {
                struct posix_acl *acl;