From patchwork Fri Jun 12 22:02:22 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tejun Heo X-Patchwork-Id: 6601131 Return-Path: X-Original-To: patchwork-linux-fsdevel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 1905C9F1C1 for ; Fri, 12 Jun 2015 22:04:07 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 41AB220661 for ; Fri, 12 Jun 2015 22:04:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4C95120646 for ; Fri, 12 Jun 2015 22:04:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755235AbbFLWDC (ORCPT ); Fri, 12 Jun 2015 18:03:02 -0400 Received: from mail-oi0-f44.google.com ([209.85.218.44]:33448 "EHLO mail-oi0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750814AbbFLWC3 (ORCPT ); Fri, 12 Jun 2015 18:02:29 -0400 Received: by oiha141 with SMTP id a141so29225320oih.0; Fri, 12 Jun 2015 15:02:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=GKTNB6N3AkC35pgCR7F54HdLVaqh6vKhQXTjdeIwujk=; b=RIz1gt4cgoQc+cd+CDx3hMc+0QjgchrM7mlgLsKGmE8kmdGkLGX4ptZZW8K61GOqcW 21AGEfpEeqN/vctNgCEqcpSLiUvbQtXsVVX/4eif191LwFAN5VpdE+kPEPt21WIp0T4x PJtpQzaBx+IMSVRmzmBNUm98jycLul8o3gc8S4Imsx3AZDMyAUk3NKYd3W96vOTPJg7H I6zd7Xo1108ogirRoM9Ik1C656hf3+MpKD5PxT5XXzwYs/0FZ9URiaaIJBQxq77fu/fO LPhb7puKCFivHvMoxg4j/usZKyptsGwzAF8qirWp7WrRS/qafqI5ealCO7JM9aa7L7w5 Cllg== X-Received: by 10.60.35.42 with SMTP id e10mr13804906oej.26.1434146548453; Fri, 12 Jun 2015 15:02:28 -0700 (PDT) Received: from mtj.duckdns.org.duckdns.org (mobile-166-173-057-025.mycingular.net. [166.173.57.25]) by mx.google.com with ESMTPSA id f5sm3418068oes.2.2015.06.12.15.02.27 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 12 Jun 2015 15:02:27 -0700 (PDT) From: Tejun Heo To: axboe@kernel.dk Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, lizefan@huawei.com, cgroups@vger.kernel.org, tytso@mit.edu, adilger.kernel@dilger.ca, linux-ext4@vger.kernel.org, Tejun Heo Subject: [PATCH 1/2] ext4: replace ext4_io_submit->io_op with ->io_wbc Date: Fri, 12 Jun 2015 17:02:22 -0500 Message-Id: <1434146543-26358-2-git-send-email-tj@kernel.org> X-Mailer: git-send-email 2.4.2 In-Reply-To: <1434146543-26358-1-git-send-email-tj@kernel.org> References: <1434146543-26358-1-git-send-email-tj@kernel.org> Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID,T_RP_MATCHES_RCVD,UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP ext4_io_submit_init() takes the pointer to writeback_control to test its sync_mode and determine between WRITE and WRITE_SYNC and records the result in ->io_op. This patch makes it record the pointer directly and moves the test to ext4_io_submit(). This doesn't cause any noticeable differences now but having writeback_control available throughout IO submission path will be depended upon by the planned cgroup writeback support. Signed-off-by: Tejun Heo Cc: "Theodore Ts'o" Cc: Andreas Dilger Cc: linux-ext4@vger.kernel.org --- fs/ext4/ext4.h | 2 +- fs/ext4/page-io.c | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h index 009a059..74a4923 100644 --- a/fs/ext4/ext4.h +++ b/fs/ext4/ext4.h @@ -191,7 +191,7 @@ typedef struct ext4_io_end { } ext4_io_end_t; struct ext4_io_submit { - int io_op; + struct writeback_control *io_wbc; struct bio *io_bio; ext4_io_end_t *io_end; sector_t io_next_block; diff --git a/fs/ext4/page-io.c b/fs/ext4/page-io.c index c5d81e8..3f80cb2 100644 --- a/fs/ext4/page-io.c +++ b/fs/ext4/page-io.c @@ -357,8 +357,10 @@ void ext4_io_submit(struct ext4_io_submit *io) struct bio *bio = io->io_bio; if (bio) { + int io_op = io->io_wbc->sync_mode == WB_SYNC_ALL ? + WRITE_SYNC : WRITE; bio_get(io->io_bio); - submit_bio(io->io_op, io->io_bio); + submit_bio(io_op, io->io_bio); bio_put(io->io_bio); } io->io_bio = NULL; @@ -367,7 +369,7 @@ void ext4_io_submit(struct ext4_io_submit *io) void ext4_io_submit_init(struct ext4_io_submit *io, struct writeback_control *wbc) { - io->io_op = (wbc->sync_mode == WB_SYNC_ALL ? WRITE_SYNC : WRITE); + io->io_wbc = wbc; io->io_bio = NULL; io->io_end = NULL; }