being created so that OSD API implementation can
initialize some default values, etc.
Signed-off-by: Alex Zhuravlev <bzzz@whamcloud.com>
Change-Id: If4bda7626b4406f906a95df3704885c4531567ee
Reviewed-on: http://review.whamcloud.com/3959
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Jinshan Xiong <jinshan.xiong@whamcloud.com>
void (*do_ah_init)(const struct lu_env *env,
struct dt_allocation_hint *ah,
struct dt_object *parent,
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.
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 lov_mds_md *lmm = NULL;
int lmm_size = 0;
struct thandle *handle;
+ struct lu_attr *attr = &mdd_env_info(env)->mti_la_for_fix;
+ 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));
handle = mdd_trans_create(env, mdd);
if (IS_ERR(handle))
GOTO(out_free, rc = PTR_ERR(handle));
+ 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));
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);
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)
{
static inline void mdd_object_put(const struct lu_env *env,
struct mdd_object *o)
{
dof->u.dof_idx.di_feat = feat;
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
rc = mdo_create_obj(env, c, attr, hint, dof, handle);
LASSERT(ergo(rc == 0, mdd_object_exists(c)));
} else
+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
*/
/*
* 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,
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)
*/
static void osd_ah_init(const struct lu_env *env, struct dt_allocation_hint *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)