/* cmm_object.c */
int cmm_object_init(struct lu_context *ctxt, struct lu_object*);
-struct lu_object *cmm_object_alloc(struct lu_device *);
-void cmm_object_free(struct lu_object *o);
+struct lu_object *cmm_object_alloc(struct lu_context *ctx, struct lu_device *);
+void cmm_object_free(struct lu_context *ctx, struct lu_object *o);
void cmm_object_release(struct lu_context *ctxt, struct lu_object *o);
//int cmm_getattr(struct lu_object *o, struct lu_attr *a);
//int cmm_setattr(struct lu_object *o, struct lu_attr *a);
-int cmm_object_print(struct seq_file *f, const struct lu_object *o);
+int cmm_object_print(struct lu_context *ctx,
+ struct seq_file *f, const struct lu_object *o);
/* cmm md operations */
-int cmm_config(struct md_device *md, const char *name,
+int cmm_config(struct lu_context *ctx, struct md_device *md, const char *name,
void *buf, int size, int mode);
-int cmm_root_get(struct md_device *m, struct lu_fid *f);
-int cmm_statfs(struct md_device *m, struct kstatfs *sfs);
+int cmm_root_get(struct lu_context *ctx, struct md_device *m, struct lu_fid *f);
+int cmm_statfs(struct lu_context *ctx,
+ struct md_device *m, struct kstatfs *sfs);
int cmm_mkdir(struct lu_context *ctxt, struct md_object *o, const char *name,
struct md_object *child);
-int cmm_attr_get(struct lu_context *ctxt, struct md_object *obj, void *buf, int size,
+int cmm_attr_get(struct lu_context *ctxt,
+ struct md_object *obj, void *buf, int size,
const char *name, struct md_params *);
#endif /* __KERNEL__ */
static struct md_object_operations cmm_mo_ops;
-struct lu_object *cmm_object_alloc(struct lu_device *d)
+struct lu_object *cmm_object_alloc(struct lu_context *ctx, struct lu_device *d)
{
struct cmm_object *mo;
ENTRY;
ENTRY;
under = &d->cmm_child->md_lu_dev;
- below = under->ld_ops->ldo_object_alloc(under);
+ below = under->ld_ops->ldo_object_alloc(ctxt, under);
if (below != NULL) {
lu_object_add(o, below);
RETURN(0);
RETURN(-ENOMEM);
}
-void cmm_object_free(struct lu_object *o)
+void cmm_object_free(struct lu_context *ctx, struct lu_object *o)
{
lu_object_fini(o);
}
return;
}
-int cmm_object_print(struct seq_file *f, const struct lu_object *o)
+int cmm_object_print(struct lu_context *ctx,
+ struct seq_file *f, const struct lu_object *o)
{
return seq_printf(f, LUSTRE_CMM0_NAME"-object@%p", o);
}
/* Locking API */
#if 0
-static void cmm_lock(struct md_object *obj, __u32 mode)
+static void cmm_lock(struct lu_context *ctxt, struct md_object *obj, __u32 mode)
{
struct cmm_object *cmm_obj = md2cmm_obj(obj);
struct cmm_device *cmm_dev = cmm_obj2dev(cmm_obj);
+ struct md_object *next = cmm2child_obj(cmm_obj);
- CMM_DO_CHILD(cmm_dev)->ldo_lock_obj(cmm2child_obj(cmm_obj), mode);
- return;
+ next->mo_ops->moo_object_lock(ctxt, next, mode);
}
-static void cmm_unlock(struct md_object *obj, __u32 mode)
+static void cmm_unlock(struct lu_context *ctxt,
+ struct md_object *obj, __u32 mode)
{
struct cmm_object *cmm_obj = md2cmm_obj(obj);
struct cmm_device *cmm_dev = cmm_obj2dev(cmm_obj);
+ struct md_object *next = cmm2child_obj(cmm_obj);
- CMM_DO_CHILD(cmm_dev)->ldo_unlock_obj(cmm2child_obj(cmm_obj), mode);
- return;
+ next->mo_ops->moo_object_unlock(ctxt, next, mode);
}
#endif
/* Llog API */
/* Object API */
/* Metadata API */
-int cmm_root_get(struct md_device *md, struct lu_fid *fid) {
+int cmm_root_get(struct lu_context *ctx,
+ struct md_device *md, struct lu_fid *fid)
+{
struct cmm_device *cmm_dev = md2cmm_dev(md);
- return cmm_child_ops(cmm_dev)->mdo_root_get(cmm_dev->cmm_child, fid);
+ return cmm_child_ops(cmm_dev)->mdo_root_get(ctx,
+ cmm_dev->cmm_child, fid);
}
-int cmm_config(struct md_device *md, const char *name,
+int cmm_config(struct lu_context *ctxt,
+ struct md_device *md, const char *name,
void *buf, int size, int mode)
{
struct cmm_device *cmm_dev = md2cmm_dev(md);
int result;
ENTRY;
- result = cmm_child_ops(cmm_dev)->mdo_config(cmm_dev->cmm_child,
+ result = cmm_child_ops(cmm_dev)->mdo_config(ctxt, cmm_dev->cmm_child,
name, buf, size, mode);
RETURN(result);
}
-int cmm_statfs(struct md_device *md, struct kstatfs *sfs) {
+int cmm_statfs(struct lu_context *ctxt,
+ struct md_device *md, struct kstatfs *sfs) {
struct cmm_device *cmm_dev = md2cmm_dev(md);
int result;
ENTRY;
- result = cmm_child_ops(cmm_dev)->mdo_statfs(cmm_dev->cmm_child, sfs);
+ result = cmm_child_ops(cmm_dev)->mdo_statfs(ctxt,
+ cmm_dev->cmm_child, sfs);
RETURN (result);
}
{
struct lu_seq_mgr *mgr;
ENTRY;
-
+
OBD_ALLOC_PTR(mgr);
if (!mgr)
RETURN(NULL);
}
EXPORT_SYMBOL(seq_mgr_fini);
-int seq_mgr_write(struct lu_seq_mgr *mgr)
+int seq_mgr_write(struct lu_context *ctx, struct lu_seq_mgr *mgr)
{
- int rc = -ENOTSUPP;
ENTRY;
-
- if (mgr->m_ops->smo_write)
- rc = mgr->m_ops->smo_write(mgr->m_opaque, &mgr->m_seq);
-
- RETURN(rc);
+ RETURN(mgr->m_ops->smo_write(ctx, mgr->m_opaque, &mgr->m_seq));
}
EXPORT_SYMBOL(seq_mgr_write);
-int seq_mgr_read(struct lu_seq_mgr *mgr)
+int seq_mgr_read(struct lu_context *ctx, struct lu_seq_mgr *mgr)
{
- int rc = -ENOTSUPP;
ENTRY;
-
- if (mgr->m_ops->smo_read)
- rc = mgr->m_ops->smo_read(mgr->m_opaque, &mgr->m_seq);
-
- RETURN(rc);
+ RETURN(mgr->m_ops->smo_read(ctx, mgr->m_opaque, &mgr->m_seq));
}
EXPORT_SYMBOL(seq_mgr_read);
/* manager functinality stuff */
-int seq_mgr_alloc(struct lu_seq_mgr *mgr, __u64 *seq)
+int seq_mgr_alloc(struct lu_context *ctx, struct lu_seq_mgr *mgr, __u64 *seq)
{
int rc = 0;
ENTRY;
mgr->m_seq += 1;
*seq = mgr->m_seq;
- rc = seq_mgr_write(mgr);
- if (rc == -ENOTSUPP) {
- CERROR("Seq manager ->write() method "
- "is no defined.\n");
- rc = 0;
- }
-
+ rc = seq_mgr_write(ctx, mgr);
+
up(&mgr->m_seq_sem);
RETURN(rc);
}
/* initialize meta-sequence. First of all try to get it from lower layer,
* falling down to back store one. In the case this is first run and there is
* not meta-sequence initialized yet - store it to backstore. */
-int seq_mgr_setup(struct lu_seq_mgr *mgr)
+int seq_mgr_setup(struct lu_context *ctx, struct lu_seq_mgr *mgr)
{
int rc = 0;
ENTRY;
/* allocate next seq after root one */
mgr->m_seq = LUSTRE_ROOT_FID_SEQ + 1;
- rc = seq_mgr_read(mgr);
- if (rc == -EOPNOTSUPP) {
- /* provide zero error and let continue with default value of
- * sequence. */
- GOTO(out, rc = 0);
- } else if (rc == -ENODATA) {
+ rc = seq_mgr_read(ctx, mgr);
+ if (rc == -ENODATA) {
CWARN("initialize sequence by defaut ["LPU64"]\n", mgr->m_seq);
/* initialize new sequence config as it is not yet created. */
- rc = seq_mgr_write(mgr);
- if (rc == -EOPNOTSUPP) {
- /* provide zero error and let continue with default
- * value of sequence. */
- CERROR("can't update save initial sequence. "
- "No method defined\n");
- GOTO(out, rc = 0);
- }
+ rc = seq_mgr_write(ctx, mgr);
}
EXIT;
-out:
if (rc == 0)
CWARN("using start sequence: ["LPU64"]\n", mgr->m_seq);
return rc;
* parts). This is called by ->ldo_object_init() from the parent
* layer.
*/
- struct lu_object *(*ldo_object_alloc)(struct lu_device *);
+ struct lu_object *(*ldo_object_alloc)(struct lu_context *,
+ struct lu_device *);
/*
* Called before ->ldo_object_free() to signal that object is being
* destroyed.
*/
- void (*ldo_object_delete)(struct lu_object *o);
+ void (*ldo_object_delete)(struct lu_context *ctx, struct lu_object *o);
/*
* Dual to ->ldo_object_alloc(). Called when object is removed from
* memory.
*/
- void (*ldo_object_free)(struct lu_object *o);
+ void (*ldo_object_free)(struct lu_context *ctx, struct lu_object *o);
/*
* Called when last active reference to the object is released (and
* object returns to the cache).
*/
- void (*ldo_object_release)(struct lu_context *ctxt, struct lu_object *o);
+ void (*ldo_object_release)(struct lu_context *ctx, struct lu_object *o);
/*
* Debugging helper. Print given object.
*/
- int (*ldo_object_print)(struct seq_file *f, const struct lu_object *o);
+ int (*ldo_object_print)(struct lu_context *ctx,
+ struct seq_file *f, const struct lu_object *o);
};
/*
__u32 la_nlink;
};
-/* the context of the ops*/
-struct lu_context {
- struct lu_attr lc_attr;
-};
-
/*
* Layer in the layered object.
*/
}
void lu_object_put(struct lu_context *ctxt, struct lu_object *o);
-void lu_site_purge(struct lu_site *s, int nr);
-int lu_object_print(struct seq_file *f, const struct lu_object *o);
+void lu_site_purge(struct lu_context *ctx, struct lu_site *s, int nr);
+int lu_object_print(struct lu_context *ctxt,
+ struct seq_file *f, const struct lu_object *o);
struct lu_object *lu_object_find(struct lu_context *ctxt,
struct lu_site *s, const struct lu_fid *f);
struct lu_object *lu_object_locate(struct lu_object_header *h,
struct lu_device_type *dtype);
+/*
+ * lu_context. Execution context for lu_object methods. Currently associated
+ * with thread.
+ */
+struct lu_context {
+ __u32 lc_tags;
+ struct lu_attr lc_attr;
+ struct ptlrpc_thread *lc_thread;
+ void **lc_value;
+};
+
+
+struct lu_context_key {
+ void *(*lct_init)(struct lu_context *ctx);
+ void (*lct_fini)(struct lu_context *ctx, void *data);
+ int lct_index;
+};
+
+int lu_context_key_register(struct lu_context_key *key);
+void *lu_context_key_get(struct lu_context *ctx, struct lu_context_key *key);
+
+int lu_context_init(struct lu_context *ctx);
+void lu_context_fini(struct lu_context *ctx);
+
+void lu_context_enter(struct lu_context *ctx);
+void lu_context_exit(struct lu_context *ctx);
/*
* DT device interface. XXX Probably should go elsewhere.
struct dt_device_operations {
/* method for getting/setting device wide back stored config data, like
* last used meta-sequence, etc. */
- int (*dt_config) (struct dt_device *dev, const char *name,
+ int (*dt_config) (struct lu_context *ctx,
+ struct dt_device *dev, const char *name,
void *buf, int size, int mode);
- int (*dt_statfs)(struct dt_device *dev, struct kstatfs *sfs);
- struct thandle *(*dt_trans_start)(struct dt_device *dev,
+ int (*dt_statfs)(struct lu_context *ctx,
+ struct dt_device *dev, struct kstatfs *sfs);
+ struct thandle *(*dt_trans_start)(struct lu_context *ctx,
+ struct dt_device *dev,
struct txn_param *param);
- void (*dt_trans_stop)(struct thandle *th);
- int (*dt_root_get)(struct dt_device *dev, struct lu_fid *f);
+ void (*dt_trans_stop)(struct lu_context *ctx, struct thandle *th);
+ int (*dt_root_get)(struct lu_context *ctx,
+ struct dt_device *dev, struct lu_fid *f);
};
struct dt_object_operations {
- void (*do_object_lock)(struct dt_object *dt, enum dt_lock_mode mode);
- void (*do_object_unlock)(struct dt_object *dt, enum dt_lock_mode mode);
+ void (*do_object_lock)(struct lu_context *ctx,
+ struct dt_object *dt, enum dt_lock_mode mode);
+ void (*do_object_unlock)(struct lu_context *ctx,
+ struct dt_object *dt, enum dt_lock_mode mode);
int (*do_object_create)(struct lu_context *ctxt,
struct dt_object *dt,
#include <libcfs/list.h>
#include <libcfs/kp30.h>
+struct lu_context;
struct lu_seq_mgr_ops {
- int (*smo_read) (void *opaque, __u64 *);
- int (*smo_write) (void *opaque, __u64 *);
+ int (*smo_read) (struct lu_context *, void *opaque, __u64 *);
+ int (*smo_write) (struct lu_context *, void *opaque, __u64 *);
};
struct lu_seq_mgr {
void seq_mgr_fini(struct lu_seq_mgr *);
/* seq management methods */
-int seq_mgr_setup(struct lu_seq_mgr *);
-int seq_mgr_read(struct lu_seq_mgr *);
-int seq_mgr_write(struct lu_seq_mgr *);
-int seq_mgr_alloc(struct lu_seq_mgr *, __u64 *);
+int seq_mgr_setup(struct lu_context *, struct lu_seq_mgr *);
+int seq_mgr_read(struct lu_context *, struct lu_seq_mgr *);
+int seq_mgr_write(struct lu_context *, struct lu_seq_mgr *);
+int seq_mgr_alloc(struct lu_context *, struct lu_seq_mgr *, __u64 *);
#endif /* __LINUX_OBD_CLASS_H */
struct md_device_operations {
/* method for getting/setting device wide back stored config data, like
* last used meta-sequence, etc. */
- int (*mdo_config) (struct md_device *m, const char *name,
+ int (*mdo_config) (struct lu_context *ctx,
+ struct md_device *m, const char *name,
void *buf, int size, int mode);
/* meta-data device related handlers. */
- int (*mdo_root_get)(struct md_device *m, struct lu_fid *f);
- int (*mdo_statfs)(struct md_device *m, struct kstatfs *sfs);
+ int (*mdo_root_get)(struct lu_context *ctx,
+ struct md_device *m, struct lu_fid *f);
+ int (*mdo_statfs)(struct lu_context *ctx,
+ struct md_device *m, struct kstatfs *sfs);
};
struct md_device {
#include "mdd_internal.h"
-static struct thandle* mdd_trans_start(struct mdd_device *, struct txn_param *);
-static void mdd_trans_stop(struct mdd_device *mdd, struct thandle *handle);
+static struct thandle* mdd_trans_start(struct lu_context *ctxt,
+ struct mdd_device *, struct txn_param *);
+static void mdd_trans_stop(struct lu_context *ctxt,
+ struct mdd_device *mdd, struct thandle *handle);
static struct dt_object* mdd_object_child(struct mdd_object *o);
static struct lu_device_operations mdd_lu_ops;
-static void mdd_lock(struct mdd_object *obj, enum dt_lock_mode mode);
-static void mdd_unlock(struct mdd_object *obj, enum dt_lock_mode mode);
+static void mdd_lock(struct lu_context *ctx,
+ struct mdd_object *obj, enum dt_lock_mode mode);
+static void mdd_unlock(struct lu_context *ctx,
+ struct mdd_object *obj, enum dt_lock_mode mode);
static struct md_object_operations mdd_obj_ops;
return d->mdd_child->dd_ops;
}
-static struct lu_object *mdd_object_alloc(struct lu_device *d)
+static struct lu_object *mdd_object_alloc(struct lu_context *ctxt,
+ struct lu_device *d)
{
struct mdd_object *mdo;
ENTRY;
ENTRY;
under = &d->mdd_child->dd_lu_dev;
- below = under->ld_ops->ldo_object_alloc(under);
+ below = under->ld_ops->ldo_object_alloc(ctxt, under);
if (below == NULL)
RETURN(-ENOMEM);
RETURN(0);
}
-static void mdd_object_free(struct lu_object *o)
+static void mdd_object_free(struct lu_context *ctxt, struct lu_object *o)
{
struct lu_object_header *h;
struct mdd_object *mdd = mdd_obj(o);
int rc ;
ENTRY;
- handle = mdd_trans_start(mdd, &TXN_PARAM(MDD_OBJECT_DESTROY_CREDITS));
+ handle = mdd_trans_start(ctxt, mdd,
+ &TXN_PARAM(MDD_OBJECT_DESTROY_CREDITS));
if (IS_ERR(handle))
RETURN(PTR_ERR(handle));
- mdd_lock(mdd_obj, DT_WRITE_LOCK);
+ mdd_lock(ctxt, mdd_obj, DT_WRITE_LOCK);
if (open_orphan(mdd_obj))
rc = mdd_add_orphan(mdd, mdd_obj, handle);
else {
rc = mdd_add_unlink_log(mdd, mdd_obj, handle);
}
- mdd_unlock(mdd_obj, DT_WRITE_LOCK);
- mdd_trans_stop(mdd, handle);
+ mdd_unlock(ctxt, mdd_obj, DT_WRITE_LOCK);
+ mdd_trans_stop(ctxt, mdd, handle);
RETURN(rc);
}
CERROR("Failed to get nlink: %d. Pretending nonzero.\n", rc);
}
-static int mdd_object_print(struct seq_file *f, const struct lu_object *o)
+static int mdd_object_print(struct lu_context *ctxt,
+ struct seq_file *f, const struct lu_object *o)
{
return seq_printf(f, LUSTRE_MDD0_NAME"-object@%p", o);
}
struct dt_object, do_lu);
}
-static void mdd_lock(struct mdd_object *obj, enum dt_lock_mode mode)
+static void mdd_lock(struct lu_context *ctxt,
+ struct mdd_object *obj, enum dt_lock_mode mode)
{
struct dt_object *next = mdd_object_child(obj);
- next->do_ops->do_object_lock(next, mode);
+ next->do_ops->do_object_lock(ctxt, next, mode);
}
-static void mdd_unlock(struct mdd_object *obj, enum dt_lock_mode mode)
+static void mdd_unlock(struct lu_context *ctxt,
+ struct mdd_object *obj, enum dt_lock_mode mode)
{
struct dt_object *next = mdd_object_child(obj);
- next->do_ops->do_object_unlock(next, mode);
+ next->do_ops->do_object_unlock(ctxt, next, mode);
}
-static void mdd_lock2(struct mdd_object *o0, struct mdd_object *o1)
+static void mdd_lock2(struct lu_context *ctxt,
+ struct mdd_object *o0, struct mdd_object *o1)
{
- mdd_lock(o0, DT_WRITE_LOCK);
- mdd_lock(o1, DT_WRITE_LOCK);
+ mdd_lock(ctxt, o0, DT_WRITE_LOCK);
+ mdd_lock(ctxt, o1, DT_WRITE_LOCK);
}
-static void mdd_unlock2(struct mdd_object *o0, struct mdd_object *o1)
+static void mdd_unlock2(struct lu_context *ctxt,
+ struct mdd_object *o0, struct mdd_object *o1)
{
- mdd_unlock(o0, DT_WRITE_LOCK);
- mdd_unlock(o1, DT_WRITE_LOCK);
+ mdd_unlock(ctxt, o0, DT_WRITE_LOCK);
+ mdd_unlock(ctxt, o1, DT_WRITE_LOCK);
}
-static struct thandle* mdd_trans_start(struct mdd_device *mdd,
+static struct thandle* mdd_trans_start(struct lu_context *ctxt,
+ struct mdd_device *mdd,
struct txn_param *p)
{
- return mdd_child_ops(mdd)->dt_trans_start(mdd->mdd_child, p);
+ return mdd_child_ops(mdd)->dt_trans_start(ctxt, mdd->mdd_child, p);
}
-static void mdd_trans_stop(struct mdd_device *mdd, struct thandle *handle)
+static void mdd_trans_stop(struct lu_context *ctxt,
+ struct mdd_device *mdd, struct thandle *handle)
{
- mdd_child_ops(mdd)->dt_trans_stop(handle);
+ mdd_child_ops(mdd)->dt_trans_stop(ctxt, handle);
}
static int
int rc;
ENTRY;
- handle = mdd_trans_start(mdd, &TXN_PARAM(MDD_OBJECT_CREATE_CREDITS));
+ handle = mdd_trans_start(ctxt, mdd,
+ &TXN_PARAM(MDD_OBJECT_CREATE_CREDITS));
if (IS_ERR(handle))
RETURN(PTR_ERR(handle));
rc = __mdd_object_create(ctxt, mdd, mdd_pobj, mdd_child, arg, handle);
- mdd_trans_stop(mdd, handle);
+ mdd_trans_stop(ctxt, mdd, handle);
RETURN(rc);
}
int rc;
ENTRY;
- handle = mdd_trans_start(mdd, &TXN_PARAM(MDD_ATTR_SET_CREDITS));
+ handle = mdd_trans_start(ctxt, mdd, &TXN_PARAM(MDD_ATTR_SET_CREDITS));
if (!handle)
RETURN(-ENOMEM);
rc = __mdd_attr_set(ctxt, mdd, mdo2mddo(obj), buf, buf_len, name,
arg, handle);
- mdd_trans_stop(mdd, handle);
+ mdd_trans_stop(ctxt, mdd, handle);
RETURN(rc);
}
struct dt_object *next = mdd_object_child(pobj);
ENTRY;
- mdd_lock2(pobj, obj);
+ mdd_lock2(ctxt, pobj, obj);
- rc = next->do_ops->do_index_insert(ctxt, next, mdd_object_getfid(obj), name,
- arg, handle);
- mdd_unlock2(pobj, obj);
+ rc = next->do_ops->do_index_insert(ctxt, next, mdd_object_getfid(obj),
+ name, arg, handle);
+ mdd_unlock2(ctxt, pobj, obj);
RETURN(rc);
}
struct thandle *handle;
ENTRY;
- handle = mdd_trans_start(mdd, &TXN_PARAM(MDD_INDEX_INSERT_CREDITS));
+ handle = mdd_trans_start(ctxt, mdd,
+ &TXN_PARAM(MDD_INDEX_INSERT_CREDITS));
if (IS_ERR(handle))
RETURN(PTR_ERR(handle));
rc = __mdd_index_insert(ctxt, mdd, mdo2mddo(pobj), mdo2mddo(obj),
name, arg, handle);
- mdd_trans_stop(mdd, handle);
+ mdd_trans_stop(ctxt, mdd, handle);
RETURN(rc);
}
struct dt_object *next = mdd_object_child(pobj);
ENTRY;
- mdd_lock2(pobj, obj);
+ mdd_lock2(ctxt, pobj, obj);
rc = next->do_ops->do_index_delete(ctxt, next, mdd_object_getfid(obj),
name, arg, handle);
- mdd_unlock2(pobj, obj);
+ mdd_unlock2(ctxt, pobj, obj);
RETURN(rc);
}
int rc;
ENTRY;
- handle = mdd_trans_start(mdd, &TXN_PARAM(MDD_INDEX_DELETE_CREDITS));
+ handle = mdd_trans_start(ctxt, mdd,
+ &TXN_PARAM(MDD_INDEX_DELETE_CREDITS));
if (IS_ERR(handle))
RETURN(PTR_ERR(handle));
rc = __mdd_index_delete(ctxt, mdd, mdd_pobj, mdd_obj, name, arg,
handle);
- mdd_trans_stop(mdd, handle);
+ mdd_trans_stop(ctxt, mdd, handle);
RETURN(rc);
}
int rc, nlink;
ENTRY;
- handle = mdd_trans_start(mdd, &TXN_PARAM(MDD_LINK_CREDITS));
+ handle = mdd_trans_start(ctxt, mdd, &TXN_PARAM(MDD_LINK_CREDITS));
if (IS_ERR(handle))
RETURN(PTR_ERR(handle));
- mdd_lock2(mdd_tobj, mdd_sobj);
+ mdd_lock2(ctxt, mdd_tobj, mdd_sobj);
rc = __mdd_index_insert(ctxt, mdd, mdd_tobj, mdd_sobj, name, arg,
handle);
rc = __mdd_attr_set(ctxt, mdd, mdd_sobj, &nlink, sizeof(nlink), "NLINK",
arg, handle);
exit:
- mdd_unlock2(mdd_tobj, mdd_sobj);
+ mdd_unlock2(ctxt, mdd_tobj, mdd_sobj);
- mdd_trans_stop(mdd, handle);
+ mdd_trans_stop(ctxt, mdd, handle);
RETURN(rc);
}
int rc;
struct thandle *handle;
- handle = mdd_trans_start(mdd, &TXN_PARAM(MDD_RENAME_CREDITS));
+ handle = mdd_trans_start(ctxt, mdd, &TXN_PARAM(MDD_RENAME_CREDITS));
if (IS_ERR(handle))
RETURN(PTR_ERR(handle));
GOTO(cleanup, rc);
cleanup:
mdd_rename_unlock(mdd, mdd_spobj, mdd_tpobj, mdd_sobj, mdd_tobj);
- mdd_trans_stop(mdd, handle);
+ mdd_trans_stop(ctxt, mdd, handle);
RETURN(rc);
}
int rc = 0;
ENTRY;
- handle = mdd_trans_start(mdd, &TXN_PARAM(MDD_MKDIR_CREDITS));
+ handle = mdd_trans_start(ctxt, mdd, &TXN_PARAM(MDD_MKDIR_CREDITS));
if (IS_ERR(handle))
RETURN(PTR_ERR(handle));
- mdd_lock(mdo2mddo(pobj), DT_WRITE_LOCK);
+ mdd_lock(ctxt, mdo2mddo(pobj), DT_WRITE_LOCK);
rc = __mdd_object_create(ctxt, mdd, mdo2mddo(pobj), mdo2mddo(child),
NULL, handle);
if (rc)
GOTO(cleanup, rc);
cleanup:
- mdd_unlock(mdo2mddo(pobj), DT_WRITE_LOCK);
- mdd_trans_stop(mdd, handle);
+ mdd_unlock(ctxt, mdo2mddo(pobj), DT_WRITE_LOCK);
+ mdd_trans_stop(ctxt, mdd, handle);
RETURN(rc);
}
-static int mdd_root_get(struct md_device *m, struct lu_fid *f)
+static int mdd_root_get(struct lu_context *ctx,
+ struct md_device *m, struct lu_fid *f)
{
struct mdd_device *mdd = lu2mdd_dev(&m->md_lu_dev);
ENTRY;
- RETURN(mdd_child_ops(mdd)->dt_root_get(mdd->mdd_child, f));
+ RETURN(mdd_child_ops(mdd)->dt_root_get(ctx, mdd->mdd_child, f));
}
-static int mdd_config(struct md_device *m, const char *name,
- void *buf, int size, int mode)
+static int mdd_config(struct lu_context *ctx, struct md_device *m,
+ const char *name, void *buf, int size, int mode)
{
struct mdd_device *mdd = lu2mdd_dev(&m->md_lu_dev);
int rc;
ENTRY;
- rc = mdd_child_ops(mdd)->dt_config(mdd->mdd_child,
+ rc = mdd_child_ops(mdd)->dt_config(ctx, mdd->mdd_child,
name, buf, size, mode);
RETURN(rc);
}
-static int mdd_statfs(struct md_device *m, struct kstatfs *sfs) {
+static int mdd_statfs(struct lu_context *ctx,
+ struct md_device *m, struct kstatfs *sfs) {
struct mdd_device *mdd = lu2mdd_dev(&m->md_lu_dev);
int rc;
ENTRY;
- rc = mdd_child_ops(mdd)->dt_statfs(mdd->mdd_child, sfs);
+ rc = mdd_child_ops(mdd)->dt_statfs(ctx, mdd->mdd_child, sfs);
RETURN(rc);
}
if (!IS_ERR(child)) {
struct md_object *next = mdt_object_child(o);
- result = next->mo_ops->moo_mkdir(next, name,
+ result = next->mo_ops->moo_mkdir(&info->mti_ctxt, next, name,
mdt_object_child(child));
mdt_object_put(child);
} else
result = -ENOMEM;
else {
body = lustre_msg_buf(req->rq_repmsg, 0, sizeof *body);
- result = next->md_ops->mdo_root_get(next, &body->fid1);
+ result = next->md_ops->mdo_root_get(&info->mti_ctxt,
+ next, &body->fid1);
}
/* the last_committed and last_xid fields are filled in for all
} else {
osfs = lustre_msg_buf(req->rq_repmsg, 0, size);
/* XXX max_age optimisation is needed here. See mds_statfs */
- result = next->md_ops->mdo_statfs(next, &sfs);
+ result = next->md_ops->mdo_statfs(&info->mti_ctxt, next, &sfs);
statfs_pack(osfs, &sfs);
}
static int mdt_connect(struct mdt_thread_info *info,
struct ptlrpc_request *req, int offset)
{
- return target_handle_connect(req, mdt_handle);
+ int result;
+
+ result = target_handle_connect(req, mdt_handle);
+ if (result == 0) {
+ struct obd_connect_data *data;
+ struct mdt_device *mdt;
+
+ mdt = mdt_dev(req->rq_export->exp_obd->obd_lu_dev);
+ data = lustre_msg_buf(req->rq_repmsg, 0, sizeof *data);
+ result = seq_mgr_alloc(&info->mti_ctxt,
+ mdt->mdt_seq_mgr, &data->ocd_seq);
+ }
+ return result;
}
static int mdt_disconnect(struct mdt_thread_info *info,
lustre_swab_reqbuf(req, off, sizeof *info->mti_body,
lustre_swab_mdt_body);
if (body != NULL) {
- info->mti_object = mdt_object_find(&info->mti_ctxt, info->mti_mdt,
+ info->mti_object = mdt_object_find(&info->mti_ctxt,
+ info->mti_mdt,
&body->fid1);
if (IS_ERR(info->mti_object))
result = PTR_ERR(info->mti_object);
{
int i;
- memset(info, 0, sizeof *info);
info->mti_fail_id = OBD_FAIL_MDS_ALL_REPLY_NET;
/*
* Poison size array.
info->mti_rep_buf_nr = i;
for (i = 0; i < ARRAY_SIZE(info->mti_lh); i++)
mdt_lock_handle_init(&info->mti_lh[i]);
+ lu_context_enter(&info->mti_ctxt);
}
static void mdt_thread_info_fini(struct mdt_thread_info *info)
{
int i;
+ lu_context_exit(&info->mti_ctxt);
if (info->mti_object != NULL) {
mdt_object_put(&info->mti_ctxt, info->mti_object);
info->mti_object = NULL;
/* it can be NULL while CONNECT */
if (req->rq_export)
info->mti_mdt = mdt_dev(req->rq_export->exp_obd->obd_lu_dev);
+ info->mti_ctxt.lc_thread = req->rq_svc_thread;
result = mdt_handle0(req, info);
mdt_thread_info_fini(info);
prntfn, c->psc_num_threads);
}
-static int mdt_config(struct mdt_device *m, const char *name,
- void *buf, int size, int mode)
+static int mdt_config(struct lu_context *ctx, struct mdt_device *m,
+ const char *name, void *buf, int size, int mode)
{
struct md_device *child = m->mdt_child;
- int rc;
ENTRY;
-
- if (!child->md_ops->mdo_config)
- RETURN(-EOPNOTSUPP);
-
- rc = child->md_ops->mdo_config(child, name, buf, size, mode);
- RETURN(rc);
+ RETURN(child->md_ops->mdo_config(ctx, child, name, buf, size, mode));
}
-static int mdt_seq_mgr_hpr(void *opaque, __u64 *seq,
+static int mdt_seq_mgr_hpr(struct lu_context *ctx, void *opaque, __u64 *seq,
int mode)
{
struct mdt_device *m = opaque;
int rc;
ENTRY;
- rc = mdt_config(m, LUSTRE_CONFIG_METASEQ,
+ rc = mdt_config(ctx, m, LUSTRE_CONFIG_METASEQ,
seq, sizeof(*seq),
mode);
RETURN(rc);
}
-static int mdt_seq_mgr_read(void *opaque, __u64 *seq)
+static int mdt_seq_mgr_read(struct lu_context *ctx, void *opaque, __u64 *seq)
{
ENTRY;
- RETURN(mdt_seq_mgr_hpr(opaque, seq, LUSTRE_CONFIG_GET));
+ RETURN(mdt_seq_mgr_hpr(ctx, opaque, seq, LUSTRE_CONFIG_GET));
}
-static int mdt_seq_mgr_write(void *opaque, __u64 *seq)
+static int mdt_seq_mgr_write(struct lu_context *ctx, void *opaque, __u64 *seq)
{
ENTRY;
- RETURN(mdt_seq_mgr_hpr(opaque, seq, LUSTRE_CONFIG_SET));
+ RETURN(mdt_seq_mgr_hpr(ctx, opaque, seq, LUSTRE_CONFIG_SET));
}
struct lu_seq_mgr_ops seq_mgr_ops = {
- .smo_read = mdt_seq_mgr_read,
+ .smo_read = mdt_seq_mgr_read,
.smo_write = mdt_seq_mgr_write
};
struct lu_device *mdt_child;
const char *top = lustre_cfg_string(cfg, 0);
const char *child = lustre_cfg_string(cfg, 1);
+ struct lu_context ctx;
ENTRY;
GOTO(err_fini_child, rc);
}
+ rc = lu_context_init(&ctx);
+ if (rc != 0)
+ GOTO(err_fini_mgr, rc);
+
+ lu_context_enter(&ctx);
/* init sequence info after device stack is initialized. */
- rc = seq_mgr_setup(m->mdt_seq_mgr);
+ rc = seq_mgr_setup(&ctx, m->mdt_seq_mgr);
+ lu_context_exit(&ctx);
if (rc)
- GOTO(err_fini_mgr, rc);
+ GOTO(err_fini_ctx, rc);
rc = ptlrpc_start_threads(NULL, m->mdt_service, LUSTRE_MDT0_NAME);
if (rc)
- GOTO(err_fini_mgr, rc);
+ GOTO(err_fini_ctx, rc);
+ lu_context_fini(&ctx);
RETURN(0);
+err_fini_ctx:
+ lu_context_fini(&ctx);
err_fini_mgr:
seq_mgr_fini(m->mdt_seq_mgr);
m->mdt_seq_mgr = NULL;
RETURN(rc);
}
-static struct lu_object *mdt_object_alloc(struct lu_device *d)
+static struct lu_object *mdt_object_alloc(struct lu_context *ctxt,
+ struct lu_device *d)
{
struct mdt_object *mo;
struct lu_object *below;
under = &d->mdt_child->md_lu_dev;
- below = under->ld_ops->ldo_object_alloc(under);
+ below = under->ld_ops->ldo_object_alloc(ctxt, under);
if (below != NULL) {
lu_object_add(o, below);
return 0;
return -ENOMEM;
}
-static void mdt_object_free(struct lu_object *o)
+static void mdt_object_free(struct lu_context *ctxt, struct lu_object *o)
{
struct lu_object_header *h;
{
}
-static int mdt_object_print(struct seq_file *f, const struct lu_object *o)
+static int mdt_object_print(struct lu_context *ctxt,
+ struct seq_file *f, const struct lu_object *o)
{
return seq_printf(f, LUSTRE_MDT0_NAME"-object@%p", o);
}
/* mds_connect copy */
static int mdt_obd_connect(struct lustre_handle *conn, struct obd_device *obd,
- struct obd_uuid *cluuid, struct obd_connect_data *data)
+ struct obd_uuid *cluuid,
+ struct obd_connect_data *data)
{
struct obd_export *exp;
int rc, abort_recovery;
memcpy(mcd->mcd_uuid, cluuid, sizeof(mcd->mcd_uuid));
med->med_mcd = mcd;
- rc = seq_mgr_alloc(mdt->mdt_seq_mgr, &data->ocd_seq);
- if (rc)
- GOTO(out, rc);
out:
if (rc) {
if (mcd) {
static void *mdt_thread_init(struct ptlrpc_thread *t)
{
struct mdt_thread_info *info;
+ int result;
- return OBD_ALLOC_PTR(info) ? : ERR_PTR(-ENOMEM);
+ OBD_ALLOC_PTR(info);
+ if (info != NULL)
+ result = lu_context_init(&info->mti_ctxt);
+ else
+ result = -ENOMEM;
+ if (result != 0)
+ info = ERR_PTR(result);
+ return info;
}
static void mdt_thread_fini(struct ptlrpc_thread *t, void *data)
{
struct mdt_thread_info *info = data;
+ lu_context_fini(&info->mti_ctxt);
OBD_FREE_PTR(info);
}
* reduce stack consumption.
*/
struct mdt_thread_info {
- struct lu_context mti_ctxt;
+ struct lu_context mti_ctxt;
struct mdt_device *mti_mdt;
/*
* number of buffers in reply message.
#include <libcfs/list.h>
-static void lu_object_free(struct lu_object *o);
+static void lu_object_free(struct lu_context *ctx, struct lu_object *o);
void lu_object_put(struct lu_context *ctxt, struct lu_object *o)
{
* Object was already removed from hash and lru above, can
* kill it.
*/
- lu_object_free(o);
+ lu_object_free(ctxt, o);
}
EXPORT_SYMBOL(lu_object_put);
int clean;
int result;
- top = s->ls_top_dev->ld_ops->ldo_object_alloc(s->ls_top_dev);
+ top = s->ls_top_dev->ld_ops->ldo_object_alloc(ctxt, s->ls_top_dev);
if (IS_ERR(top))
RETURN(top);
*lu_object_fid(top) = *f;
continue;
clean = 0;
scan->lo_header = top->lo_header;
- result = lu_object_ops(scan)->ldo_object_init(ctxt, scan);
+ result = lu_object_ops(scan)->ldo_object_init(ctxt,
+ scan);
if (result != 0) {
- lu_object_free(top);
+ lu_object_free(ctxt, top);
RETURN(ERR_PTR(result));
}
scan->lo_flags |= LU_OBJECT_ALLOCATED;
RETURN(top);
}
-static void lu_object_free(struct lu_object *o)
+static void lu_object_free(struct lu_context *ctx, struct lu_object *o)
{
struct list_head splice;
struct lu_object *scan;
list_for_each_entry_reverse(scan,
&o->lo_header->loh_layers, lo_linkage) {
if (lu_object_ops(scan)->ldo_object_delete != NULL)
- lu_object_ops(scan)->ldo_object_delete(scan);
+ lu_object_ops(scan)->ldo_object_delete(ctx, scan);
}
-- o->lo_dev->ld_site->ls_total;
INIT_LIST_HEAD(&splice);
o = container_of(splice.next, struct lu_object, lo_linkage);
list_del_init(&o->lo_linkage);
LASSERT(lu_object_ops(o)->ldo_object_free != NULL);
- lu_object_ops(o)->ldo_object_free(o);
+ lu_object_ops(o)->ldo_object_free(ctx, o);
}
}
-void lu_site_purge(struct lu_site *s, int nr)
+void lu_site_purge(struct lu_context *ctx, struct lu_site *s, int nr)
{
struct list_head dispose;
struct lu_object_header *h;
h = container_of(dispose.next,
struct lu_object_header, loh_lru);
list_del_init(&h->loh_lru);
- lu_object_free(lu_object_top(h));
+ lu_object_free(ctx, lu_object_top(h));
s->ls_stats.s_lru_purged ++;
}
}
EXPORT_SYMBOL(lu_site_purge);
-int lu_object_print(struct seq_file *f, const struct lu_object *o)
+int lu_object_print(struct lu_context *ctx,
+ struct seq_file *f, const struct lu_object *o)
{
static char ruler[] = "........................................";
const struct lu_object *scan;
break;
LASSERT(lu_object_ops(scan)->ldo_object_print != NULL);
nob += seq_printf(f, "%*.*s", depth, depth, ruler);
- nob += lu_object_ops(scan)->ldo_object_print(f, scan);
+ nob += lu_object_ops(scan)->ldo_object_print(ctx, f, scan);
nob += seq_printf(f, "\n");
}
return nob;
s->ls_stats.s_cache_race ++;
spin_unlock(&s->ls_guard);
if (o != NULL)
- lu_object_free(o);
+ lu_object_free(ctxt, o);
return shadow;
}
EXPORT_SYMBOL(lu_object_find);
return NULL;
}
EXPORT_SYMBOL(lu_object_locate);
+
+enum {
+ /*
+ * Maximal number of tld slots.
+ */
+ LU_CONTEXT_KEY_NR = 16
+};
+
+static struct lu_context_key *keys[LU_CONTEXT_KEY_NR] = { NULL, };
+
+static int keys_nr = 0;
+static spinlock_t keys_guard = SPIN_LOCK_UNLOCKED;
+static int key_registration_over = 0;
+
+int lu_context_key_register(struct lu_context_key *key)
+{
+ int result;
+
+ if (!key_registration_over) {
+ spin_lock(&keys_guard);
+ if (keys_nr < ARRAY_SIZE(keys)) {
+ key->lct_index = keys_nr;
+ keys[keys_nr] = key;
+ keys_nr++;
+ result = 0;
+ } else
+ result = -ENFILE;
+ spin_unlock(&keys_guard);
+ } else {
+ CERROR("Too late to register a key.\n");
+ result = -EBUSY;
+ }
+ return result;
+}
+EXPORT_SYMBOL(lu_context_key_register);
+
+void *lu_context_key_get(struct lu_context *ctx, struct lu_context_key *key)
+{
+ return ctx->lc_value[key->lct_index];
+}
+EXPORT_SYMBOL(lu_context_key_get);
+
+static void keys_fini(struct lu_context *ctx)
+{
+ int i;
+
+ if (ctx->lc_value != NULL) {
+ for (i = 0; i < keys_nr; ++i) {
+ if (ctx->lc_value[i] != NULL) {
+ LASSERT(keys[i] != NULL);
+ LASSERT(keys[i]->lct_fini != NULL);
+
+ keys[i]->lct_fini(ctx, ctx->lc_value[i]);
+ ctx->lc_value[i] = NULL;
+ }
+ }
+ OBD_FREE(ctx->lc_value, keys_nr * sizeof ctx->lc_value[0]);
+ ctx->lc_value = NULL;
+ }
+}
+
+static int keys_init(struct lu_context *ctx)
+{
+ int i;
+ int result;
+
+ key_registration_over = 1;
+
+ OBD_ALLOC(ctx->lc_value, keys_nr * sizeof ctx->lc_value[0]);
+ if (ctx->lc_value != NULL) {
+ for (i = 0; i < ARRAY_SIZE(keys); ++i) {
+ if (keys[i] != NULL) {
+ void *value;
+
+ LASSERT(keys[i]->lct_init != NULL);
+ LASSERT(keys[i]->lct_index == i);
+
+ value = keys[i]->lct_init(ctx);
+ if (IS_ERR(value)) {
+ keys_fini(ctx);
+ return PTR_ERR(value);
+ }
+ ctx->lc_value[i] = value;
+ }
+ }
+ result = 0;
+ } else
+ result = -ENOMEM;
+ return result;
+}
+
+int lu_context_init(struct lu_context *ctx)
+{
+ memset(ctx, 0, sizeof *ctx);
+ keys_init(ctx);
+ return 0;
+}
+EXPORT_SYMBOL(lu_context_init);
+
+void lu_context_fini(struct lu_context *ctx)
+{
+ keys_fini(ctx);
+}
+EXPORT_SYMBOL(lu_context_fini);
+
+void lu_context_enter(struct lu_context *ctx)
+{
+}
+EXPORT_SYMBOL(lu_context_enter);
+
+void lu_context_exit(struct lu_context *ctx)
+{
+}
+EXPORT_SYMBOL(lu_context_exit);
#include "osd_internal.h"
-static int osd_root_get (struct dt_device *dev, struct lu_fid *f);
-static int osd_statfs (struct dt_device *dev, struct kstatfs *sfs);
+static int osd_root_get (struct lu_context *ctxt,
+ struct dt_device *dev, struct lu_fid *f);
+static int osd_statfs (struct lu_context *ctxt,
+ struct dt_device *dev, struct kstatfs *sfs);
static int lu_device_is_osd (const struct lu_device *d);
static void osd_mod_exit (void) __exit;
static int osd_mod_init (void) __init;
-static void *osd_thread_init (struct ptlrpc_thread *t);
-static void osd_thread_fini (struct ptlrpc_thread *t, void *data);
static int osd_type_init (struct lu_device_type *t);
static void osd_type_fini (struct lu_device_type *t);
static int osd_object_init (struct lu_context *ctxt, struct lu_object *l);
static void osd_object_release(struct lu_context *ctxt, struct lu_object *l);
-static int osd_object_print (struct seq_file *f, const struct lu_object *o);
+static int osd_object_print (struct lu_context *ctx,
+ struct seq_file *f, const struct lu_object *o);
static void osd_device_free (struct lu_device *m);
static void osd_device_fini (struct lu_device *d);
static int osd_device_init (struct lu_device *d, const char *conf);
-static struct lu_object *osd_object_alloc(struct lu_device *d);
static struct osd_object *osd_obj (const struct lu_object *o);
static struct osd_device *osd_dev (const struct lu_device *d);
static struct osd_device *osd_dt_dev (const struct dt_device *d);
static struct lu_device *osd_device_alloc(struct lu_device_type *t,
struct lustre_cfg *cfg);
+static struct lu_object *osd_object_alloc(struct lu_context *ctx,
+ struct lu_device *d);
static struct lu_device_type_operations osd_device_type_ops;
static struct lu_device_type osd_device_type;
-static struct ptlrpc_thread_key osd_thread_key;
static struct obd_ops osd_obd_device_ops;
static struct lprocfs_vars lprocfs_osd_module_vars[];
static struct lprocfs_vars lprocfs_osd_obd_vars[];
/*
* DT methods.
*/
-static int osd_root_get(struct dt_device *dev, struct lu_fid *f)
+static int osd_root_get(struct lu_context *ctx,
+ struct dt_device *dev, struct lu_fid *f)
{
struct osd_device *od = osd_dt_dev(dev);
* OSD object methods.
*/
-static struct lu_object *osd_object_alloc(struct lu_device *d)
+static struct lu_object *osd_object_alloc(struct lu_context *ctx,
+ struct lu_device *d)
{
struct osd_object *mo;
return NULL;
}
-static int osd_getattr(struct inode *inode, struct lu_attr *attr)
+static int osd_getattr(struct lu_context *ctx,
+ struct inode *inode, struct lu_attr *attr)
{
//attr->la_atime = inode->i_atime;
//attr->la_mtime = inode->i_mtime;
/* fill lu_attr in ctxt */
//XXX temporary hack for proto only
- osd_getattr(d->od_mount->lmi_sb->s_root->d_inode, &ctxt->lc_attr);
+ osd_getattr(ctxt,
+ d->od_mount->lmi_sb->s_root->d_inode, &ctxt->lc_attr);
/*
* use object index to locate dentry/inode by fid.
return 0;
}
-static void osd_object_free(struct lu_object *l)
+static void osd_object_free(struct lu_context *ctx, struct lu_object *l)
{
struct osd_object *o = osd_obj(l);
dput(o->oo_dentry);
}
-static void osd_object_delete(struct lu_object *l)
+static void osd_object_delete(struct lu_context *ctx, struct lu_object *l)
{
}
set_bit(LU_OBJECT_HEARD_BANSHEE, &l->lo_header->loh_flags);
}
-static int osd_object_print(struct seq_file *f, const struct lu_object *l)
+static int osd_object_print(struct lu_context *ctx,
+ struct seq_file *f, const struct lu_object *l)
{
struct osd_object *o = osd_obj(l);
o, o->oo_dentry);
}
-struct osd_thread_info {
-};
-
-/*
- * ptlrpc_key call-backs.
- */
-static void *osd_thread_init(struct ptlrpc_thread *t)
-{
- struct osd_thread_info *info;
-
- return OBD_ALLOC_PTR(info) ? : ERR_PTR(-ENOMEM);
-}
-
-static void osd_thread_fini(struct ptlrpc_thread *t, void *data)
-{
- struct osd_thread_info *info = data;
- OBD_FREE_PTR(info);
-}
-
-
-static struct ptlrpc_thread_key osd_thread_key = {
- .ptk_init = osd_thread_init,
- .ptk_fini = osd_thread_fini
-};
-
-static int osd_config(struct dt_device *d, const char *name,
+static int osd_config(struct lu_context *ctx,
+ struct dt_device *d, const char *name,
void *buf, int size, int mode)
{
struct osd_device *osd = dt2osd_dev(d);
RETURN (result);
}
-static int osd_statfs(struct dt_device *d, struct kstatfs *sfs)
+static int osd_statfs(struct lu_context *ctx,
+ struct dt_device *d, struct kstatfs *sfs)
{
struct osd_device *osd = dt2osd_dev(d);
struct super_block *sb = osd->od_mount->lmi_sb;
*/
static int osd_type_init(struct lu_device_type *t)
{
- return ptlrpc_thread_key_register(&osd_thread_key);
+ return 0;
}
static void osd_type_fini(struct lu_device_type *t)