From 5a8dc02609ace484079a66c13e9e35c04af7f06c Mon Sep 17 00:00:00 2001 From: Mr NeilBrown Date: Sat, 17 Apr 2021 20:32:13 -0400 Subject: [PATCH] LU-8837 lustre: move lu_tgt_pool out of obd_target.h 'struct lu_tgt_pool' is the only part of obd_target.h that is needed on the client. So move it and related declarations to lu_object.h. Then obd_target.h does not need to be included by lu_object.h, and it will only be included server-side; Test-Parameters: trivial Signed-off-by: Mr NeilBrown Change-Id: Ia578d766fb7fae6ae2fbcfa651fe5b5264b1ff14 Reviewed-on: https://review.whamcloud.com/41951 Reviewed-by: Andreas Dilger Tested-by: jenkins Tested-by: Maloo Reviewed-by: James Simmons Reviewed-by: Oleg Drokin --- lustre/include/lu_object.h | 18 +++++++++++++++++- lustre/include/lu_target.h | 1 + lustre/include/obd_target.h | 16 ---------------- lustre/obdclass/lu_tgt_pool.c | 1 + 4 files changed, 19 insertions(+), 17 deletions(-) diff --git a/lustre/include/lu_object.h b/lustre/include/lu_object.h index 1ec8dd6..01a3e0d 100644 --- a/lustre/include/lu_object.h +++ b/lustre/include/lu_object.h @@ -39,7 +39,6 @@ #include #include #include -#include struct seq_file; struct proc_dir_entry; @@ -1519,6 +1518,23 @@ static inline bool lu_object_is_cl(const struct lu_object *o) return lu_device_is_cl(o->lo_dev); } +/* Generic subset of tgts */ +struct lu_tgt_pool { + __u32 *op_array; /* array of index of + * lov_obd->lov_tgts + */ + unsigned int op_count; /* number of tgts in the array */ + unsigned int op_size; /* allocated size of op_array */ + struct rw_semaphore op_rw_sem; /* to protect lu_tgt_pool use */ +}; + +int tgt_pool_init(struct lu_tgt_pool *op, unsigned int count); +int tgt_pool_add(struct lu_tgt_pool *op, __u32 idx, unsigned int min_count); +int tgt_pool_remove(struct lu_tgt_pool *op, __u32 idx); +int tgt_pool_free(struct lu_tgt_pool *op); +int tgt_check_index(int idx, struct lu_tgt_pool *osts); +int tgt_pool_extend(struct lu_tgt_pool *op, unsigned int min_count); + /* bitflags used in rr / qos allocation */ enum lq_flag { LQ_DIRTY = 0, /* recalc qos data */ diff --git a/lustre/include/lu_target.h b/lustre/include/lu_target.h index 5e523af..880bbb1 100644 --- a/lustre/include/lu_target.h +++ b/lustre/include/lu_target.h @@ -37,6 +37,7 @@ #include #include #include +#include /* Each one represents a distribute transaction replay * operation, and updates on each MDTs are linked to diff --git a/lustre/include/obd_target.h b/lustre/include/obd_target.h index 5e52451..60337ca 100644 --- a/lustre/include/obd_target.h +++ b/lustre/include/obd_target.h @@ -70,20 +70,4 @@ struct ost_obd { struct mutex ost_health_mutex; }; -/* Generic subset of tgts */ -struct lu_tgt_pool { - __u32 *op_array; /* array of index of - * lov_obd->lov_tgts */ - unsigned int op_count; /* number of tgts in the array */ - unsigned int op_size; /* allocated size of op_array */ - struct rw_semaphore op_rw_sem; /* to protect lu_tgt_pool use */ -}; - -int tgt_pool_init(struct lu_tgt_pool *op, unsigned int count); -int tgt_pool_add(struct lu_tgt_pool *op, __u32 idx, unsigned int min_count); -int tgt_pool_remove(struct lu_tgt_pool *op, __u32 idx); -int tgt_pool_free(struct lu_tgt_pool *op); -int tgt_check_index(int idx, struct lu_tgt_pool *osts); -int tgt_pool_extend(struct lu_tgt_pool *op, unsigned int min_count); - #endif /* __OBD_TARGET_H */ diff --git a/lustre/obdclass/lu_tgt_pool.c b/lustre/obdclass/lu_tgt_pool.c index 1c79efe..488dfc2 100644 --- a/lustre/obdclass/lu_tgt_pool.c +++ b/lustre/obdclass/lu_tgt_pool.c @@ -43,6 +43,7 @@ #include #include +#include /** * Initialize the pool data structures at startup. -- 1.8.3.1