mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-02 12:10:23 -04:00
staging: lustre: lmv: remove unused placement parameter
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>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
3cd9714d45
commit
24eac929de
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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,
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user