[lustre-devel] [PATCH 08/27] lustre: rename tgt_pool_* functions.

James Simmons jsimmons at infradead.org
Sun Jun 13 16:11:18 PDT 2021


Functions starting with tgt_* represents code for target handling
used by Lustre servers. Now that the pool functions are used by
both clients and servers rename it to lu_tgt_* to mirror how
lu_tgt_desc_* is used since both represents remote server targets.

WC-bug-id: https://jira.whamcloud.com/browse/LU-14291
Lustre-commit: 7f3b06a0ab527c3a ("LU-14291 lustre: rename tgt_pool_* functions.")
Signed-off-by: James Simmons <jsimmons at infradead.org>
Reviewed-on: https://review.whamcloud.com/43624
Reviewed-by: Aurelien Degremont <degremoa at amazon.com>
Reviewed-by: Andreas Dilger <adilger at whamcloud.com>
---
 fs/lustre/include/lu_object.h    | 12 ++++++------
 fs/lustre/lov/lov_obd.c          | 12 ++++++------
 fs/lustre/lov/lov_pool.c         | 10 +++++-----
 fs/lustre/obdclass/lu_tgt_pool.c | 28 ++++++++++++++--------------
 4 files changed, 31 insertions(+), 31 deletions(-)

diff --git a/fs/lustre/include/lu_object.h b/fs/lustre/include/lu_object.h
index b1d7577..bbc4533 100644
--- a/fs/lustre/include/lu_object.h
+++ b/fs/lustre/include/lu_object.h
@@ -1413,12 +1413,12 @@ struct lu_tgt_pool {
 	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);
+int lu_tgt_pool_init(struct lu_tgt_pool *op, unsigned int count);
+int lu_tgt_pool_add(struct lu_tgt_pool *op, u32 idx, unsigned int min_count);
+int lu_tgt_pool_remove(struct lu_tgt_pool *op, u32 idx);
+int lu_tgt_pool_free(struct lu_tgt_pool *op);
+int lu_tgt_check_index(int idx, struct lu_tgt_pool *osts);
+int lu_tgt_pool_extend(struct lu_tgt_pool *op, unsigned int min_count);
 
 /* bitflags used in rr / qos allocation */
 enum lq_flag {
diff --git a/fs/lustre/lov/lov_obd.c b/fs/lustre/lov/lov_obd.c
index 42a137d..61159fd 100644
--- a/fs/lustre/lov/lov_obd.c
+++ b/fs/lustre/lov/lov_obd.c
@@ -95,7 +95,7 @@ void lov_tgts_putref(struct obd_device *obd)
 			 * being the maximum tgt index for computing the
 			 * mds_max_easize. So we can't shrink it.
 			 */
-			tgt_pool_remove(&lov->lov_packed, i);
+			lu_tgt_pool_remove(&lov->lov_packed, i);
 			lov->lov_tgts[i] = NULL;
 			lov->lov_death_row--;
 		}
@@ -544,7 +544,7 @@ static int lov_add_target(struct obd_device *obd, struct obd_uuid *uuidp,
 		return -ENOMEM;
 	}
 
-	rc = tgt_pool_add(&lov->lov_packed, index, lov->lov_tgt_size);
+	rc = lu_tgt_pool_add(&lov->lov_packed, index, lov->lov_tgt_size);
 	if (rc) {
 		mutex_unlock(&lov->lov_lock);
 		kfree(tgt);
@@ -763,7 +763,7 @@ int lov_setup(struct obd_device *obd, struct lustre_cfg *lcfg)
 	if (rc)
 		goto out_hash;
 
-	rc = tgt_pool_init(&lov->lov_packed, 0);
+	rc = lu_tgt_pool_init(&lov->lov_packed, 0);
 	if (rc)
 		goto out_pool;
 
@@ -777,7 +777,7 @@ int lov_setup(struct obd_device *obd, struct lustre_cfg *lcfg)
 	return 0;
 
 out_tunables:
-	tgt_pool_free(&lov->lov_packed);
+	lu_tgt_pool_free(&lov->lov_packed);
 out_pool:
 	lov_pool_hash_destroy(&lov->lov_pools_hash_body);
 out_hash:
@@ -804,7 +804,7 @@ static int lov_cleanup(struct obd_device *obd)
 		lov_pool_del(obd, pool->pool_name);
 	}
 	lov_pool_hash_destroy(&lov->lov_pools_hash_body);
