X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lustre%2Finclude%2Fdt_object.h;h=07f9a4b2aad8d729118b193f7c45b48b63eb2728;hb=f4ea7b630b8adc9856ee67c6d16549f36e14efd1;hp=b1fbda0531e1bea5ba63196eca03638b5c0a02a8;hpb=0810df383cc006f8a06adbd3c262367bd9d9472a;p=fs%2Flustre-release.git diff --git a/lustre/include/dt_object.h b/lustre/include/dt_object.h index b1fbda0..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/ @@ -682,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; }; @@ -703,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 @@ -718,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; }; /**