From 3fab641274d16fb5e51ab70dbb176b7b8b2d042d Mon Sep 17 00:00:00 2001 From: nikita Date: Sat, 27 May 2006 15:35:43 +0000 Subject: [PATCH] add lu_context to new fld code --- lustre/fld/fld_handle.c | 12 +++++------- lustre/fld/fld_internal.h | 4 ++-- lustre/include/dt_object.h | 15 ++++++++------- lustre/include/lustre_fid.h | 6 +++--- 4 files changed, 18 insertions(+), 19 deletions(-) diff --git a/lustre/fld/fld_handle.c b/lustre/fld/fld_handle.c index dfe13a6..769646c 100644 --- a/lustre/fld/fld_handle.c +++ b/lustre/fld/fld_handle.c @@ -342,7 +342,7 @@ static int fld_req_handle(struct ptlrpc_request *req) RETURN(result); } -int fld_server_init(struct lu_context *ctx, struct fld *fld, +int fld_server_init(const struct lu_context *ctx, struct fld *fld, struct dt_device *dt) { int result; @@ -373,15 +373,13 @@ int fld_server_init(struct lu_context *ctx, struct fld *fld, LUSTRE_FLD0_NAME); else result = -ENOMEM; - if (result != 0) { - fld_iam_fini(fld); - fld_server_fini(fld); - } + if (result != 0) + fld_server_fini(ctx, fld); return result; } EXPORT_SYMBOL(fld_server_init); -void fld_server_fini(struct fld *fld) +void fld_server_fini(const struct lu_context *ctx, struct fld *fld) { struct list_head *pos, *n; @@ -399,7 +397,7 @@ void fld_server_fini(struct fld *fld) } spin_unlock(&fld_list_head.fld_lock); lu_device_put(&fld->fld_dt->dd_lu_dev); - fld_iam_fini(fld); + fld_iam_fini(ctx, fld); fld->fld_dt = NULL; } EXPORT_SYMBOL(fld_server_fini); diff --git a/lustre/fld/fld_internal.h b/lustre/fld/fld_internal.h index 379b3f7..9b7a46e 100644 --- a/lustre/fld/fld_internal.h +++ b/lustre/fld/fld_internal.h @@ -71,6 +71,6 @@ int fld_handle_delete(const struct lu_context *ctx, int fld_handle_lookup(const struct lu_context *ctx, struct fld *fld, fidseq_t seq_num, mdsno_t *mds); -int fld_iam_init(struct lu_context *ctx, struct fld *fld); -void fld_iam_fini(struct fld *fld); +int fld_iam_init(const struct lu_context *ctx, struct fld *fld); +void fld_iam_fini(const struct lu_context *ctx, struct fld *fld); #endif diff --git a/lustre/include/dt_object.h b/lustre/include/dt_object.h index ed0f8fb..7ee969d 100644 --- a/lustre/include/dt_object.h +++ b/lustre/include/dt_object.h @@ -255,10 +255,10 @@ struct dt_index_operations { int (*dio_probe)(const struct lu_context *ctxt, struct dt_object *dt, const struct dt_index_features *feat); - int (*dio_init)(struct lu_context *ctxt, struct dt_device *dt, - struct dt_object *dt_obj, void *container, void *param); - - int (*dio_fini)(struct dt_object *dt_obj); + int (*dio_init)(const struct lu_context *ctxt, struct dt_object *obj, + void *container, void *param); + + int (*dio_fini)(const struct lu_context *ctxt, struct dt_object *obj); }; struct dt_device { @@ -293,9 +293,6 @@ struct dt_object { struct dt_index_operations *do_index_ops; }; -struct dt_object *dt_object_find(struct lu_context *ctxt, - struct dt_device *d, - struct lu_fid *f); int dt_object_init(struct dt_object *obj, struct lu_object_header *h, struct lu_device *d); @@ -344,4 +341,8 @@ int dt_txn_hook_stop(const struct lu_context *ctx, int dt_txn_hook_commit(const struct lu_context *ctx, struct dt_device *dev, struct thandle *txn); +struct dt_object *dt_store_open(const struct lu_context *ctx, + struct dt_device *dt, const char *name, + struct lu_fid *fid); + #endif /* __LUSTRE_DT_OBJECT_H */ diff --git a/lustre/include/lustre_fid.h b/lustre/include/lustre_fid.h index aeca14e..2b2ea26 100644 --- a/lustre/include/lustre_fid.h +++ b/lustre/include/lustre_fid.h @@ -81,11 +81,11 @@ struct fld { struct ptlrpc_service *fld_service; struct dt_device *fld_dt; struct dt_object *fld_obj; - void *fld_container; + struct lu_fid fld_fid; /* used during initialization */ }; -int fld_server_init(struct lu_context *ctx, struct fld *fld, +int fld_server_init(const struct lu_context *ctx, struct fld *fld, struct dt_device *dt); -void fld_server_fini(struct fld *fld); +void fld_server_fini(const struct lu_context *ctx, struct fld *fld); #endif /* __LINUX_OBD_CLASS_H */ -- 1.8.3.1