scst/sysfs: Introduce scst_tgt_find_acg()

Call scst_tgt_find_acg() instead of iterating explicitly over the ACG list.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4377 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
Vladislav Bolkhovitin
2012-06-26 18:59:21 +00:00
parent a5a5e4a1e3
commit 10ffe6d620

View File

@@ -1830,7 +1830,7 @@ static int scst_process_ini_group_mgmt_store(char *buffer,
{
int res, action;
char *p, *pp;
struct scst_acg *a, *acg = NULL;
struct scst_acg *acg;
enum {
SCST_INI_GROUP_ACTION_CREATE = 1,
SCST_INI_GROUP_ACTION_DEL = 2,
@@ -1871,14 +1871,7 @@ static int scst_process_ini_group_mgmt_store(char *buffer,
goto out_unlock;
}
list_for_each_entry(a, &tgt->tgt_acg_list, acg_list_entry) {
if (strcmp(a->acg_name, p) == 0) {
TRACE_DBG("group (acg) %p %s found",
a, a->acg_name);
acg = a;
break;
}
}
acg = scst_tgt_find_acg(tgt, p);
switch (action) {
case SCST_INI_GROUP_ACTION_CREATE: