X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lustre%2Finclude%2Fdt_object.h;h=07f9a4b2aad8d729118b193f7c45b48b63eb2728;hb=f4ea7b630b8adc9856ee67c6d16549f36e14efd1;hp=7d2b97e976f2e27916f0ad58b2957305bebd0796;hpb=752c69506c4559cd5c97a8dcbe488b54822ca087;p=fs%2Flustre-release.git diff --git a/lustre/include/dt_object.h b/lustre/include/dt_object.h index 7d2b97e..07f9a4b 100644 --- a/lustre/include/dt_object.h +++ b/lustre/include/dt_object.h @@ -27,7 +27,7 @@ * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. * - * Copyright (c) 2011, 2012, Whamcloud, Inc. + * Copyright (c) 2011, 2012, Intel Corporation. */ /* * This file is part of Lustre, http://www.lustre.org/ @@ -65,7 +65,6 @@ struct thandle; struct dt_device; struct dt_object; struct dt_index_features; -struct dt_quota_ctxt; struct niobuf_local; struct niobuf_remote; @@ -174,12 +173,6 @@ struct dt_device_operations { struct dt_device *dev, int mode, unsigned long timeout, __u32 alg, struct lustre_capa_key *keys); - /** - * Initialize quota context. - */ - void (*dt_init_quota_ctxt)(const struct lu_env *env, - struct dt_device *dev, - struct dt_quota_ctxt *ctxt, void *data); }; struct dt_index_features { @@ -262,6 +255,7 @@ struct dt_object_format { enum dt_format_type dof_type; union { struct dof_regular { + int striped; } dof_reg; struct dof_dir { } dof_dir; @@ -688,7 +682,7 @@ struct local_oid_storage { struct dt_object *los_obj; /* data used to generate new fids */ - cfs_mutex_t los_id_lock; + struct mutex los_id_lock; __u64 los_seq; __u32 los_last_oid; }; @@ -709,6 +703,12 @@ static inline int dt_object_exists(const struct dt_object *dt) return lu_object_exists(&dt->do_lu); } +static inline struct dt_object *lu2dt_obj(struct lu_object *o) +{ + LASSERT(ergo(o != NULL, lu_device_is_dt(o->lo_dev))); + return container_of0(o, struct dt_object, do_lu); +} + /** * This is the general purpose transaction handle. * 1. Transaction Life Cycle @@ -724,24 +724,32 @@ static inline int dt_object_exists(const struct dt_object *dt) * No RPC request should be issued inside transaction. */ struct thandle { - /** the dt device on which the transactions are executed */ - struct dt_device *th_dev; + /** the dt device on which the transactions are executed */ + struct dt_device *th_dev; + + /** context for this transaction, tag is LCT_TX_HANDLE */ + struct lu_context th_ctx; - /** additional tags (layers can add in declare) */ - __u32 th_tags; + /** additional tags (layers can add in declare) */ + __u32 th_tags; - /** context for this transaction, tag is LCT_TX_HANDLE */ - struct lu_context th_ctx; + /** the last operation result in this transaction. + * this value is used in recovery */ + __s32 th_result; - /** the last operation result in this transaction. - * this value is used in recovery */ - __s32 th_result; + /** whether we need sync commit */ + int th_sync:1; - /** whether we need sync commit */ - int th_sync:1; + /* local transation, no need to inform other layers */ + int th_local:1; - /* local transation, no need to inform other layers */ - int th_local:1; + /* In DNE, one transaction can be disassemblied into + * updates on several different MDTs, and these updates + * will be attached to th_remote_update_list per target. + * Only single thread will access the list, no need lock + */ + cfs_list_t th_remote_update_list; + struct update_request *th_current_request; }; /** @@ -1375,6 +1383,18 @@ static inline int dt_commit_async(const struct lu_env *env, return dev->dd_ops->dt_commit_async(env, dev); } +static inline int dt_init_capa_ctxt(const struct lu_env *env, + struct dt_device *dev, + int mode, unsigned long timeout, + __u32 alg, struct lustre_capa_key *keys) +{ + LASSERT(dev); + LASSERT(dev->dd_ops); + LASSERT(dev->dd_ops->dt_init_capa_ctxt); + return dev->dd_ops->dt_init_capa_ctxt(env, dev, mode, + timeout, alg, keys); +} + static inline int dt_lookup(const struct lu_env *env, struct dt_object *dt, struct dt_rec *rec,