s390: don't use flush_scheduled_work()
flush_scheduled_work() is deprecated and scheduled to be removed. * tape_3590: Create and use tape_3590_wq instead of the system_wq. * tape_block: Directly flush requeue_task on cleanup instead of using flush_scheduled_work(). Signed-off-by: Tejun Heo <tj@kernel.org> Cc: Martin Schwidefsky <schwidefsky@de.ibm.com> Cc: Heiko Carstens <heiko.carstens@de.ibm.com> Cc: linux390@de.ibm.com Cc: linux-s390@vger.kernel.org
This commit is contained in:
@@ -24,6 +24,8 @@
|
|||||||
#include "tape_std.h"
|
#include "tape_std.h"
|
||||||
#include "tape_3590.h"
|
#include "tape_3590.h"
|
||||||
|
|
||||||
|
static struct workqueue_struct *tape_3590_wq;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Pointer to debug area.
|
* Pointer to debug area.
|
||||||
*/
|
*/
|
||||||
@@ -613,7 +615,7 @@ tape_3590_schedule_work(struct tape_device *device, enum tape_op op)
|
|||||||
p->device = tape_get_device(device);
|
p->device = tape_get_device(device);
|
||||||
p->op = op;
|
p->op = op;
|
||||||
|
|
||||||
schedule_work(&p->work);
|
queue_work(tape_3590_wq, &p->work);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1629,7 +1631,7 @@ fail_kmalloc:
|
|||||||
static void
|
static void
|
||||||
tape_3590_cleanup_device(struct tape_device *device)
|
tape_3590_cleanup_device(struct tape_device *device)
|
||||||
{
|
{
|
||||||
flush_scheduled_work();
|
flush_workqueue(tape_3590_wq);
|
||||||
tape_std_unassign(device);
|
tape_std_unassign(device);
|
||||||
|
|
||||||
kfree(device->discdata);
|
kfree(device->discdata);
|
||||||
@@ -1733,11 +1735,17 @@ tape_3590_init(void)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
DBF_EVENT(3, "3590 init\n");
|
DBF_EVENT(3, "3590 init\n");
|
||||||
|
|
||||||
|
tape_3590_wq = alloc_workqueue("tape_3590", 0, 0);
|
||||||
|
if (!tape_3590_wq)
|
||||||
|
return -ENOMEM;
|
||||||
|
|
||||||
/* Register driver for 3590 tapes. */
|
/* Register driver for 3590 tapes. */
|
||||||
rc = ccw_driver_register(&tape_3590_driver);
|
rc = ccw_driver_register(&tape_3590_driver);
|
||||||
if (rc)
|
if (rc) {
|
||||||
|
destroy_workqueue(tape_3590_wq);
|
||||||
DBF_EVENT(3, "3590 init failed\n");
|
DBF_EVENT(3, "3590 init failed\n");
|
||||||
else
|
} else
|
||||||
DBF_EVENT(3, "3590 registered\n");
|
DBF_EVENT(3, "3590 registered\n");
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
@@ -1746,7 +1754,7 @@ static void
|
|||||||
tape_3590_exit(void)
|
tape_3590_exit(void)
|
||||||
{
|
{
|
||||||
ccw_driver_unregister(&tape_3590_driver);
|
ccw_driver_unregister(&tape_3590_driver);
|
||||||
|
destroy_workqueue(tape_3590_wq);
|
||||||
debug_unregister(TAPE_DBF_AREA);
|
debug_unregister(TAPE_DBF_AREA);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -264,7 +264,7 @@ cleanup_queue:
|
|||||||
void
|
void
|
||||||
tapeblock_cleanup_device(struct tape_device *device)
|
tapeblock_cleanup_device(struct tape_device *device)
|
||||||
{
|
{
|
||||||
flush_scheduled_work();
|
flush_work_sync(&device->blk_data.requeue_task);
|
||||||
tape_put_device(device);
|
tape_put_device(device);
|
||||||
|
|
||||||
if (!device->blk_data.disk) {
|
if (!device->blk_data.disk) {
|
||||||
|
Reference in New Issue
Block a user