From patchwork Thu Oct 5 00:48:46 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kees Cook X-Patchwork-Id: 821595 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=linux-ext4-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="mOLPLbkX"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3y6vnp0tb1z9t3k for ; Thu, 5 Oct 2017 12:10:06 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751447AbdJEAsv (ORCPT ); Wed, 4 Oct 2017 20:48:51 -0400 Received: from mail-pf0-f179.google.com ([209.85.192.179]:52672 "EHLO mail-pf0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752036AbdJEAst (ORCPT ); Wed, 4 Oct 2017 20:48:49 -0400 Received: by mail-pf0-f179.google.com with SMTP id a1so3895591pfj.9 for ; Wed, 04 Oct 2017 17:48:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:mime-version:content-disposition; bh=NZvZtjmTfNmN4Bpia63Bs2eJvMHnDvZEgvAjuyYMgnw=; b=mOLPLbkXuvcFbKIuIHJZlM84/G9q2/lwOe1FdE3kc2Z1G1AhTDaaeF5uJp2YB/4qqU wLuW12QqbA+ylro4YJivwrZMm4fKVP7Vw5Ym1t7BbFtKmgG4cu8WEA6s+9Tlde3pancG ZjJBi0M8nkIQhk/xVb1LPEoxLJAYPPAMUjC8o= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition; bh=NZvZtjmTfNmN4Bpia63Bs2eJvMHnDvZEgvAjuyYMgnw=; b=OuAlIBcMiFHaH2I/mTH2bf+ZnTNs/r9ElzZnA2NkEvx3d1AksKq5RCjDuV2Y5v8HNW HM7izoKtDNiufdklgIfZvFvu0Ohr/1tENJF+BfR405MlMpsEJ6OECFAbt/ArGUY1vDn+ kehbNEAERZIsQsmRSTL55xpgzXZZMvuV8PDVI0aM/PHlc57BK+fkLv9SD17Dxs21fU+U Bmu6IKNh3qUrkKDrAzwaTVa4mfx9sv6U2Ip7VyulyDYdFEjxS/Ss13rhDEzjPneNjsl3 U2onM0eZr/a2mAIRJX/QK+rZXyqU9q2ueyVfXINGZBJCSRzV12uEwljKl4cgdRIjszdh /oZA== X-Gm-Message-State: AMCzsaUaNNISHgSCU1qgpGZMQ1fTEq8SGZz2NDHxI2dzhNkwTSxz08Zn +hgbQmgvpUA6RGAxcZ+7GFHxWw== X-Google-Smtp-Source: AOwi7QBiyxhYt3vVTwjuz+98uuH493aB8W9Q2OoaY/QCDD4xEEUaU/kE4dhl1YRxP8wWPbkzTX7wxQ== X-Received: by 10.99.95.145 with SMTP id t139mr13138276pgb.344.1507164528662; Wed, 04 Oct 2017 17:48:48 -0700 (PDT) Received: from www.outflux.net (173-164-112-133-Oregon.hfc.comcastbusiness.net. [173.164.112.133]) by smtp.gmail.com with ESMTPSA id i187sm17782839pfc.19.2017.10.04.17.48.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 04 Oct 2017 17:48:47 -0700 (PDT) Date: Wed, 4 Oct 2017 17:48:46 -0700 From: Kees Cook To: linux-kernel@vger.kernel.org Cc: Theodore Ts'o , Jan Kara , linux-ext4@vger.kernel.org, Thomas Gleixner Subject: [PATCH] jbd2: Convert timers to use timer_setup() Message-ID: <20171005004846.GA23025@beast> MIME-Version: 1.0 Content-Disposition: inline Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org In preparation for unconditionally passing the struct timer_list pointer to all timer callbacks, switch to using the new timer_setup() and from_timer() to pass the timer pointer explicitly. Cc: "Theodore Ts'o" Cc: Jan Kara Cc: linux-ext4@vger.kernel.org Cc: Thomas Gleixner Signed-off-by: Kees Cook Reviewed-by: Jan Kara --- This requires commit 686fef928bba ("timer: Prepare to change timer callback argument type") in v4.14-rc3, but should be otherwise stand-alone. --- fs/jbd2/journal.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/fs/jbd2/journal.c b/fs/jbd2/journal.c index 7d5ef3bf3f3e..d2a85c9720e9 100644 --- a/fs/jbd2/journal.c +++ b/fs/jbd2/journal.c @@ -165,11 +165,11 @@ static void jbd2_superblock_csum_set(journal_t *j, journal_superblock_t *sb) * Helper function used to manage commit timeouts */ -static void commit_timeout(unsigned long __data) +static void commit_timeout(struct timer_list *t) { - struct task_struct * p = (struct task_struct *) __data; + journal_t *journal = from_timer(journal, t, j_commit_timer); - wake_up_process(p); + wake_up_process(journal->j_task); } /* @@ -197,8 +197,7 @@ static int kjournald2(void *arg) * Set up an interval timer which can be used to trigger a commit wakeup * after the commit interval expires */ - setup_timer(&journal->j_commit_timer, commit_timeout, - (unsigned long)current); + timer_setup(&journal->j_commit_timer, commit_timeout, 0); set_freezable();