Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 28e53bdd authored by Oleg Nesterov's avatar Oleg Nesterov Committed by Linus Torvalds
Browse files

unify flush_work/flush_work_keventd and rename it to cancel_work_sync



flush_work(wq, work) doesn't need the first parameter, we can use cwq->wq
(this was possible from the very beginnig, I missed this).  So we can unify
flush_work_keventd and flush_work.

Also, rename flush_work() to cancel_work_sync() and fix all callers.
Perhaps this is not the best name, but "flush_work" is really bad.

(akpm: this is why the earlier patches bypassed maintainers)

Signed-off-by: default avatarOleg Nesterov <oleg@tv-sign.ru>
Cc: Jeff Garzik <jeff@garzik.org>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Jens Axboe <jens.axboe@oracle.com>
Cc: Tejun Heo <htejun@gmail.com>
Cc: Auke Kok <auke-jan.h.kok@intel.com>,
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 5830c590
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -3633,7 +3633,7 @@ EXPORT_SYMBOL(kblockd_schedule_work);

void kblockd_flush_work(struct work_struct *work)
{
	flush_work(kblockd_workqueue, work);
	cancel_work_sync(work);
}
EXPORT_SYMBOL(kblockd_flush_work);

+4 −4
Original line number Diff line number Diff line
@@ -1316,7 +1316,7 @@ void ata_port_flush_task(struct ata_port *ap)
	spin_unlock_irqrestore(ap->lock, flags);

	DPRINTK("flush #1\n");
	flush_work(ata_wq, &ap->port_task.work); /* akpm: seems unneeded */
	cancel_work_sync(&ap->port_task.work); /* akpm: seems unneeded */

	/*
	 * At this point, if a task is running, it's guaranteed to see
@@ -1327,7 +1327,7 @@ void ata_port_flush_task(struct ata_port *ap)
		if (ata_msg_ctl(ap))
			ata_port_printk(ap, KERN_DEBUG, "%s: flush #2\n",
					__FUNCTION__);
		flush_work(ata_wq, &ap->port_task.work);
		cancel_work_sync(&ap->port_task.work);
	}

	spin_lock_irqsave(ap->lock, flags);
@@ -6475,9 +6475,9 @@ void ata_port_detach(struct ata_port *ap)
	/* Flush hotplug task.  The sequence is similar to
	 * ata_port_flush_task().
	 */
	flush_work(ata_aux_wq, &ap->hotplug_task.work); /* akpm: why? */
	cancel_work_sync(&ap->hotplug_task.work); /* akpm: why? */
	cancel_delayed_work(&ap->hotplug_task);
	flush_work(ata_aux_wq, &ap->hotplug_task.work);
	cancel_work_sync(&ap->hotplug_task.work);

 skip_eh:
	/* remove the associated SCSI host */
+1 −1
Original line number Diff line number Diff line
@@ -1214,7 +1214,7 @@ e1000_remove(struct pci_dev *pdev)
	int i;
#endif

	flush_work_keventd(&adapter->reset_task);
	cancel_work_sync(&adapter->reset_task);

	e1000_release_manageability(adapter);

+2 −2
Original line number Diff line number Diff line
@@ -663,9 +663,9 @@ int phy_stop_interrupts(struct phy_device *phydev)

	/*
	 * Finish any pending work; we might have been scheduled to be called
	 * from keventd ourselves, but flush_work_keventd() handles that.
	 * from keventd ourselves, but cancel_work_sync() handles that.
	 */
	flush_work_keventd(&phydev->phy_queue);
	cancel_work_sync(&phydev->phy_queue);

	free_irq(phydev->irq, phydev);

+1 −1
Original line number Diff line number Diff line
@@ -7386,7 +7386,7 @@ static int tg3_close(struct net_device *dev)
{
	struct tg3 *tp = netdev_priv(dev);

	flush_work_keventd(&tp->reset_task);
	cancel_work_sync(&tp->reset_task);

	netif_stop_queue(dev);

Loading