target: Remove TRANSPORT_LUNFLAGS_READ_WRITE
Subsystems (8)
PATCH 1/3 target: Remove TRANSPORT_LUNFLAGS_READ_WRITE
LUNFLAGS_READ_WRITE is always the inverse of LUNFLAGS_READ_ONLY.
Removing this enum value resulted in some spots where a parameter's value can be just true or false, which we can represent with a bool instead of u32. Change to a bool named "lun_access_ro".
--- drivers/target/target_core_device.c | 46 ++++++++++------------------ drivers/target/target_core_fabric_configfs.c | 18 +++++------ drivers/target/target_core_internal.h | 6 ++-- drivers/target/target_core_tpg.c | 16 +++++----- include/target/target_core_base.h | 1 - 5 files changed, 34 insertions(+), 53 deletions(-)
drivers/target/target_core_device.c +17 -29
@@ -275,20 +275,17 @@ int core_free_device_list_for_node(void core_update_device_list_access (u32 mapped_lun, -u32 lun_access, +bool lun_access_ro,struct se_node_acl *nacl) {struct se_dev_entry *deve;spin_lock_irq (&nacl->device_list_lock); deve = nacl->device_list[mapped_lun]; -if (lun_access &TRANSPORT_LUNFLAGS_READ_WRITE ) { - deve->lun_flags &= ~TRANSPORT_LUNFLAGS_READ_ONLY ; - deve->lun_flags |=TRANSPORT_LUNFLAGS_READ_WRITE ; - }else { - deve->lun_flags &= ~TRANSPORT_LUNFLAGS_READ_WRITE ; +if (lun_access_ro) deve->lun_flags |=TRANSPORT_LUNFLAGS_READ_ONLY ; - } +else + deve->lun_flags &= ~TRANSPORT_LUNFLAGS_READ_ONLY ;spin_unlock_irq (&nacl->device_list_lock); }
@@ -300,7 +297,7 @@ int core_enable_device_list_for_node(struct se_lun *lun, struct se_lun_acl *lun_acl, u32 mapped_lun, - u32 lun_access, + bool lun_access_ro, struct se_node_acl *nacl, struct se_portal_group *tpg) {
@@ -333,13 +330,10 @@ int core_enable_device_list_for_node( } deve->se_lun_acl = lun_acl; -if (lun_access &TRANSPORT_LUNFLAGS_READ_WRITE ) { - deve->lun_flags &= ~TRANSPORT_LUNFLAGS_READ_ONLY ; - deve->lun_flags |=TRANSPORT_LUNFLAGS_READ_WRITE ; - }else { - deve->lun_flags &= ~TRANSPORT_LUNFLAGS_READ_WRITE ; +if (lun_access_ro) deve->lun_flags |=TRANSPORT_LUNFLAGS_READ_ONLY ; - } +else + deve->lun_flags &= ~TRANSPORT_LUNFLAGS_READ_ONLY ;spin_unlock_irq (&nacl->device_list_lock);return 0 ;
@@ -350,13 +344,10 @@ int core_enable_device_list_for_node( deve->mapped_lun = mapped_lun; deve->lun_flags |=TRANSPORT_LUNFLAGS_INITIATOR_ACCESS ; -if (lun_access &TRANSPORT_LUNFLAGS_READ_WRITE ) { - deve->lun_flags &= ~TRANSPORT_LUNFLAGS_READ_ONLY ; - deve->lun_flags |=TRANSPORT_LUNFLAGS_READ_WRITE ; - }else { - deve->lun_flags &= ~TRANSPORT_LUNFLAGS_READ_WRITE ; +if (lun_access_ro) deve->lun_flags |=TRANSPORT_LUNFLAGS_READ_ONLY ; - } +else + deve->lun_flags &= ~TRANSPORT_LUNFLAGS_READ_ONLY ; deve->creation_time =get_jiffies_64 (); deve->attach_count++;
@@ -1231,8 +1222,7 @@ struct se_lun *core_dev_add_lun(if (IS_ERR (lun))return lun; - rc =core_tpg_add_lun (tpg, lun, -TRANSPORT_LUNFLAGS_READ_WRITE , dev); + rc =core_tpg_add_lun (tpg, lun, false, dev);if (rc <0 )return ERR_PTR (rc);
@@ -1374,7 +1364,7 @@ int core_dev_add_initiator_node_lun_acl(struct se_portal_group *tpg, struct se_lun_acl *lacl, u32 unpacked_lun, - u32 lun_access) + bool lun_access_ro) { struct se_lun *lun;struct se_node_acl *nacl;
@@ -1392,14 +1382,13 @@ int core_dev_add_initiator_node_lun_acl(if (!nacl)return -EINVAL ; -if ((lun->lun_access &TRANSPORT_LUNFLAGS_READ_ONLY ) && - (lun_access &TRANSPORT_LUNFLAGS_READ_WRITE )) - lun_access =TRANSPORT_LUNFLAGS_READ_ONLY ; +if (lun->lun_access &TRANSPORT_LUNFLAGS_READ_ONLY ) + lun_access_ro = true; lacl->se_lun = lun;if (core_enable_device_list_for_node (lun, lacl, lacl->mapped_lun, - lun_access, nacl, tpg) <0 ) + lun_access_ro, nacl, tpg) <0 )return -EINVAL ;spin_lock (&lun->lun_acl_lock);
@@ -1410,8 +1399,7 @@ int core_dev_add_initiator_node_lun_acl(pr_debug ("%s_TPG[%hu]_LUN[%u->%u] - Added %s ACL for " " InitiatorNode: %s\n" , tpg->se_tpg_tfo->get_fabric_name (), tpg->se_tpg_tfo->tpg_get_tag (tpg), unpacked_lun, lacl->mapped_lun, - (lun_access &TRANSPORT_LUNFLAGS_READ_WRITE ) ?"RW" :"RO" , - lacl->initiatorname); + lun_access_ro ?"RO" :"RW" , lacl->initiatorname);/* * Check to see if there are any existing persistent reservation APTPL * pre-registrations that need to be enabled for this LUN ACL..
drivers/target/target_core_fabric_configfs.c +7 -11
@@ -69,7 +69,8 @@ static int target_fabric_mappedlun_link( struct se_lun_acl, se_lun_group);struct se_portal_group *se_tpg;struct config_item *nacl_ci, *tpg_ci, *tpg_ci_s, *wwn_ci, *wwn_ci_s; -int ret =0 , lun_access; +int ret =0 ; +bool lun_access_ro;if (lun->lun_link_magic !=SE_LUN_LINK_MAGIC ) { pr_err("Bad lun->lun_link_magic, not a valid lun_ci pointer:"
@@ -114,12 +115,10 @@ static int target_fabric_mappedlun_link(spin_lock_irq (&lacl->se_lun_nacl->device_list_lock); deve = lacl->se_lun_nacl->device_list[lacl->mapped_lun];if (deve->lun_flags &TRANSPORT_LUNFLAGS_INITIATOR_ACCESS ) - lun_access = deve->lun_flags; + lun_access_ro = (deve->lun_flags &TRANSPORT_LUNFLAGS_READ_ONLY );else - lun_access = - (se_tpg->se_tpg_tfo->tpg_check_prod_mode_write_protect ( - se_tpg)) ?TRANSPORT_LUNFLAGS_READ_ONLY : -TRANSPORT_LUNFLAGS_READ_WRITE ; + lun_access_ro = se_tpg->se_tpg_tfo->tpg_check_prod_mode_write_protect ( + se_tpg);spin_unlock_irq (&lacl->se_lun_nacl->device_list_lock);/* * Determine the actual mapped LUN value user wants..
@@ -128,7 +127,7 @@ static int target_fabric_mappedlun_link(* iscsi/$IQN/$TPGT/lun/lun_* as on their SCSI Initiator Ports. */ ret =core_dev_add_initiator_node_lun_acl (se_tpg, lacl, - lun->unpacked_lun, lun_access); + lun->unpacked_lun, lun_access_ro);return (ret <0 ) ? -EINVAL :0 ; }
@@ -198,10 +197,7 @@ static ssize_t target_fabric_mappedlun_store_write_protect(if ((op !=1 ) && (op !=0 ))return -EINVAL ; -core_update_device_list_access (lacl->mapped_lun, (op) ? -TRANSPORT_LUNFLAGS_READ_ONLY : -TRANSPORT_LUNFLAGS_READ_WRITE , - lacl->se_lun_nacl); +core_update_device_list_access (lacl->mapped_lun, op, lacl->se_lun_nacl); pr_debug("%s_ConfigFS: Changed Initiator ACL: %s" " Mapped LUN: %u Write Protect bit to %s\n",
drivers/target/target_core_internal.h +3 -3
@@ -8,9 +8,9 @@ extern struct t10_alua_lu_gp *default_lu_gp;struct se_dev_entry *core_get_se_deve_from_rtpi (struct se_node_acl *,u16 );int core_free_device_list_for_node (struct se_node_acl *,struct se_portal_group *); -void core_update_device_list_access (u32 ,u32 ,struct se_node_acl *); +void core_update_device_list_access (u32 ,bool ,struct se_node_acl *);int core_enable_device_list_for_node (struct se_lun *,struct se_lun_acl *, -u32 ,u32 ,struct se_node_acl *,struct se_portal_group *); +u32 ,bool ,struct se_node_acl *,struct se_portal_group *);int core_disable_device_list_for_node (struct se_lun *,struct se_lun_acl *,u32 ,u32 ,struct se_node_acl *,struct se_portal_group *);void core_clear_lun_from_tpg (struct se_lun *,struct se_portal_group *);
@@ -52,7 +52,7 @@ struct se_lun *core_get_lun_from_tpg(struct se_portal_group *, u32);struct se_lun_acl *core_dev_init_initiator_node_lun_acl (struct se_portal_group *,struct se_node_acl *,u32 ,int *);int core_dev_add_initiator_node_lun_acl (struct se_portal_group *, -struct se_lun_acl *,u32 ,u32 ); +struct se_lun_acl *,u32 ,bool );int core_dev_del_initiator_node_lun_acl (struct se_portal_group *,struct se_lun *,struct se_lun_acl *); void core_dev_free_initiator_node_lun_acl(struct se_portal_group *,
drivers/target/target_core_tpg.c +7 -9
@@ -128,7 +128,7 @@ void core_tpg_add_node_to_devs( struct se_portal_group *tpg) {int i =0 ; -u32 lun_access =0 ; +bool lun_access_ro = true;struct se_lun *lun;struct se_device *dev;
@@ -146,27 +146,26 @@ void core_tpg_add_node_to_devs(* demo_mode_write_protect is ON, or READ_ONLY; */ if (!tpg->se_tpg_tfo->tpg_check_demo_mode_write_protect (tpg)) { - lun_access =TRANSPORT_LUNFLAGS_READ_WRITE ; + lun_access_ro = false; }else {/* * Allow only optical drives to issue R/W in default RO * demo mode. */ if (dev->transport->get_device_type (dev) ==TYPE_DISK ) - lun_access =TRANSPORT_LUNFLAGS_READ_ONLY ; + lun_access_ro = true;else - lun_access =TRANSPORT_LUNFLAGS_READ_WRITE ; + lun_access_ro = false; }pr_debug ("TARGET_CORE[%s]->TPG[%u]_LUN[%u] - Adding %s" " access for LUN in Demo Mode\n" , tpg->se_tpg_tfo->get_fabric_name (), tpg->se_tpg_tfo->tpg_get_tag (tpg), lun->unpacked_lun, - (lun_access ==TRANSPORT_LUNFLAGS_READ_WRITE ) ? -"READ-WRITE" :"READ-ONLY" ); + lun_access_ro ?"RO" :"RW" );core_enable_device_list_for_node (lun,NULL , lun->unpacked_lun, - lun_access, acl, tpg); + lun_access_ro, acl, tpg);/* * Check to see if there are any existing persistent reservation * APTPL pre-registrations that need to be enabled for this dynamic
@@ -652,7 +651,6 @@ static int core_tpg_setup_virtual_lun0(struct se_portal_group *se_tpg)/* Set in core_dev_setup_virtual_lun0() */ struct se_device *dev = g_lun0_dev;struct se_lun *lun = &se_tpg->tpg_virt_lun0; -u32 lun_access =TRANSPORT_LUNFLAGS_READ_ONLY ;int ret; lun->unpacked_lun =0 ;
@@ -664,7 +662,7 @@ static int core_tpg_setup_virtual_lun0(struct se_portal_group *se_tpg)spin_lock_init (&lun->lun_sep_lock);init_completion (&lun->lun_ref_comp); - ret =core_tpg_add_lun (se_tpg, lun, lun_access, dev); + ret =core_tpg_add_lun (se_tpg, lun, true, dev);if (ret <0 )return ret;
include/target/target_core_base.h +0 -1
@@ -178,7 +178,6 @@ enum transport_lunflags_table {TRANSPORT_LUNFLAGS_NO_ACCESS =0x00 ,TRANSPORT_LUNFLAGS_INITIATOR_ACCESS =0x01 , TRANSPORT_LUNFLAGS_READ_ONLY = 0x02, - TRANSPORT_LUNFLAGS_READ_WRITE = 0x04, };/*
Signature · 1 line
1.9.3
PATCH 3/3 target: Change some fabric functions to return bool
The tpg_check_* functions in the fabric_ops struct return 1 or 0, so we can make their return type bool. Change fabrics to match.
--- drivers/infiniband/ulp/srpt/ib_srpt.c | 8 ++++---- drivers/scsi/qla2xxx/tcm_qla2xxx.c | 10 +++++----- drivers/target/iscsi/iscsi_target_configfs.c | 8 ++++---- drivers/target/loopback/tcm_loop.c | 16 ++++++++-------- drivers/target/sbp/sbp_target.c | 8 ++++---- drivers/target/tcm_fc/tfc_conf.c | 4 ++-- drivers/vhost/scsi.c | 8 ++++---- include/target/target_core_fabric.h | 10 +++++----- 8 files changed, 36 insertions(+), 36 deletions(-)
drivers/infiniband/ulp/srpt/ib_srpt.c +4 -4
@@ -3377,14 +3377,14 @@ static struct ib_client srpt_client = { .remove = srpt_remove_one }; -static int srpt_check_true (struct se_portal_group *se_tpg) +static bool srpt_check_true (struct se_portal_group *se_tpg) { -return 1 ; +return true; } -static int srpt_check_false (struct se_portal_group *se_tpg) +static bool srpt_check_false (struct se_portal_group *se_tpg) { -return 0 ; +return false; }static char *srpt_get_fabric_name (void )
drivers/scsi/qla2xxx/tcm_qla2xxx.c +5 -5
@@ -296,7 +296,7 @@ static char *tcm_qla2xxx_parse_pr_out_transport_id(return tid; } -static int tcm_qla2xxx_check_demo_mode (struct se_portal_group *se_tpg) +static bool tcm_qla2xxx_check_demo_mode (struct se_portal_group *se_tpg) {struct tcm_qla2xxx_tpg *tpg =container_of (se_tpg, struct tcm_qla2xxx_tpg, se_tpg);
@@ -304,7 +304,7 @@ static int tcm_qla2xxx_check_demo_mode(struct se_portal_group *se_tpg)return tpg->tpg_attrib.generate_node_acls; } -static int tcm_qla2xxx_check_demo_mode_cache (struct se_portal_group *se_tpg) +static bool tcm_qla2xxx_check_demo_mode_cache (struct se_portal_group *se_tpg) {struct tcm_qla2xxx_tpg *tpg =container_of (se_tpg, struct tcm_qla2xxx_tpg, se_tpg);
@@ -312,7 +312,7 @@ static int tcm_qla2xxx_check_demo_mode_cache(struct se_portal_group *se_tpg)return tpg->tpg_attrib.cache_dynamic_acls; } -static int tcm_qla2xxx_check_demo_write_protect (struct se_portal_group *se_tpg) +static bool tcm_qla2xxx_check_demo_write_protect (struct se_portal_group *se_tpg) {struct tcm_qla2xxx_tpg *tpg =container_of (se_tpg, struct tcm_qla2xxx_tpg, se_tpg);
@@ -320,7 +320,7 @@ static int tcm_qla2xxx_check_demo_write_protect(struct se_portal_group *se_tpg)return tpg->tpg_attrib.demo_mode_write_protect; } -static int tcm_qla2xxx_check_prod_write_protect (struct se_portal_group *se_tpg) +static bool tcm_qla2xxx_check_prod_write_protect (struct se_portal_group *se_tpg) {struct tcm_qla2xxx_tpg *tpg =container_of (se_tpg, struct tcm_qla2xxx_tpg, se_tpg);
@@ -328,7 +328,7 @@ static int tcm_qla2xxx_check_prod_write_protect(struct se_portal_group *se_tpg)return tpg->tpg_attrib.prod_mode_write_protect; } -static int tcm_qla2xxx_check_demo_mode_login_only (struct se_portal_group *se_tpg) +static bool tcm_qla2xxx_check_demo_mode_login_only (struct se_portal_group *se_tpg) {struct tcm_qla2xxx_tpg *tpg =container_of (se_tpg, struct tcm_qla2xxx_tpg, se_tpg);
drivers/target/iscsi/iscsi_target_configfs.c +4 -4
@@ -1847,21 +1847,21 @@ static u32 lio_tpg_get_default_depth(struct se_portal_group *se_tpg)return tpg->tpg_attrib.default_cmdsn_depth; } -static int lio_tpg_check_demo_mode (struct se_portal_group *se_tpg) +static bool lio_tpg_check_demo_mode (struct se_portal_group *se_tpg) {struct iscsi_portal_group *tpg = se_tpg->se_tpg_fabric_ptr;return tpg->tpg_attrib.generate_node_acls; } -static int lio_tpg_check_demo_mode_cache (struct se_portal_group *se_tpg) +static bool lio_tpg_check_demo_mode_cache (struct se_portal_group *se_tpg) {struct iscsi_portal_group *tpg = se_tpg->se_tpg_fabric_ptr;return tpg->tpg_attrib.cache_dynamic_acls; } -static int lio_tpg_check_demo_mode_write_protect ( +static bool lio_tpg_check_demo_mode_write_protect (struct se_portal_group *se_tpg) {struct iscsi_portal_group *tpg = se_tpg->se_tpg_fabric_ptr;
@@ -1869,7 +1869,7 @@ static int lio_tpg_check_demo_mode_write_protect(return tpg->tpg_attrib.demo_mode_write_protect; } -static int lio_tpg_check_prod_mode_write_protect ( +static bool lio_tpg_check_prod_mode_write_protect (struct se_portal_group *se_tpg) {struct iscsi_portal_group *tpg = se_tpg->se_tpg_fabric_ptr;
drivers/target/loopback/tcm_loop.c +8 -8
@@ -750,23 +750,23 @@ static char *tcm_loop_parse_pr_out_transport_id(* Returning (1) here allows for target_core_mod struct se_node_acl to be generated * based upon the incoming fabric dependent SCSI Initiator Port */ -static int tcm_loop_check_demo_mode (struct se_portal_group *se_tpg) +static bool tcm_loop_check_demo_mode (struct se_portal_group *se_tpg) { -return 1 ; +return true; } -static int tcm_loop_check_demo_mode_cache (struct se_portal_group *se_tpg) +static bool tcm_loop_check_demo_mode_cache (struct se_portal_group *se_tpg) { -return 0 ; +return false; }/* * Allow I_T Nexus full READ-WRITE access without explict Initiator Node ACLs for * local virtual Linux/SCSI LLD passthrough into VM hypervisor guest */ -static int tcm_loop_check_demo_mode_write_protect (struct se_portal_group *se_tpg) +static bool tcm_loop_check_demo_mode_write_protect (struct se_portal_group *se_tpg) { -return 0 ; +return false; }/*
@@ -774,9 +774,9 @@ static int tcm_loop_check_demo_mode_write_protect(struct se_portal_group *se_tpg* never be called for TCM_Loop by target_core_fabric_configfs.c code. * It has been added here as a nop for target_fabric_tf_ops_check() */ -static int tcm_loop_check_prod_mode_write_protect (struct se_portal_group *se_tpg) +static bool tcm_loop_check_prod_mode_write_protect (struct se_portal_group *se_tpg) { -return 0 ; +return false; } static struct se_node_acl *tcm_loop_tpg_alloc_fabric_acl(
drivers/target/sbp/sbp_target.c +4 -4
@@ -1679,14 +1679,14 @@ static void sbp_management_agent_unregister(struct sbp_management_agent *agent)kfree (agent); } -static int sbp_check_true (struct se_portal_group *se_tpg) +static bool sbp_check_true (struct se_portal_group *se_tpg) { -return 1 ; +return true; } -static int sbp_check_false (struct se_portal_group *se_tpg) +static bool sbp_check_false (struct se_portal_group *se_tpg) { -return 0 ; +return false; }static char *sbp_get_fabric_name (void )
drivers/target/tcm_fc/tfc_conf.c +2 -2
@@ -491,9 +491,9 @@ static u32 ft_get_default_depth(struct se_portal_group *se_tpg)return 1 ; } -static int ft_check_false (struct se_portal_group *se_tpg) +static bool ft_check_false (struct se_portal_group *se_tpg) { -return 0 ; +return false; }static void ft_set_default_node_attr (struct se_node_acl *se_nacl)
drivers/vhost/scsi.c +4 -4
@@ -278,14 +278,14 @@ static void tcm_vhost_put_inflight(struct vhost_scsi_inflight *inflight)kref_put (&inflight->kref, tcm_vhost_done_inflight); } -static int tcm_vhost_check_true (struct se_portal_group *se_tpg) +static bool tcm_vhost_check_true (struct se_portal_group *se_tpg) { -return 1 ; +return true; } -static int tcm_vhost_check_false (struct se_portal_group *se_tpg) +static bool tcm_vhost_check_false (struct se_portal_group *se_tpg) { -return 0 ; +return false; }static char *tcm_vhost_get_fabric_name (void )
include/target/target_core_fabric.h +5 -5
@@ -17,16 +17,16 @@ struct target_core_fabric_ops { struct t10_pr_registration *, int *);char *(*tpg_parse_pr_out_transport_id)(struct se_portal_group *,const char *,u32 *,char **); -int (*tpg_check_demo_mode)(struct se_portal_group *); -int (*tpg_check_demo_mode_cache)(struct se_portal_group *); -int (*tpg_check_demo_mode_write_protect)(struct se_portal_group *); -int (*tpg_check_prod_mode_write_protect)(struct se_portal_group *); +bool (*tpg_check_demo_mode)(struct se_portal_group *); +bool (*tpg_check_demo_mode_cache)(struct se_portal_group *); +bool (*tpg_check_demo_mode_write_protect)(struct se_portal_group *); +bool (*tpg_check_prod_mode_write_protect)(struct se_portal_group *);/* * Optionally used by fabrics to allow demo-mode login, but not * expose any TPG LUNs, and return 'not connected' in standard * inquiry response */ -int (*tpg_check_demo_mode_login_only)(struct se_portal_group *); +bool (*tpg_check_demo_mode_login_only)(struct se_portal_group *);struct se_node_acl *(*tpg_alloc_fabric_acl)(struct se_portal_group *); void (*tpg_release_fabric_acl)(struct se_portal_group *,
Signature · 1 line
1.9.3
PATCH 2/3 target: Remove TRANSPORT_LUNFLAGS_NO_ACCESS
In reply to Andy GroverOnly used as a param to core_disable_device_list_for_node(), but that function doesn't use it.
Change function signature to remove that param, and change all callsites to not pass LUNFLAGS_NO_ACCESS.
--- drivers/target/target_core_device.c | 8 +++----- drivers/target/target_core_internal.h | 2 +- drivers/target/target_core_tpg.c | 2 +- include/target/target_core_base.h | 1 - 4 files changed, 5 insertions(+), 8 deletions(-)
drivers/target/target_core_device.c +3 -5
@@ -262,7 +262,7 @@ int core_free_device_list_for_node(spin_unlock_irq (&nacl->device_list_lock);core_disable_device_list_for_node (lun,NULL , deve->mapped_lun, -TRANSPORT_LUNFLAGS_NO_ACCESS , nacl, tpg); + nacl, tpg);spin_lock_irq (&nacl->device_list_lock); }spin_unlock_irq (&nacl->device_list_lock);
@@ -368,7 +368,6 @@ int core_disable_device_list_for_node(struct se_lun *lun, struct se_lun_acl *lun_acl, u32 mapped_lun, - u32 lun_access, struct se_node_acl *nacl, struct se_portal_group *tpg) {
@@ -436,8 +435,7 @@ void core_clear_lun_from_tpg(struct se_lun *lun, struct se_portal_group *tpg)spin_unlock_irq (&nacl->device_list_lock);core_disable_device_list_for_node (lun,NULL , - deve->mapped_lun,TRANSPORT_LUNFLAGS_NO_ACCESS , - nacl, tpg); + deve->mapped_lun, nacl, tpg);spin_lock_irq (&nacl->device_list_lock); }
@@ -1430,7 +1428,7 @@ int core_dev_del_initiator_node_lun_acl(spin_unlock (&lun->lun_acl_lock);core_disable_device_list_for_node (lun,NULL , lacl->mapped_lun, -TRANSPORT_LUNFLAGS_NO_ACCESS , nacl, tpg); + nacl, tpg); lacl->se_lun =NULL ;
drivers/target/target_core_internal.h +1 -1
@@ -12,7 +12,7 @@ void core_update_device_list_access(u32, bool, struct se_node_acl *);int core_enable_device_list_for_node (struct se_lun *,struct se_lun_acl *,u32 ,bool ,struct se_node_acl *,struct se_portal_group *);int core_disable_device_list_for_node (struct se_lun *,struct se_lun_acl *, -u32 ,u32 ,struct se_node_acl *,struct se_portal_group *); +u32 ,struct se_node_acl *,struct se_portal_group *);void core_clear_lun_from_tpg (struct se_lun *,struct se_portal_group *);int core_dev_export (struct se_device *,struct se_portal_group *,struct se_lun *);
drivers/target/target_core_tpg.c +1 -1
@@ -76,7 +76,7 @@ static void core_clear_initiator_node_from_tpg( lun = deve->se_lun;spin_unlock_irq (&nacl->device_list_lock);core_disable_device_list_for_node (lun,NULL , deve->mapped_lun, -TRANSPORT_LUNFLAGS_NO_ACCESS , nacl, tpg); + nacl, tpg);spin_lock_irq (&nacl->device_list_lock); }
include/target/target_core_base.h +0 -1
@@ -175,7 +175,6 @@ enum se_cmd_flags_table {/* struct se_dev_entry->lun_flags and struct se_lun->lun_access */ enum transport_lunflags_table { -TRANSPORT_LUNFLAGS_NO_ACCESS =0x00 ,TRANSPORT_LUNFLAGS_INITIATOR_ACCESS =0x01 ,TRANSPORT_LUNFLAGS_READ_ONLY =0x02 , };
Signature · 1 line
1.9.3
Re: [PATCH 3/3] target: Change some fabric functions to return bool
In reply to Andy GroverQuoted 2 lines · Andy Grover
The tpg_check_* functions in the
fabric_opsstruct return 1 or 0, so we can make their return type bool. Change fabrics to match.
All these true/false stub sounds like some of them methods should be optional, and a useful default should be assumed if they aren't present.
Re: [PATCH 3/3] target: Change some fabric functions to return bool
Quoted 6 lines · Christoph Hellwig
Quoted 2 lines · Andy Grover
The tpg_check_* functions in the
fabric_opsstruct return 1 or 0, so we can make their return type bool. Change fabrics to match.All these true/false stub sounds like some of them methods should be optional, and a useful default should be assumed if they aren't present.
This may be true but I couldn't determine a useful default, or a change that would make the code shorter or clearer, so I left it for now.
-- Andy