scst/ALUA: Support use of the "create" verb next to "add" to create device groups and target groups

git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@3713 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
Bart Van Assche
2011-07-21 15:42:58 +00:00
parent 688b1d50a6
commit 0b5c9f7569
2 changed files with 10 additions and 10 deletions
+6 -6
View File
@@ -1237,32 +1237,32 @@ other_tgt_id=2
cd /sys/kernel/scst_tgt/device_groups
echo del dgroup1 >mgmt
echo del dgroup2 >mgmt
echo add dgroup1 >mgmt
echo create dgroup1 >mgmt
echo add disk01 >dgroup1/devices/mgmt
echo add tgroup1 >dgroup1/target_groups/mgmt
echo create tgroup1 >dgroup1/target_groups/mgmt
echo ${own_tgt_id} >dgroup1/target_groups/tgroup1/group_id
echo add ib_srpt_0 >dgroup1/target_groups/tgroup1/mgmt
echo ${own_tgt_id} >dgroup1/target_groups/tgroup1/ib_srpt_0/rel_tgt_id
if [ ${own_tgt_id} = 1 ]; then
echo 1 >dgroup1/target_groups/tgroup1/preferred
fi
echo add tgroup2 >dgroup1/target_groups/mgmt
echo create tgroup2 >dgroup1/target_groups/mgmt
echo ${other_tgt_id} >dgroup1/target_groups/tgroup2/group_id
echo add ib_srpt_0-other >dgroup1/target_groups/tgroup2/mgmt
echo ${other_tgt_id} >dgroup1/target_groups/tgroup2/ib_srpt_0-other/rel_tgt_id
if [ ${other_tgt_id} = 1 ]; then
echo 1 >dgroup1/target_groups/tgroup1/preferred
fi
echo add dgroup2 >mgmt
echo create dgroup2 >mgmt
echo add disk02 >dgroup2/devices/mgmt
echo add tgroup1 >dgroup2/target_groups/mgmt
echo create tgroup1 >dgroup2/target_groups/mgmt
echo ${own_tgt_id} >dgroup2/target_groups/tgroup1/group_id
echo add ib_srpt_0 >dgroup2/target_groups/tgroup1/mgmt
echo ${own_tgt_id} >dgroup2/target_groups/tgroup1/ib_srpt_0/rel_tgt_id
if [ ${own_tgt_id} = 2 ]; then
echo 1 >dgroup2/target_groups/tgroup1/preferred
fi
echo add tgroup2 >dgroup2/target_groups/mgmt
echo create tgroup2 >dgroup2/target_groups/mgmt
echo ${other_tgt_id} >dgroup2/target_groups/tgroup2/group_id
echo add ib_srpt_0-other >dgroup2/target_groups/tgroup2/mgmt
echo ${other_tgt_id} >dgroup2/target_groups/tgroup2/ib_srpt_0-other/rel_tgt_id
+4 -4
View File
@@ -5370,7 +5370,7 @@ static ssize_t scst_dg_tgs_mgmt_show(struct kobject *kobj,
struct kobj_attribute *attr, char *buf)
{
static const char help[] =
"Usage: echo \"add group_name\" >mgmt\n"
"Usage: echo \"create group_name\" >mgmt\n"
" echo \"del group_name\" >mgmt\n";
return scnprintf(buf, PAGE_SIZE, help);
@@ -5395,7 +5395,7 @@ static int scst_dg_tgs_mgmt_store_work_fn(struct scst_sysfs_work_item *w)
res = -EINVAL;
pp = cmd;
p = scst_get_next_lexem(&pp);
if (strcasecmp(p, "add") == 0) {
if (strcasecmp(p, "create") == 0 || strcasecmp(p, "add") == 0) {
dev_name = scst_get_next_lexem(&pp);
if (!*dev_name)
goto out;
@@ -5508,7 +5508,7 @@ static ssize_t scst_device_groups_mgmt_show(struct kobject *kobj,
char *buf)
{
static const char help[] =
"Usage: echo \"add group_name\" >mgmt\n"
"Usage: echo \"create group_name\" >mgmt\n"
" echo \"del group_name\" >mgmt\n";
return scnprintf(buf, PAGE_SIZE, help);
@@ -5531,7 +5531,7 @@ static ssize_t scst_device_groups_mgmt_store(struct kobject *kobj,
res = -EINVAL;
p = scst_get_next_lexem(&pp);
if (strcasecmp(p, "add") == 0) {
if (strcasecmp(p, "create") == 0 || strcasecmp(p, "add") == 0) {
group_name = scst_get_next_lexem(&pp);
if (!*group_name)
goto out;