-	tgt_pool_free(&lov->lov_packed);
+	lu_tgt_pool_free(&lov->lov_packed);
 
 	lprocfs_obd_cleanup(obd);
 	if (lov->lov_tgts) {
@@ -1254,7 +1254,7 @@ static int lov_quotactl(struct obd_device *obd, struct obd_export *exp,
 			continue;
 
 		if (pool &&
-		    tgt_check_index(tgt->ltd_index, &pool->pool_obds))
+		    lu_tgt_check_index(tgt->ltd_index, &pool->pool_obds))
 			continue;
 
 		if (!tgt->ltd_active || tgt->ltd_reap) {
diff --git a/fs/lustre/lov/lov_pool.c b/fs/lustre/lov/lov_pool.c
index d01c475..25e980f 100644
--- a/fs/lustre/lov/lov_pool.c
+++ b/fs/lustre/lov/lov_pool.c
@@ -82,7 +82,7 @@ void lov_pool_putref(struct pool_desc *pool)
 	CDEBUG(D_INFO, "pool %p\n", pool);
 	if (atomic_dec_and_test(&pool->pool_refcount)) {
 		LASSERT(list_empty(&pool->pool_list));
-		tgt_pool_free(&pool->pool_obds);
+		lu_tgt_pool_free(&pool->pool_obds);
 		kfree_rcu(pool, rcu);
 	}
 }
@@ -268,7 +268,7 @@ int lov_pool_new(struct obd_device *obd, char *poolname)
 	 * up to deletion
 	 */
 	atomic_set(&new_pool->pool_refcount, 1);
-	rc = tgt_pool_init(&new_pool->pool_obds, 0);
+	rc = lu_tgt_pool_init(&new_pool->pool_obds, 0);
 	if (rc)
 		goto out_err;
 
@@ -310,7 +310,7 @@ int lov_pool_new(struct obd_device *obd, char *poolname)
 	lov->lov_pool_count--;
 	spin_unlock(&obd->obd_dev_lock);
 	debugfs_remove_recursive(new_pool->pool_debugfs_entry);
-	tgt_pool_free(&new_pool->pool_obds);
+	lu_tgt_pool_free(&new_pool->pool_obds);
 	kfree(new_pool);
 
 	return rc;
@@ -401,7 +401,7 @@ int lov_pool_add(struct obd_device *obd, char *poolname, char *ostname)
 		goto out;
 	}
 
-	rc = tgt_pool_add(&pool->pool_obds, lov_idx, lov->lov_tgt_size);
+	rc = lu_tgt_pool_add(&pool->pool_obds, lov_idx, lov->lov_tgt_size);
 	if (rc)
 		goto out;
 
@@ -453,7 +453,7 @@ int lov_pool_remove(struct obd_device *obd, char *poolname, char *ostname)
 		goto out;
 	}
 
-	tgt_pool_remove(&pool->pool_obds, lov_idx);
+	lu_tgt_pool_remove(&pool->pool_obds, lov_idx);
 
 	CDEBUG(D_CONFIG, "%s removed from " LOV_POOLNAMEF "\n", ostname,
 	       poolname);
diff --git a/fs/lustre/obdclass/lu_tgt_pool.c b/fs/lustre/obdclass/lu_tgt_pool.c
index a8e1028..8f52fb4 100644
--- a/fs/lustre/obdclass/lu_tgt_pool.c
+++ b/fs/lustre/obdclass/lu_tgt_pool.c
@@ -29,7 +29,7 @@
  * This file is part of Lustre, http://www.lustre.org/
  */
 /*
- * lustre/target/tgt_pool.c
+ * lustre/obdclass/lu_tgt_pool.c
  *
  * This file handles creation, lookup, and removal of pools themselves, as
  * well as adding and removing targets to pools.
@@ -60,7 +60,7 @@
  *		negative error number on failure
  */
 #define POOL_INIT_COUNT 2
-int tgt_pool_init(struct lu_tgt_pool *op, unsigned int count)
+int lu_tgt_pool_init(struct lu_tgt_pool *op, unsigned int count)
 {
 	if (count == 0)
 		count = POOL_INIT_COUNT;
@@ -77,7 +77,7 @@ int tgt_pool_init(struct lu_tgt_pool *op, unsigned int count)
 
 	return 0;
 }
