aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/target/sbp
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/target/sbp')
-rw-r--r--drivers/target/sbp/sbp_target.c36
1 files changed, 4 insertions, 32 deletions
#ifndef _LINUX_SCHED_RCUPDATE_WAIT_H #define _LINUX_SCHED_RCUPDATE_WAIT_H /* * RCU synchronization types and methods: */ #include <linux/rcupdate.h> #include <linux/completion.h> /* * Structure allowing asynchronous waiting on RCU. */ struct rcu_synchronize { struct rcu_head head; struct completion completion; }; void wakeme_after_rcu(struct rcu_head *head); void __wait_rcu_gp(bool checktiny, int n, call_rcu_func_t *crcu_array, struct rcu_synchronize *rs_array); #define _wait_rcu_gp(checktiny, ...) \ do { \ call_rcu_func_t __crcu_array[] = { __VA_ARGS__ }; \ struct rcu_synchronize __rs_array[ARRAY_SIZE(__crcu_array)]; \ __wait_rcu_gp(checktiny, ARRAY_SIZE(__crcu_array), \ __crcu_array, __rs_array); \ } while (0) #define wait_rcu_gp(...) _wait_rcu_gp(false, __VA_ARGS__) /** * synchronize_rcu_mult - Wait concurrently for multiple grace periods * @...: List of call_rcu() functions for the flavors to wait on. * * This macro waits concurrently for multiple flavors of RCU grace periods. * For example, synchronize_rcu_mult(call_rcu, call_rcu_bh) would wait * on concurrent RCU and RCU-bh grace periods. Waiting on a give SRCU * domain requires you to write a wrapper function for that SRCU domain's * call_srcu() function, supplying the corresponding srcu_struct. * * If Tiny RCU, tell _wait_rcu_gp() not to bother waiting for RCU * or RCU-bh, given that anywhere synchronize_rcu_mult() can be called * is automatically a grace period. */ #define synchronize_rcu_mult(...) \ _wait_rcu_gp(IS_ENABLED(CONFIG_TINY_RCU), __VA_ARGS__) #endif /* _LINUX_SCHED_RCUPDATE_WAIT_H */
git/tree/drivers/target/sbp/sbp_target.c?id=c7d6a803926bae9bbf4510a18fc8dd8957cc0e01#n2089'>2089{ 2093 struct se_node_acl *se_nacl, *se_nacl_new; 2094 u64 guid = 0; 2090 u64 guid = 0; 2095 u32 nexus_depth = 1; 2096 2091 2097 if (sbp_parse_wwn(name, &guid) < 0) 2092 if (sbp_parse_wwn(name, &guid) < 0) 2098 return ERR_PTR(-EINVAL); 2093 return -EINVAL; 2099 2094 return 0; 2100 se_nacl_new = sbp_alloc_fabric_acl(se_tpg); 2101 if (!se_nacl_new) 2102 return ERR_PTR(-ENOMEM); 2103 2104 /* 2105 * se_nacl_new may be released by core_tpg_add_initiator_node_acl() 2106 * when converting a NodeACL from demo mode -> explict 2107 */ 2108 se_nacl = core_tpg_add_initiator_node_acl(se_tpg, se_nacl_new, 2109 name, nexus_depth); 2110 if (IS_ERR(se_nacl)) { 2111 sbp_release_fabric_acl(se_tpg, se_nacl_new); 2112 return se_nacl; 2113 } 2114 2115 return se_nacl; 2116} 2117 2118static void sbp_drop_nodeacl(struct se_node_acl *se_acl) 2119{ 2120 core_tpg_del_initiator_node_acl(se_acl->se_tpg, se_acl, 1); 2121 kfree(se_acl); 2122} 2095} 2123 2096 2124static int sbp_post_link_lun( 2097static int sbp_post_link_lun(@@ -2518,8 +2491,7 @@ static const struct target_core_fabric_ops sbp_ops = { 2518 .fabric_pre_unlink = sbp_pre_unlink_lun, 2491 .fabric_pre_unlink = sbp_pre_unlink_lun, 2519 .fabric_make_np = NULL, 2492 .fabric_make_np = NULL, 2520 .fabric_drop_np = NULL, 2493 .fabric_drop_np = NULL, 2521 .fabric_make_nodeacl = sbp_make_nodeacl, 2494 .fabric_init_nodeacl = sbp_init_nodeacl, 2522 .fabric_drop_nodeacl = sbp_drop_nodeacl, 2523 2495 2524 .tfc_wwn_attrs = sbp_wwn_attrs, 2496 .tfc_wwn_attrs = sbp_wwn_attrs, 2525 .tfc_tpg_base_attrs = sbp_tpg_base_attrs, 2497 .tfc_tpg_base_attrs = sbp_tpg_base_attrs,