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: 10393337 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 1FE75602B1 for ; Fri, 11 May 2018 06:30:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2FE0228DDA for ; Fri, 11 May 2018 06:30:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 249A528DDF; Fri, 11 May 2018 06:30:34 +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.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI, T_DKIM_INVALID 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 1663F28DDA for ; Fri, 11 May 2018 06:30:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752403AbeEKGaa (ORCPT ); Fri, 11 May 2018 02:30:30 -0400 Received: from mail-pl0-f68.google.com ([209.85.160.68]:33030 "EHLO mail-pl0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750852AbeEKGa2 (ORCPT ); Fri, 11 May 2018 02:30:28 -0400 Received: by mail-pl0-f68.google.com with SMTP id n10-v6so2721773plp.0 for ; Thu, 10 May 2018 23:30:28 -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=M/3rNS7fj5hM9BLGeVEd8Ue8+945qhhUR38qicKAAhqMBZG/GaJeuvouGhvEdEj41Q cVKhwnjs4o/Zqb72bAq7jYk6UiZPENxuqH17cFPArNiC7rr+3YfOcNuB+m+yYMlnm1Tn WIwWaqdOINqjKVWMM5OtJEo92Iz7pJhh3qlhP7Ltl5Vxk4xpamzfLPL2FUBpDojQ2IMu SP4bp5jJq0NIVPxbNu6gHFXwnF7GkCRSvkj2cMWBmeZePBIwc7ICWGVYBBkYiUtk40e3 vc7k6EcOGNivHzjKByzZQpFwu18n5wWAGpL3uPWxkX9ckFcFlFC6IM634qu/o1Zgfsa+ kaVA== X-Gm-Message-State: ALKqPwcFXGOu0vM+wT8xIvV3wFRBlohwJ1tToZefQT6LSzralCRV87Ko AVW15jn6w0uScYBFopp6ceeXe2lChjM= 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-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@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 */