From: Dmitry Eremin Date: Wed, 9 Nov 2016 12:49:00 +0000 (+0300) Subject: LU-8888 clio: remove unused members from struct cl_thread_info X-Git-Tag: 2.9.54~38 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=ad8f66967d66238539700081d555ebc08e43cead LU-8888 clio: remove unused members from struct cl_thread_info The pointer to the topmost ongoing IO in the thread and other members are not used any more. Change-Id: I4875fe7d0e5f64fd3a4a60fc1bd1877c9d6e3340 Signed-off-by: Dmitry Eremin Reviewed-on: https://review.whamcloud.com/24062 Reviewed-by: John L. Hammond Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Jinshan Xiong Reviewed-by: James Simmons Reviewed-by: Oleg Drokin --- diff --git a/lustre/include/cl_object.h b/lustre/include/cl_object.h index 7e84abb..ad9d769 100644 --- a/lustre/include/cl_object.h +++ b/lustre/include/cl_object.h @@ -2271,7 +2271,6 @@ void cl_io_rw_advance (const struct lu_env *env, struct cl_io *io, size_t nob); int cl_io_cancel (const struct lu_env *env, struct cl_io *io, struct cl_page_list *queue); -int cl_io_is_going (const struct lu_env *env); /** * True, iff \a io is an O_APPEND write(2). diff --git a/lustre/obdclass/cl_internal.h b/lustre/obdclass/cl_internal.h index 361efb0..0f95caf 100644 --- a/lustre/obdclass/cl_internal.h +++ b/lustre/obdclass/cl_internal.h @@ -36,62 +36,18 @@ #ifndef _CL_INTERNAL_H #define _CL_INTERNAL_H -#define CLT_PVEC_SIZE (14) - -/** - * Possible levels of the nesting. Currently this is 2: there are "top" - * entities (files, extent locks), and "sub" entities (stripes and stripe - * locks). This is used only for debugging counters right now. - */ -enum clt_nesting_level { - CNL_TOP, - CNL_SUB, - CNL_NR -}; - /** * Thread local state internal for generic cl-code. */ struct cl_thread_info { - /* - * Common fields. - */ - struct cl_io clt_io; - struct cl_2queue clt_queue; - - /* - * Fields used by cl_lock.c - */ - struct cl_lock_descr clt_descr; - struct cl_page_list clt_list; - /** @} debugging */ - - /* - * Fields used by cl_page.c - */ - struct cl_page *clt_pvec[CLT_PVEC_SIZE]; - - /* - * Fields used by cl_io.c - */ - /** - * Pointer to the topmost ongoing IO in this thread. - */ - struct cl_io *clt_current_io; - /** - * Used for submitting a sync io. - */ - struct cl_sync_io clt_anchor; - /** - * Fields used by cl_lock_discard_pages(). - */ - pgoff_t clt_next_index; - pgoff_t clt_fn_index; /* first non-overlapped index */ + /** + * Used for submitting a sync I/O. + */ + struct cl_sync_io clt_anchor; }; struct cl_thread_info *cl_env_info(const struct lu_env *env); void cl_page_disown0(const struct lu_env *env, struct cl_io *io, struct cl_page *pg); - #endif /* _CL_INTERNAL_H */ diff --git a/lustre/obdclass/cl_io.c b/lustre/obdclass/cl_io.c index 17d7db2..94c3fc5 100644 --- a/lustre/obdclass/cl_io.c +++ b/lustre/obdclass/cl_io.c @@ -67,14 +67,6 @@ static inline int cl_io_is_loopable(const struct cl_io *io) } /** - * Returns true iff there is an IO ongoing in the given environment. - */ -int cl_io_is_going(const struct lu_env *env) -{ - return cl_env_info(env)->clt_current_io != NULL; -} - -/** * cl_io invariant that holds at all times when exported cl_io_*() functions * are entered and left. */ @@ -99,7 +91,6 @@ static int cl_io_invariant(const struct cl_io *io) void cl_io_fini(const struct lu_env *env, struct cl_io *io) { struct cl_io_slice *slice; - struct cl_thread_info *info; LINVRNT(cl_io_type_is_valid(io->ci_type)); LINVRNT(cl_io_invariant(io)); @@ -119,9 +110,6 @@ void cl_io_fini(const struct lu_env *env, struct cl_io *io) slice->cis_io = NULL; } io->ci_state = CIS_FINI; - info = cl_env_info(env); - if (info->clt_current_io == io) - info->clt_current_io = NULL; /* sanity check for layout change */ switch(io->ci_type) { @@ -185,11 +173,8 @@ static int cl_io_init0(const struct lu_env *env, struct cl_io *io, int cl_io_sub_init(const struct lu_env *env, struct cl_io *io, enum cl_io_type iot, struct cl_object *obj) { - struct cl_thread_info *info = cl_env_info(env); - LASSERT(obj != cl_object_top(obj)); - if (info->clt_current_io == NULL) - info->clt_current_io = io; + return cl_io_init0(env, io, iot, obj); } EXPORT_SYMBOL(cl_io_sub_init); @@ -207,12 +192,8 @@ EXPORT_SYMBOL(cl_io_sub_init); int cl_io_init(const struct lu_env *env, struct cl_io *io, enum cl_io_type iot, struct cl_object *obj) { - struct cl_thread_info *info = cl_env_info(env); - LASSERT(obj == cl_object_top(obj)); - LASSERT(info->clt_current_io == NULL); - info->clt_current_io = io; return cl_io_init0(env, io, iot, obj); } EXPORT_SYMBOL(cl_io_init); diff --git a/lustre/obdclass/cl_object.c b/lustre/obdclass/cl_object.c index f024f67..4087020 100644 --- a/lustre/obdclass/cl_object.c +++ b/lustre/obdclass/cl_object.c @@ -1022,20 +1022,8 @@ struct cl_thread_info *cl_env_info(const struct lu_env *env) return lu_context_key_get(&env->le_ctx, &cl_key); } -/* defines cl0_key_{init,fini}() */ -LU_KEY_INIT_FINI(cl0, struct cl_thread_info); - -static void *cl_key_init(const struct lu_context *ctx, - struct lu_context_key *key) -{ - return cl0_key_init(ctx, key); -} - -static void cl_key_fini(const struct lu_context *ctx, - struct lu_context_key *key, void *data) -{ - cl0_key_fini(ctx, key, data); -} +/* defines cl_key_{init,fini}() */ +LU_KEY_INIT_FINI(cl, struct cl_thread_info); static struct lu_context_key cl_key = { .lct_tags = LCT_CL_THREAD,