From patchwork Fri May 11 06:30:11 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Omar Sandoval X-Patchwork-Id: 10393343 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 7057860236 for ; Fri, 11 May 2018 06:30:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 81FF728DDA for ; Fri, 11 May 2018 06:30:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 76D2428DDD; Fri, 11 May 2018 06:30:39 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1D20D28DDA for ; Fri, 11 May 2018 06:30:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752329AbeEKGaa (ORCPT ); Fri, 11 May 2018 02:30:30 -0400 Received: from mail-pl0-f68.google.com ([209.85.160.68]:36815 "EHLO mail-pl0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750805AbeEKGa2 (ORCPT ); Fri, 11 May 2018 02:30:28 -0400 Received: by mail-pl0-f68.google.com with SMTP id v24-v6so2722783plo.3 for ; Thu, 10 May 2018 23:30:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=osandov-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=7RTJmL7R/Ddt21aDowogB9skjgVnyWDahD0QQeL/wJ0=; b=Iy8U50y3Wr874TYV4Xx5SPIAge2r/1m5mqIHp//jvaX/JJ8HzC1GZJkK0mj+F2875d 30uIpY+P4+xvytb0vufkTMdfEP1oUcBRs4Qdgd2j29p6wG26ODhUdd00hI7T0WNE+TIU cU4WBaLD2ERTq81vjqv2+YP1UcSmFXzkRrpYTGfEEvQs2xrfgmn8n5j/ddmZ1cciw/Qg DvhjudybBabsEQ0HLor8h8qWJblcbbLwVyu4rIjAF1XsY91LVp+bZJ0HZ6MkcbxEl5NH aJcvoSQIisULNmdTOSadfUzh+KO3i0DOCf4r2M6evx6rl0ifFtxOo25Zf0WqnKX8dPE3 VCgw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=7RTJmL7R/Ddt21aDowogB9skjgVnyWDahD0QQeL/wJ0=; b=OQfm47GcKbPvhcwAijZnKXqd9FdrmUqilv0MxurAux60QMbaD9csSJzPMVTLgC2V5e UsXgEtlc+duMUS5Gym8TfTMC4lseuaMM6GbfkMKJ2wTO1s9IZLKZJQpBbAg8jVPdPnoK 5asjvQjVaREpzWXqMp47ZCbpbKLiWV9kak7kmOSuLxEAeJvvV66LmgrfbwvxOVsCdcva UjllUB/IjqVsoFIKkMMiw2TIarRWx2I9RfgW36ISTB1FhFooKE/OduoVuUcuBuR/lFC+ eFbAIbC9nkp4QqURo+0vrPG+88Hii3FYEy1STwgsh4ty3Wq0R2RF6Mw9LKVlplqWMoEV 9atA== X-Gm-Message-State: ALKqPwdQ4pKuJIiPmCj6SPf65YPxXshFekEUS/1Sv4Qusyexq4f+0XRO KafGUpACe3D2XHFhabwqF4ZsXQ== X-Google-Smtp-Source: AB8JxZrOlnYs8ZHY6a/pregH1yzyW+DPdNITG6wegll5n8CeVDNCr4gNP9hb/duKg+7LdDvsU5D/jg== X-Received: by 2002:a17:902:7283:: with SMTP id d3-v6mr4366049pll.192.1526020227475; Thu, 10 May 2018 23:30:27 -0700 (PDT) Received: from vader.hsd1.wa.comcast.net ([2601:602:8800:a9a9:e6a7:a0ff:fe0b:c9a8]) by smtp.gmail.com with ESMTPSA id a11-v6sm4481982pgn.64.2018.05.10.23.30.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 10 May 2018 23:30:27 -0700 (PDT) From: Omar Sandoval To: linux-btrfs@vger.kernel.org, linux-fsdevel@vger.kernel.org Cc: kernel-team@fb.com Subject: [PATCH 2/3] fs: add private argument to dio_submit_t Date: Thu, 10 May 2018 23:30:11 -0700 Message-Id: <500e3ef7031d83e75255721ff23504021393279b.1525933432.git.osandov@fb.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: References: In-Reply-To: References: Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Omar Sandoval get_block() already has access to this through bh_result->b_private, and it gets passed to end_io() as private, so do the same for submit_io(). Along with the previous change, this will allow us to get rid Btrfs' current->journal_info abuse in btrfs_direct_IO(). Signed-off-by: Omar Sandoval --- fs/btrfs/inode.c | 2 +- fs/direct-io.c | 3 ++- include/linux/fs.h | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index d8b0a7eacd19..46e3d366df8b 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c @@ -8418,7 +8418,7 @@ static int btrfs_submit_direct_hook(struct btrfs_dio_private *dip) } static void btrfs_submit_direct(struct bio *dio_bio, struct inode *inode, - loff_t file_offset) + loff_t file_offset, void *private) { struct btrfs_dio_private *dip = NULL; struct bio *bio = NULL; diff --git a/fs/direct-io.c b/fs/direct-io.c index 9bb33d9c206c..3f3aa2d95ca1 100644 --- a/fs/direct-io.c +++ b/fs/direct-io.c @@ -475,7 +475,8 @@ static inline void dio_bio_submit(struct dio *dio, struct dio_submit *sdio) dio->bio_disk = bio->bi_disk; if (sdio->submit_io) { - sdio->submit_io(bio, dio->inode, sdio->logical_offset_in_bio); + sdio->submit_io(bio, dio->inode, sdio->logical_offset_in_bio, + dio->private); dio->bio_cookie = BLK_QC_T_NONE; } else dio->bio_cookie = submit_bio(bio); diff --git a/include/linux/fs.h b/include/linux/fs.h index b9ef2fb1224b..9e5e6ea1c144 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -2978,7 +2978,7 @@ extern int nonseekable_open(struct inode * inode, struct file * filp); #ifdef CONFIG_BLOCK typedef void (dio_submit_t)(struct bio *bio, struct inode *inode, - loff_t file_offset); + loff_t file_offset, void *private); enum { /* need locking between buffered and direct access */