X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=blobdiff_plain;f=lustre%2Finclude%2Fdt_object.h;h=f8e63c666c53aeaa3d2516acd32404459c52679c;hp=038095c2e30296d98be9b8c99f96d9332ce15a99;hb=7da1d93e2320bd7e6db8062350a90a651a00f84b;hpb=7107e54983b0a701c5c02a1e3c521302e8f79810 diff --git a/lustre/include/dt_object.h b/lustre/include/dt_object.h index 038095c..f8e63c6 100644 --- a/lustre/include/dt_object.h +++ b/lustre/include/dt_object.h @@ -1026,6 +1026,40 @@ struct dt_object_operations { * \retval negative negated errno on error */ int (*do_invalidate)(const struct lu_env *env, struct dt_object *dt); + + /** + * Declare intention to instaintiate extended layout component. + * + * \param[in] env execution environment + * \param[in] dt DT object + * \param[in] layout data structure to describe the changes to + * the DT object's layout + * \param[in] buf buffer containing client's lovea or empty + * + * \retval 0 success + * \retval -ne error code + */ + int (*do_declare_layout_change)(const struct lu_env *env, + struct dt_object *dt, + struct layout_intent *layout, + const struct lu_buf *buf, + struct thandle *th); + + /** + * Client is trying to write to un-instantiated layout component. + * + * \param[in] env execution environment + * \param[in] dt DT object + * \param[in] layout data structure to describe the changes to + * the DT object's layout + * \param[in] buf buffer containing client's lovea or empty + * + * \retval 0 success + * \retval -ne error code + */ + int (*do_layout_change)(const struct lu_env *env, struct dt_object *dt, + struct layout_intent *layout, + const struct lu_buf *buf, struct thandle *th); }; /** @@ -2712,6 +2746,30 @@ static inline int dt_lookup(const struct lu_env *env, return ret; } +static inline int dt_declare_layout_change(const struct lu_env *env, + struct dt_object *o, + struct layout_intent *layout, + const struct lu_buf *buf, + struct thandle *th) +{ + LASSERT(o); + LASSERT(o->do_ops); + LASSERT(o->do_ops->do_declare_layout_change); + return o->do_ops->do_declare_layout_change(env, o, layout, buf, th); +} + +static inline int dt_layout_change(const struct lu_env *env, + struct dt_object *o, + struct layout_intent *layout, + const struct lu_buf *buf, + struct thandle *th) +{ + LASSERT(o); + LASSERT(o->do_ops); + LASSERT(o->do_ops->do_layout_change); + return o->do_ops->do_layout_change(env, o, layout, buf, th); +} + struct dt_find_hint { struct lu_fid *dfh_fid; struct dt_device *dfh_dt;