Whamcloud - gitweb
LU-8837 lustre: move lu_tgt_pool out of obd_target.h 51/41951/7
authorMr NeilBrown <neilb@suse.de>
Sun, 18 Apr 2021 00:32:13 +0000 (20:32 -0400)
committerOleg Drokin <green@whamcloud.com>
Wed, 28 Apr 2021 02:10:56 +0000 (02:10 +0000)
'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 <neilb@suse.de>
Change-Id: Ia578d766fb7fae6ae2fbcfa651fe5b5264b1ff14
Reviewed-on: https://review.whamcloud.com/41951
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/include/lu_object.h
lustre/include/lu_target.h
lustre/include/obd_target.h
lustre/obdclass/lu_tgt_pool.c

index 1ec8dd6..01a3e0d 100644 (file)
@@ -39,7 +39,6 @@
 #include <linux/percpu_counter.h>
 #include <linux/rhashtable.h>
 #include <linux/ctype.h>
-#include <obd_target.h>
 
 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 */
index 5e523af..880bbb1 100644 (file)
@@ -37,6 +37,7 @@
 #include <lustre_update.h>
 #include <lustre_disk.h>
 #include <lustre_lfsck.h>
+#include <lu_object.h>
 
 /* Each one represents a distribute transaction replay
  * operation, and updates on each MDTs are linked to
index 5e52451..60337ca 100644 (file)
@@ -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 */
index 1c79efe..488dfc2 100644 (file)
@@ -43,6 +43,7 @@
 
 #include <obd_target.h>
 #include <obd_support.h>
+#include <lu_object.h>
 
 /**
  * Initialize the pool data structures at startup.