Whamcloud - gitweb
LU-6142 lustre: remove some unnecessary code. 39/39739/4
authorMr NeilBrown <neilb@suse.de>
Thu, 27 Aug 2020 03:50:16 +0000 (13:50 +1000)
committerOleg Drokin <green@whamcloud.com>
Wed, 21 Apr 2021 03:14:47 +0000 (03:14 +0000)
The field 'targets_proc_entry' is never set, so remove it and all
reference to it.

lov_dump_pool() is never used, so remove it.

min_u64() is never used - remove it.

max_u64() is used, but 'min3()' from linux/kernel.h makes
the code clearer, so use that instead.

Test-Parameters: trivial
Signed-off-by: Mr NeilBrown <neilb@suse.de>
Change-Id: I3ed6abc1b23e611bd4a573fa78981955a494c344
Reviewed-on: https://review.whamcloud.com/39739
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Arshad Hussain <arshad.hussain@aeoncomputing.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/include/obd.h
lustre/lov/lov_internal.h
lustre/lov/lov_obd.c
lustre/lov/lov_pool.c
lustre/obdclass/interval_tree.c

index 5b95e80..a7a3daf 100644 (file)
@@ -405,7 +405,6 @@ struct lov_obd {
                                                           array */
        struct mutex            lov_lock;
        struct obd_connect_data lov_ocd;
-       struct proc_dir_entry  *targets_proc_entry;
        atomic_t                lov_refcount;
        __u32                   lov_death_row;  /* tgts scheduled to be deleted */
        __u32                   lov_tgt_size;   /* size of tgts array */
index 8a5b0cf..b9cbce7 100644 (file)
@@ -330,7 +330,6 @@ int lov_pool_new(struct obd_device *obd, char *poolname);
 int lov_pool_del(struct obd_device *obd, char *poolname);
 int lov_pool_add(struct obd_device *obd, char *poolname, char *ostname);
 int lov_pool_remove(struct obd_device *obd, char *poolname, char *ostname);
-void lov_dump_pool(int level, struct pool_desc *pool);
 
 static inline struct lov_stripe_md *lsm_addref(struct lov_stripe_md *lsm)
 {
index 49ae17a..79fe4c9 100644 (file)
@@ -283,10 +283,6 @@ static int lov_disconnect_obd(struct obd_device *obd, struct lov_tgt_desc *tgt)
                osc_obd->obd_force = obd->obd_force;
                osc_obd->obd_fail = obd->obd_fail;
                osc_obd->obd_no_recov = obd->obd_no_recov;
-
-               if (lov->targets_proc_entry != NULL)
-                       lprocfs_remove_proc_entry(osc_obd->obd_name,
-                                                 lov->targets_proc_entry);
        }
 
        obd_register_observer(osc_obd, NULL);
index 66e39b0..76eb210 100644 (file)
@@ -231,28 +231,6 @@ const static struct file_operations pool_proc_operations = {
 };
 #endif /* CONFIG_PROC_FS */
 
-void lov_dump_pool(int level, struct pool_desc *pool)
-{
-        int i;
-
-        lov_pool_getref(pool);
-
-        CDEBUG(level, "pool "LOV_POOLNAMEF" has %d members\n",
-               pool->pool_name, pool->pool_obds.op_count);
-       down_read(&pool_tgt_rw_sem(pool));
-
-        for (i = 0; i < pool_tgt_count(pool) ; i++) {
-                if (!pool_tgt(pool, i) || !(pool_tgt(pool, i))->ltd_exp)
-                        continue;
-                CDEBUG(level, "pool "LOV_POOLNAMEF"[%d] = %s\n",
-                       pool->pool_name, i,
-                       obd_uuid2str(&((pool_tgt(pool, i))->ltd_uuid)));
-        }
-
-       up_read(&pool_tgt_rw_sem(pool));
-        lov_pool_putref(pool);
-}
-
 static void pools_hash_exit(void *vpool, void *data)
 {
        struct pool_desc *pool = vpool;
index 1a9d897..bbfa5e0 100644 (file)
@@ -111,16 +111,6 @@ int node_equal(struct interval_node *n1, struct interval_node *n2)
        return extent_equal(&n1->in_extent, &n2->in_extent);
 }
 
-static inline __u64 max_u64(__u64 x, __u64 y)
-{
-       return x > y ? x : y;
-}
-
-static inline __u64 min_u64(__u64 x, __u64 y)
-{
-       return x < y ? x : y;
-}
-
 #define interval_for_each(node, root)                   \
 for (node = interval_first(root); node != NULL;         \
        node = interval_next(node))
@@ -251,8 +241,8 @@ static void __rotate_change_maxhigh(struct interval_node *node,
        rotate->in_max_high = node->in_max_high;
        left_max = node->in_left ? node->in_left->in_max_high : 0;
        right_max = node->in_right ? node->in_right->in_max_high : 0;
-       node->in_max_high  = max_u64(interval_high(node),
-                                    max_u64(left_max, right_max));
+       node->in_max_high  = max3(interval_high(node),
+                                 left_max, right_max);
 }
 
 /* The left rotation "pivots" around the link from node to node->right, and
@@ -520,8 +510,8 @@ static void update_maxhigh(struct interval_node *node,
        while (node) {
                left_max = node->in_left ? node->in_left->in_max_high : 0;
                right_max = node->in_right ? node->in_right->in_max_high : 0;
-               node->in_max_high = max_u64(interval_high(node),
-                                           max_u64(left_max, right_max));
+               node->in_max_high = max3(interval_high(node),
+                                        left_max, right_max);
 
                if (node->in_max_high >= old_maxhigh)
                        break;
@@ -720,7 +710,7 @@ EXPORT_SYMBOL(interval_is_overlapped);
  *        if (root == NULL)
  *                return res;
  *        if (root->in_max_high < low) {
- *                res = max_u64(root->in_max_high + 1, res);
+ *                res = max(root->in_max_high + 1, res);
  *                return res;
  *        } else if (low < interval_low(root)) {
  *                interval_expand_low(root->in_left, low);
@@ -728,7 +718,7 @@ EXPORT_SYMBOL(interval_is_overlapped);
  *        }
  *
  *        if (interval_high(root) < low)
- *                res = max_u64(interval_high(root) + 1, res);
+ *                res = max(interval_high(root) + 1, res);
  *        interval_expand_low(root->in_left, low);
  *        interval_expand_low(root->in_right, low);
  *