From patchwork Sun Sep 2 05:45:21 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Vorontsov X-Patchwork-Id: 11139 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id E8F0223E41 for ; Sun, 2 Sep 2012 05:48:49 +0000 (UTC) Received: from mail-iy0-f180.google.com (mail-iy0-f180.google.com [209.85.210.180]) by fiordland.canonical.com (Postfix) with ESMTP id 14244A18D12 for ; Sun, 2 Sep 2012 05:48:05 +0000 (UTC) Received: by mail-iy0-f180.google.com with SMTP id j25so6289543iaf.11 for ; Sat, 01 Sep 2012 22:48:49 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf:from:to:cc :subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=USAUy6/k3tIRgmMv9ETKvZEPivjGhiSD94SGbMoiwUU=; b=WaAeNgCymhm+cj1dNX8wpsvhFcjKmWVYkaM8qDpvCjiXGXPSLoR56WUCZ4mZwV0jSs 3wCFBIEsYLOFba2Piw9WisTYgtBDXeB5oUmtThSLUfagg04qhNPOK6TJPeOrAeBxxUQU /U5NIkc5rWgYung4FeBjdaLi3nbeiUBX8SnOx6iXBJdI0a6sTeGlxDjeEAloTIJjXSov y66EUxcEgPZqSn8yl7oXmYUDgbJe9TNuV34ccMkXicktcnJj4hEEM+Z+1SE3STtZqgcC 8/KNkFIqDqg1iNZk5nHq3ON+3ke8crz7Cssv6I+FuQaPezOBJb2MBhWGAIg72MNjRdMj wK+Q== Received: by 10.50.7.212 with SMTP id l20mr7361027iga.43.1346564929130; Sat, 01 Sep 2012 22:48:49 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.50.184.232 with SMTP id ex8csp81000igc; Sat, 1 Sep 2012 22:48:48 -0700 (PDT) Received: by 10.68.226.100 with SMTP id rr4mr883784pbc.143.1346564928630; Sat, 01 Sep 2012 22:48:48 -0700 (PDT) Received: from mail-pb0-f50.google.com (mail-pb0-f50.google.com [209.85.160.50]) by mx.google.com with ESMTPS id iv6si3327515pbc.58.2012.09.01.22.48.48 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 01 Sep 2012 22:48:48 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.160.50 is neither permitted nor denied by best guess record for domain of anton.vorontsov@linaro.org) client-ip=209.85.160.50; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.160.50 is neither permitted nor denied by best guess record for domain of anton.vorontsov@linaro.org) smtp.mail=anton.vorontsov@linaro.org Received: by mail-pb0-f50.google.com with SMTP id md12so7233407pbc.37 for ; Sat, 01 Sep 2012 22:48:48 -0700 (PDT) Received: by 10.68.235.38 with SMTP id uj6mr407457pbc.3.1346564928355; Sat, 01 Sep 2012 22:48:48 -0700 (PDT) Received: from localhost (ip-64-134-230-8.public.wayport.net. [64.134.230.8]) by mx.google.com with ESMTPS id ox5sm7078011pbc.75.2012.09.01.22.48.45 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 01 Sep 2012 22:48:48 -0700 (PDT) From: Anton Vorontsov To: Thomas Gleixner Cc: Pekka Enberg , Leonid Moiseichuk , Bartlomiej Zolnierkiewicz , Colin Cross , =?UTF-8?q?Arve=20Hj=C3=B8nnev=C3=A5g?= , Davide Libenzi , Andrew Morton , Ingo Molnar , John Stultz , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, linaro-kernel@lists.linaro.org, patches@linaro.org, kernel-team@android.com Subject: [PATCH 3/4] timerfd: Factor out timer-type unspecific timerfd_expire() Date: Sat, 1 Sep 2012 22:45:21 -0700 Message-Id: <1346564722-14408-3-git-send-email-anton.vorontsov@linaro.org> X-Mailer: git-send-email 1.7.11.5 In-Reply-To: <20120902054335.GA12741@lizard> References: <20120902054335.GA12741@lizard> X-Gm-Message-State: ALoCoQnn/UZG6E0QNT9MJTXCqgfchVwFqzMnfNdgOjPVs7O+mL0pJE54NGWjOg6tDNOO+qEkoYV7 There is nothing hrtimer-specific inside the timerfd_tmrproc(), except the function prototype. We're about to add other timer types, so factor out generic timerfd_expire() helper from timerfd_tmrproc(). Signed-off-by: Anton Vorontsov --- fs/timerfd.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/fs/timerfd.c b/fs/timerfd.c index ecfb3f3..222db32 100644 --- a/fs/timerfd.c +++ b/fs/timerfd.c @@ -45,9 +45,8 @@ static DEFINE_SPINLOCK(cancel_lock); * flag, but we do not re-arm the timer (in case it's necessary, * tintv.tv64 != 0) until the timer is accessed. */ -static enum hrtimer_restart timerfd_tmrproc(struct hrtimer *htmr) +static void timerfd_expire(struct timerfd_ctx *ctx) { - struct timerfd_ctx *ctx = container_of(htmr, struct timerfd_ctx, tmr); unsigned long flags; spin_lock_irqsave(&ctx->wqh.lock, flags); @@ -56,6 +55,11 @@ static enum hrtimer_restart timerfd_tmrproc(struct hrtimer *htmr) wake_up_locked(&ctx->wqh); spin_unlock_irqrestore(&ctx->wqh.lock, flags); +} + +static enum hrtimer_restart timerfd_tmrproc(struct hrtimer *htmr) +{ + timerfd_expire(container_of(htmr, struct timerfd_ctx, tmr)); return HRTIMER_NORESTART; }