staging: lustre: lmv: remove unused placement parameter
authorJohn L. Hammond <john.hammond@intel.com>
Sun, 29 Jan 2017 00:04:51 +0000 (19:04 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 3 Feb 2017 12:01:37 +0000 (13:01 +0100)
Remove the unused lmv.*.placement parameter along with supporting
functions and struct members.

Signed-off-by: John L. Hammond <john.hammond@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-7674
Reviewed-on: http://review.whamcloud.com/18019
Reviewed-by: Ben Evans <bevans@cray.com>
Reviewed-by: Frank Zago <fzago@cray.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/lustre/lustre/include/obd.h
drivers/staging/lustre/lustre/lmv/lmv_obd.c
drivers/staging/lustre/lustre/lmv/lproc_lmv.c

index 6d3bd0513ef3b100a6e840344f456172c0f1bb81..5c217c0336520b89ba752e2b88bd1db4987758d0 100644 (file)
@@ -403,18 +403,10 @@ struct lmv_tgt_desc {
        unsigned long           ltd_active:1; /* target up for requests */
 };
 
-enum placement_policy {
-       PLACEMENT_CHAR_POLICY   = 0,
-       PLACEMENT_NID_POLICY    = 1,
-       PLACEMENT_INVAL_POLICY  = 2,
-       PLACEMENT_MAX_POLICY
-};
-
 struct lmv_obd {
        int                     refcount;
        struct lu_client_fld    lmv_fld;
        spinlock_t              lmv_lock;
-       enum placement_policy   lmv_placement;
        struct lmv_desc         desc;
        struct obd_uuid         cluuid;
        struct obd_export       *exp;
index 915415c41668e033a41bd3c54d54ca8d5b46b160..5926461e769a09b9e7a1eaaed4fe5a548ed379da 100644 (file)
@@ -1284,7 +1284,6 @@ static int lmv_setup(struct obd_device *obd, struct lustre_cfg *lcfg)
        lmv->desc.ld_active_tgt_count = 0;
        lmv->max_def_easize = 0;
        lmv->max_easize = 0;
-       lmv->lmv_placement = PLACEMENT_CHAR_POLICY;
 
        spin_lock_init(&lmv->lmv_lock);
        mutex_init(&lmv->lmv_init_mutex);
index 14fbc9cda087075c281bcfd9b51a9293a7519acd..ff458020b96aa6ddd6e3ed37222dc46b84548134 100644 (file)
@@ -50,73 +50,6 @@ static ssize_t numobd_show(struct kobject *kobj, struct attribute *attr,
 }
 LUSTRE_RO_ATTR(numobd);
 
-static const char *placement_name[] = {
-       [PLACEMENT_CHAR_POLICY] = "CHAR",
-       [PLACEMENT_NID_POLICY]  = "NID",
-       [PLACEMENT_INVAL_POLICY]  = "INVAL"
-};
-
-static enum placement_policy placement_name2policy(char *name, int len)
-{
-       int                  i;
-
-       for (i = 0; i < PLACEMENT_MAX_POLICY; i++) {
-               if (!strncmp(placement_name[i], name, len))
-                       return i;
-       }
-       return PLACEMENT_INVAL_POLICY;
-}
-
-static const char *placement_policy2name(enum placement_policy placement)
-{
-       LASSERT(placement < PLACEMENT_MAX_POLICY);
-       return placement_name[placement];
-}
-
-static ssize_t placement_show(struct kobject *kobj, struct attribute *attr,
-                             char *buf)
-{
-       struct obd_device *dev = container_of(kobj, struct obd_device,
-                                             obd_kobj);
-       struct lmv_obd *lmv;
-
-       lmv = &dev->u.lmv;
-       return sprintf(buf, "%s\n", placement_policy2name(lmv->lmv_placement));
-}
-
-#define MAX_POLICY_STRING_SIZE 64
-
-static ssize_t placement_store(struct kobject *kobj, struct attribute *attr,
-                              const char *buffer,
-                              size_t count)
-{
-       struct obd_device *dev = container_of(kobj, struct obd_device,
-                                             obd_kobj);
-       char dummy[MAX_POLICY_STRING_SIZE + 1];
-       enum placement_policy policy;
-       struct lmv_obd *lmv = &dev->u.lmv;
-
-       memcpy(dummy, buffer, MAX_POLICY_STRING_SIZE);
-
-       if (count > MAX_POLICY_STRING_SIZE)
-               count = MAX_POLICY_STRING_SIZE;
-
-       if (dummy[count - 1] == '\n')
-               count--;
-       dummy[count] = '\0';
-
-       policy = placement_name2policy(dummy, count);
-       if (policy != PLACEMENT_INVAL_POLICY) {
-               spin_lock(&lmv->lmv_lock);
-               lmv->lmv_placement = policy;
-               spin_unlock(&lmv->lmv_lock);
-       } else {
-               return -EINVAL;
-       }
-       return count;
-}
-LUSTRE_RW_ATTR(placement);
-
 static ssize_t activeobd_show(struct kobject *kobj, struct attribute *attr,
                              char *buf)
 {
@@ -226,7 +159,6 @@ const struct file_operations lmv_proc_target_fops = {
 static struct attribute *lmv_attrs[] = {
        &lustre_attr_activeobd.attr,
        &lustre_attr_numobd.attr,
-       &lustre_attr_placement.attr,
        NULL,
 };