From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1031905AbdEXUGb (ORCPT ); Wed, 24 May 2017 16:06:31 -0400 Received: from mail-wm0-f66.google.com ([74.125.82.66]:36503 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934566AbdEXUGa (ORCPT ); Wed, 24 May 2017 16:06:30 -0400 From: Alex Naidis To: Tejun Heo Cc: Alex Naidis , linux-kernel@vger.kernel.org Subject: [PATCH V2] workqueue: Implement delayed_work_busy() Date: Wed, 24 May 2017 22:06:25 +0200 Message-Id: <1495656385-30478-1-git-send-email-alex.naidis@linux.com> X-Mailer: git-send-email 2.7.4 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org work_busy() was available for regular work only, however it is useful for delayed work too. This implements a variant of work_busy() for delayed work. CC: linux-kernel@vger.kernel.org Signed-off-by: Alex Naidis --- include/linux/workqueue.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/include/linux/workqueue.h b/include/linux/workqueue.h index c102ef6..b7ae6ac 100644 --- a/include/linux/workqueue.h +++ b/include/linux/workqueue.h @@ -603,6 +603,15 @@ static inline bool schedule_delayed_work(struct delayed_work *dwork, return queue_delayed_work(system_wq, dwork, delay); } +/** + * delayed_work_busy - See work_busy() + * @work: the delayed work to be tested + */ +static inline unsigned int delayed_work_busy(struct delayed_work *dwork) +{ + return work_busy(&dwork->work); +} + #ifndef CONFIG_SMP static inline long work_on_cpu(int cpu, long (*fn)(void *), void *arg) { -- 2.7.4