Some more cleanups

git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6873 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
Vladislav Bolkhovitin
2016-04-21 02:19:25 +00:00
parent f97c54e690
commit afa0927a42
2 changed files with 6 additions and 6 deletions

View File

@@ -1759,6 +1759,7 @@ static int vdisk_open_fd(struct scst_vdisk_dev *virt_dev, bool read_only)
int res;
sBUG_ON(!virt_dev->filename);
sBUG_ON(!virt_dev->fd);
virt_dev->fd = vdev_open_fd(virt_dev, virt_dev->filename, read_only);
if (IS_ERR(virt_dev->fd)) {
@@ -7350,8 +7351,8 @@ static void blockio_on_alua_state_change_finish(struct scst_device *dev,
* no parallel fd activities could be here.
*/
if ((new_state == SCST_TG_STATE_OPTIMIZED) ||
(new_state == SCST_TG_STATE_NONOPTIMIZED)) {
if (((new_state == SCST_TG_STATE_OPTIMIZED) ||
(new_state == SCST_TG_STATE_NONOPTIMIZED)) && (virt_dev->fd == NULL)) {
/* Try non-optimized as well, it might be new redirection device */
int rc;

View File

@@ -954,8 +954,7 @@ out_fail:
* group @tg->dg.
*/
static void __scst_tg_set_state(struct scst_target_group *tg,
enum scst_tg_state state,
bool call_on_alua_state_change)
enum scst_tg_state state)
{
struct scst_dg_dev *dg_dev;
struct scst_device *dev;
@@ -1019,7 +1018,7 @@ int scst_tg_set_state(struct scst_target_group *tg, enum scst_tg_state state)
if (res)
goto out;
__scst_tg_set_state(tg, state, true);
__scst_tg_set_state(tg, state);
mutex_unlock(&scst_dg_mutex);
out:
@@ -1326,7 +1325,7 @@ static void __scst_dg_remove(struct scst_dev_group *dg)
list_del(&dg->entry);
scst_dg_sysfs_del(dg);
list_for_each_entry(tg, &dg->tg_list, entry)
__scst_tg_set_state(tg, SCST_TG_STATE_OPTIMIZED, false);
__scst_tg_set_state(tg, SCST_TG_STATE_OPTIMIZED);
while (!list_empty(&dg->dev_list)) {
dgdev = list_first_entry(&dg->dev_list, struct scst_dg_dev,
entry);