diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2016-03-17 16:25:46 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2016-03-17 16:25:46 -0700 |
commit | 364e8dd9d636fea7def862919aac092b19b7c581 (patch) | |
tree | abc0b5859a8cea40ac2d5fbee47dfabc276036c9 /drivers/target/iscsi | |
parent | 48d10bda1f2c69980601a61194015bb0790fb7ab (diff) | |
parent | 1ae1602de028acaa42a0f6ff18d19756f8e825c6 (diff) | |
download | op-kernel-dev-364e8dd9d636fea7def862919aac092b19b7c581.zip op-kernel-dev-364e8dd9d636fea7def862919aac092b19b7c581.tar.gz |
Merge tag 'configfs-for-linus' of git://git.infradead.org/users/hch/configfs
Pull configfs updates from Christoph Hellwig:
- A large patch from me to simplify setting up the list of default
groups by actually implementing it as a list instead of an array.
- a small Y2083 prep patch from Deepa Dinamani. Probably doesn't
matter on it's own, but it seems like he is trying to get rid of all
CURRENT_TIME uses in file systems, which is a worthwhile goal.
* tag 'configfs-for-linus' of git://git.infradead.org/users/hch/configfs:
configfs: switch ->default groups to a linked list
configfs: Replace CURRENT_TIME by current_fs_time()
Diffstat (limited to 'drivers/target/iscsi')
-rw-r--r-- | drivers/target/iscsi/iscsi_target_configfs.c | 75 |
1 files changed, 21 insertions, 54 deletions
diff --git a/drivers/target/iscsi/iscsi_target_configfs.c b/drivers/target/iscsi/iscsi_target_configfs.c index 2f821de..a24443b 100644 --- a/drivers/target/iscsi/iscsi_target_configfs.c +++ b/drivers/target/iscsi/iscsi_target_configfs.c @@ -771,21 +771,11 @@ static int lio_target_init_nodeacl(struct se_node_acl *se_nacl, { struct iscsi_node_acl *acl = container_of(se_nacl, struct iscsi_node_acl, se_node_acl); - struct config_group *stats_cg = &se_nacl->acl_fabric_stat_group; - - stats_cg->default_groups = kmalloc(sizeof(struct config_group *) * 2, - GFP_KERNEL); - if (!stats_cg->default_groups) { - pr_err("Unable to allocate memory for" - " stats_cg->default_groups\n"); - return -ENOMEM; - } - stats_cg->default_groups[0] = &acl->node_stat_grps.iscsi_sess_stats_group; - stats_cg->default_groups[1] = NULL; config_group_init_type_name(&acl->node_stat_grps.iscsi_sess_stats_group, "iscsi_sess_stats", &iscsi_stat_sess_cit); - + configfs_add_default_group(&acl->node_stat_grps.iscsi_sess_stats_group, + &se_nacl->acl_fabric_stat_group); return 0; } @@ -793,17 +783,8 @@ static void lio_target_cleanup_nodeacl( struct se_node_acl *se_nacl) { struct iscsi_node_acl *acl = container_of(se_nacl, struct iscsi_node_acl, se_node_acl); - struct config_item *df_item; - struct config_group *stats_cg; - int i; - - stats_cg = &acl->se_node_acl.acl_fabric_stat_group; - for (i = 0; stats_cg->default_groups[i]; i++) { - df_item = &stats_cg->default_groups[i]->cg_item; - stats_cg->default_groups[i] = NULL; - config_item_put(df_item); - } - kfree(stats_cg->default_groups); + + configfs_remove_default_groups(&acl->se_node_acl.acl_fabric_stat_group); } /* End items for lio_target_acl_cit */ @@ -1260,42 +1241,37 @@ static struct se_wwn *lio_target_call_coreaddtiqn( struct config_group *group, const char *name) { - struct config_group *stats_cg; struct iscsi_tiqn *tiqn; tiqn = iscsit_add_tiqn((unsigned char *)name); if (IS_ERR(tiqn)) return ERR_CAST(tiqn); - /* - * Setup struct iscsi_wwn_stat_grps for se_wwn->fabric_stat_group. - */ - stats_cg = &tiqn->tiqn_wwn.fabric_stat_group; - - stats_cg->default_groups = kmalloc(sizeof(struct config_group *) * 6, - GFP_KERNEL); - if (!stats_cg->default_groups) { - pr_err("Unable to allocate memory for" - " stats_cg->default_groups\n"); - iscsit_del_tiqn(tiqn); - return ERR_PTR(-ENOMEM); - } - stats_cg->default_groups[0] = &tiqn->tiqn_stat_grps.iscsi_instance_group; - stats_cg->default_groups[1] = &tiqn->tiqn_stat_grps.iscsi_sess_err_group; - stats_cg->default_groups[2] = &tiqn->tiqn_stat_grps.iscsi_tgt_attr_group; - stats_cg->default_groups[3] = &tiqn->tiqn_stat_grps.iscsi_login_stats_group; - stats_cg->default_groups[4] = &tiqn->tiqn_stat_grps.iscsi_logout_stats_group; - stats_cg->default_groups[5] = NULL; config_group_init_type_name(&tiqn->tiqn_stat_grps.iscsi_instance_group, "iscsi_instance", &iscsi_stat_instance_cit); + configfs_add_default_group(&tiqn->tiqn_stat_grps.iscsi_instance_group, + &tiqn->tiqn_wwn.fabric_stat_group); + config_group_init_type_name(&tiqn->tiqn_stat_grps.iscsi_sess_err_group, "iscsi_sess_err", &iscsi_stat_sess_err_cit); + configfs_add_default_group(&tiqn->tiqn_stat_grps.iscsi_sess_err_group, + &tiqn->tiqn_wwn.fabric_stat_group); + config_group_init_type_name(&tiqn->tiqn_stat_grps.iscsi_tgt_attr_group, "iscsi_tgt_attr", &iscsi_stat_tgt_attr_cit); + configfs_add_default_group(&tiqn->tiqn_stat_grps.iscsi_tgt_attr_group, + &tiqn->tiqn_wwn.fabric_stat_group); + config_group_init_type_name(&tiqn->tiqn_stat_grps.iscsi_login_stats_group, "iscsi_login_stats", &iscsi_stat_login_cit); + configfs_add_default_group(&tiqn->tiqn_stat_grps.iscsi_login_stats_group, + &tiqn->tiqn_wwn.fabric_stat_group); + config_group_init_type_name(&tiqn->tiqn_stat_grps.iscsi_logout_stats_group, "iscsi_logout_stats", &iscsi_stat_logout_cit); + configfs_add_default_group(&tiqn->tiqn_stat_grps.iscsi_logout_stats_group, + &tiqn->tiqn_wwn.fabric_stat_group); + pr_debug("LIO_Target_ConfigFS: REGISTER -> %s\n", tiqn->tiqn); pr_debug("LIO_Target_ConfigFS: REGISTER -> Allocated Node:" @@ -1307,17 +1283,8 @@ static void lio_target_call_coredeltiqn( struct se_wwn *wwn) { struct iscsi_tiqn *tiqn = container_of(wwn, struct iscsi_tiqn, tiqn_wwn); - struct config_item *df_item; - struct config_group *stats_cg; - int i; - - stats_cg = &tiqn->tiqn_wwn.fabric_stat_group; - for (i = 0; stats_cg->default_groups[i]; i++) { - df_item = &stats_cg->default_groups[i]->cg_item; - stats_cg->default_groups[i] = NULL; - config_item_put(df_item); - } - kfree(stats_cg->default_groups); + + configfs_remove_default_groups(&tiqn->tiqn_wwn.fabric_stat_group); pr_debug("LIO_Target_ConfigFS: DEREGISTER -> %s\n", tiqn->tiqn); |