-EXPORT_SYMBOL(tgt_pool_init);
+EXPORT_SYMBOL(lu_tgt_pool_init);
 
 /**
  * Increase the op_array size to hold more targets in this pool.
@@ -92,7 +92,7 @@ int tgt_pool_init(struct lu_tgt_pool *op, unsigned int count)
  * Return:	0 on success
  *		negative error number on failure.
  */
-int tgt_pool_extend(struct lu_tgt_pool *op, unsigned int min_count)
+int lu_tgt_pool_extend(struct lu_tgt_pool *op, unsigned int min_count)
 {
 	u32 *new;
 	u32 new_size;
@@ -116,7 +116,7 @@ int tgt_pool_extend(struct lu_tgt_pool *op, unsigned int min_count)
 
 	return 0;
 }
-EXPORT_SYMBOL(tgt_pool_extend);
+EXPORT_SYMBOL(lu_tgt_pool_extend);
 
 /**
  * Add a new target to an existing pool.
@@ -131,14 +131,14 @@ int tgt_pool_extend(struct lu_tgt_pool *op, unsigned int min_count)
  * Return:	0 if target could be added to the pool
  *		negative error if target \a idx was not added
  */
-int tgt_pool_add(struct lu_tgt_pool *op, u32 idx, unsigned int min_count)
+int lu_tgt_pool_add(struct lu_tgt_pool *op, u32 idx, unsigned int min_count)
 {
 	unsigned int i;
 	int rc = 0;
 
 	down_write(&op->op_rw_sem);
 
-	rc = tgt_pool_extend(op, min_count);
+	rc = lu_tgt_pool_extend(op, min_count);
 	if (rc)
 		goto out;
 
@@ -156,7 +156,7 @@ int tgt_pool_add(struct lu_tgt_pool *op, u32 idx, unsigned int min_count)
 	up_write(&op->op_rw_sem);
 	return rc;
 }
-EXPORT_SYMBOL(tgt_pool_add);
+EXPORT_SYMBOL(lu_tgt_pool_add);
 
 /**
  * Remove an existing pool from the system.
@@ -172,7 +172,7 @@ int tgt_pool_add(struct lu_tgt_pool *op, u32 idx, unsigned int min_count)
  * Return:	0 on success
  *		negative error number on failure
  */
-int tgt_pool_remove(struct lu_tgt_pool *op, u32 idx)
+int lu_tgt_pool_remove(struct lu_tgt_pool *op, u32 idx)
 {
 	unsigned int i;
 
@@ -192,9 +192,9 @@ int tgt_pool_remove(struct lu_tgt_pool *op, u32 idx)
 	up_write(&op->op_rw_sem);
 	return -EINVAL;
 }
-EXPORT_SYMBOL(tgt_pool_remove);
+EXPORT_SYMBOL(lu_tgt_pool_remove);
 
-int tgt_check_index(int idx, struct lu_tgt_pool *osts)
+int lu_tgt_check_index(int idx, struct lu_tgt_pool *osts)
 {
 	int rc = 0, i;
 
@@ -208,7 +208,7 @@ int tgt_check_index(int idx, struct lu_tgt_pool *osts)
 	up_read(&osts->op_rw_sem);
 	return rc;
 }
-EXPORT_SYMBOL(tgt_check_index);
+EXPORT_SYMBOL(lu_tgt_check_index);
 
 /**
  * Free the pool after it was emptied and removed from /proc.
@@ -221,7 +221,7 @@ int tgt_check_index(int idx, struct lu_tgt_pool *osts)
  *
  * Return:	0 on success or if pool was already freed
  */
-int tgt_pool_free(struct lu_tgt_pool *op)
+int lu_tgt_pool_free(struct lu_tgt_pool *op)
 {
 	if (op->op_size == 0)
 		return 0;
@@ -236,4 +236,4 @@ int tgt_pool_free(struct lu_tgt_pool *op)
 	up_write(&op->op_rw_sem);
 	return 0;
 }
-EXPORT_SYMBOL(tgt_pool_free);
+EXPORT_SYMBOL(lu_tgt_pool_free);
-- 
1.8.3.1



More information about the lustre-devel mailing list