* 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/
struct dt_device;
struct dt_object;
struct dt_index_features;
-struct dt_quota_ctxt;
struct niobuf_local;
struct niobuf_remote;
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 {
enum dt_format_type dof_type;
union {
struct dof_regular {
+ int striped;
} dof_reg;
struct dof_dir {
} dof_dir;
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;
};
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
* 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;
};
/**
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,