Commit 24eac929 authored by John L. Hammond's avatar John L. Hammond Committed by Greg Kroah-Hartman

staging: lustre: lmv: remove unused placement parameter

Remove the unused lmv.*.placement parameter along with supporting
functions and struct members.
Signed-off-by: default avatarJohn L. Hammond <john.hammond@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-7674
Reviewed-on: http://review.whamcloud.com/18019Reviewed-by: default avatarBen Evans <bevans@cray.com>
Reviewed-by: default avatarFrank Zago <fzago@cray.com>
Reviewed-by: default avatarOleg Drokin <oleg.drokin@intel.com>
Signed-off-by: default avatarJames Simmons <jsimmons@infradead.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 3cd9714d
...@@ -403,18 +403,10 @@ struct lmv_tgt_desc { ...@@ -403,18 +403,10 @@ struct lmv_tgt_desc {
unsigned long ltd_active:1; /* target up for requests */ 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 { struct lmv_obd {
int refcount; int refcount;
struct lu_client_fld lmv_fld; struct lu_client_fld lmv_fld;
spinlock_t lmv_lock; spinlock_t lmv_lock;
enum placement_policy lmv_placement;
struct lmv_desc desc; struct lmv_desc desc;
struct obd_uuid cluuid; struct obd_uuid cluuid;
struct obd_export *exp; struct obd_export *exp;
......
...@@ -1284,7 +1284,6 @@ static int lmv_setup(struct obd_device *obd, struct lustre_cfg *lcfg) ...@@ -1284,7 +1284,6 @@ static int lmv_setup(struct obd_device *obd, struct lustre_cfg *lcfg)
lmv->desc.ld_active_tgt_count = 0; lmv->desc.ld_active_tgt_count = 0;
lmv->max_def_easize = 0; lmv->max_def_easize = 0;
lmv->max_easize = 0; lmv->max_easize = 0;
lmv->lmv_placement = PLACEMENT_CHAR_POLICY;
spin_lock_init(&lmv->lmv_lock); spin_lock_init(&lmv->lmv_lock);
mutex_init(&lmv->lmv_init_mutex); mutex_init(&lmv->lmv_init_mutex);
......
...@@ -50,73 +50,6 @@ static ssize_t numobd_show(struct kobject *kobj, struct attribute *attr, ...@@ -50,73 +50,6 @@ static ssize_t numobd_show(struct kobject *kobj, struct attribute *attr,
} }
LUSTRE_RO_ATTR(numobd); 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, static ssize_t activeobd_show(struct kobject *kobj, struct attribute *attr,
char *buf) char *buf)
{ {
...@@ -226,7 +159,6 @@ const struct file_operations lmv_proc_target_fops = { ...@@ -226,7 +159,6 @@ const struct file_operations lmv_proc_target_fops = {
static struct attribute *lmv_attrs[] = { static struct attribute *lmv_attrs[] = {
&lustre_attr_activeobd.attr, &lustre_attr_activeobd.attr,
&lustre_attr_numobd.attr, &lustre_attr_numobd.attr,
&lustre_attr_placement.attr,
NULL, NULL,
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment