void (*do_ah_init)(const struct lu_env *env,
struct dt_allocation_hint *ah,
struct dt_object *parent,
+ struct dt_object *child,
cfs_umode_t child_mode);
/**
* Create new object on this device.
struct lov_mds_md *lmm = NULL;
int lmm_size = 0;
struct thandle *handle;
+ struct lu_attr *attr = &mdd_env_info(env)->mti_la_for_fix;
int rc;
ENTRY;
if (rc)
RETURN(rc);
+ rc = mdd_la_get(env, son, attr, mdd_object_capa(env, son));
+ if (rc)
+ RETURN(rc);
+
+ /* calling ->ah_make_hint() is used to transfer information from parent */
+ mdd_object_make_hint(env, mdd_pobj, son, attr);
+
handle = mdd_trans_create(env, mdd);
if (IS_ERR(handle))
GOTO(out_free, rc = PTR_ERR(handle));
got_def_acl = 1;
}
+ mdd_object_make_hint(env, mdd_pobj, son, attr);
+
handle = mdd_trans_create(env, mdd);
if (IS_ERR(handle))
GOTO(out_free, rc = PTR_ERR(handle));
int mdd_lov_destroy(const struct lu_env *env, struct mdd_device *mdd,
struct mdd_object *obj, struct lu_attr *la);
+void mdd_object_make_hint(const struct lu_env *env, struct mdd_object *parent,
+ struct mdd_object *child, struct lu_attr *attr);
+
static inline void mdd_object_put(const struct lu_env *env,
struct mdd_object *o)
{
dof->u.dof_idx.di_feat = feat;
- /* @hint will be initialized by underlying device. */
- next->do_ops->do_ah_init(env, hint,
- p ? mdd_object_child(p) : NULL,
- attr->la_mode & S_IFMT);
-
rc = mdo_create_obj(env, c, attr, hint, dof, handle);
LASSERT(ergo(rc == 0, mdd_object_exists(c)));
} else
RETURN(rc);
}
+void mdd_object_make_hint(const struct lu_env *env, struct mdd_object *parent,
+ struct mdd_object *child, struct lu_attr *attr)
+{
+ struct dt_allocation_hint *hint = &mdd_env_info(env)->mti_hint;
+ struct dt_object *np = parent ? mdd_object_child(parent) : NULL;
+ struct dt_object *nc = mdd_object_child(child);
+
+ /* @hint will be initialized by underlying device. */
+ nc->do_ops->do_ah_init(env, hint, np, nc, attr->la_mode & S_IFMT);
+}
+
/*
* do NOT or the MAY_*'s, you'll get the weakest
*/
static void osd_ah_init(const struct lu_env *env, struct dt_allocation_hint *ah,
- struct dt_object *parent, cfs_umode_t child_mode)
+ struct dt_object *parent, struct dt_object *child,
+ cfs_umode_t child_mode)
{
LASSERT(ah);
*/
static void osd_ah_init(const struct lu_env *env, struct dt_allocation_hint *ah,
- struct dt_object *parent, cfs_umode_t child_mode)
+ struct dt_object *parent, struct dt_object *child,
+ cfs_umode_t child_mode)
{
LASSERT(ah);