mirror of
https://github.com/SCST-project/scst.git
synced 2026-05-18 19:21:26 +00:00
SCST core: Factored out common code into scst_tgt_dev_del_free_UA().
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@3267 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
@@ -6077,6 +6077,16 @@ void scst_process_reset(struct scst_device *dev,
|
||||
return;
|
||||
}
|
||||
|
||||
/* Caller must hold tgt_dev->tgt_dev_lock. */
|
||||
void scst_tgt_dev_del_free_UA(struct scst_tgt_dev *tgt_dev,
|
||||
struct scst_tgt_dev_UA *ua)
|
||||
{
|
||||
list_del(&ua->UA_list_entry);
|
||||
if (list_empty(&tgt_dev->UA_list))
|
||||
clear_bit(SCST_TGT_DEV_UA_PENDING, &tgt_dev->tgt_dev_flags);
|
||||
mempool_free(ua, scst_ua_mempool);
|
||||
}
|
||||
|
||||
/* No locks, no IRQ or IRQ-disabled context allowed */
|
||||
int scst_set_pending_UA(struct scst_cmd *cmd)
|
||||
{
|
||||
@@ -6172,11 +6182,8 @@ again:
|
||||
TRACE_MGMT_DBG("Freeing not "
|
||||
"needed global UA %p",
|
||||
ua);
|
||||
list_del(&ua->UA_list_entry);
|
||||
if (list_empty(&tgt_dev->UA_list))
|
||||
clear_bit(SCST_TGT_DEV_UA_PENDING,
|
||||
&tgt_dev->tgt_dev_flags);
|
||||
mempool_free(ua, scst_ua_mempool);
|
||||
scst_tgt_dev_del_free_UA(tgt_dev,
|
||||
ua);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -499,6 +499,8 @@ void scst_acn_sysfs_del(struct scst_acn *acn);
|
||||
|
||||
void __scst_dev_check_set_UA(struct scst_device *dev, struct scst_cmd *exclude,
|
||||
const uint8_t *sense, int sense_len);
|
||||
void scst_tgt_dev_del_free_UA(struct scst_tgt_dev *tgt_dev,
|
||||
struct scst_tgt_dev_UA *ua);
|
||||
static inline void scst_dev_check_set_UA(struct scst_device *dev,
|
||||
struct scst_cmd *exclude, const uint8_t *sense, int sense_len)
|
||||
{
|
||||
|
||||
@@ -1738,11 +1738,7 @@ out_compl:
|
||||
TRACE_MGMT_DBG("Freeing not needed "
|
||||
"REPORTED LUNS DATA CHANGED UA "
|
||||
"%p", ua);
|
||||
list_del(&ua->UA_list_entry);
|
||||
if (list_empty(&tgt_dev->UA_list))
|
||||
clear_bit(SCST_TGT_DEV_UA_PENDING,
|
||||
&tgt_dev->tgt_dev_flags);
|
||||
mempool_free(ua, scst_ua_mempool);
|
||||
scst_tgt_dev_del_free_UA(tgt_dev, ua);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user