Received: by 2002:a17:90a:37e8:0:0:0:0 with SMTP id v95csp4243074pjb; Mon, 21 Oct 2019 02:21:12 -0700 (PDT) X-Google-Smtp-Source: APXvYqydnxHWBJ8U+ntOkQjecJhMicKaWEKEseKH4IjG8l3eTMvtJqCqkSjCJ222bo4fBVDEW4NW X-Received: by 2002:a17:906:1651:: with SMTP id n17mr20744971ejd.220.1571649671949; Mon, 21 Oct 2019 02:21:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571649671; cv=none; d=google.com; s=arc-20160816; b=YTd2BKn8P/abImuzJ6SYC1Avcq3Yxtx4qKoECzQbfAAYq2l2SvID7YruF+81YmEcQ5 HOLxq7d7vaxgZtSXySAFrN9CfoeDmpVAn5NSH/y83ynwWHvsOkG81UvY86kT0yZsI1D9 A4kGQ4XlDFl7VndEwibQd7y38Xj+ESPQMbLgPJXRScsIyT4eKiI6OlBOTcq/RntzUuZe 1gbKPcfJFTQbSgp6MdIMdT2/s4QZnbnouXyGbZYG9iGL26luvIuF8xk2C+NB6ukyCgBJ ecdOuaF8kEOmtyQqrWuKZGrcqshZ/pTUEbET3uaI0V2wKCmI1MNQrzLGegMofm/GMd0C o45g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=1pJVjMi2M0WiIX7tanRv1QumHpvd2YITa3EWIKSYzT4=; b=cr5DaraioKsA+Xed7GpOcO1F++E0tjEjms1KWruY9Pt+idml3+GF+lU2xUWIlHK2Q3 qrCzUKTHIHNS3HRFZtilaqfeBlrRQ0IFQozzTsCUh5BfLosZNMrvgZB7VDZxlM8Qimpf CgFli5CJa/qNLL4n1bhO0h8vCXR1zIr1gJZub819Y5zxvPZu2pmbaz7QPvdgkIePLkP2 1EeUKq/gf3ofdNxjeon9DoPK0LxmDkXiH5rgiY2SxS65c0MHlY1uusN7LEoXlLPKh/g5 VBC4SxAgUZSvcwODCXimXtA3ZKOKw5SqcN2wxGH004DbtFgGc+2BiycQ6beO+/QWxxUE R0lw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mbobrowski-org.20150623.gappssmtp.com header.s=20150623 header.b=v2WZxYre; spf=pass (google.com: best guess record for domain of linux-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id jx20si8173013ejb.291.2019.10.21.02.20.47; Mon, 21 Oct 2019 02:21:11 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@mbobrowski-org.20150623.gappssmtp.com header.s=20150623 header.b=v2WZxYre; spf=pass (google.com: best guess record for domain of linux-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727686AbfJUJSf (ORCPT + 99 others); Mon, 21 Oct 2019 05:18:35 -0400 Received: from mail-pl1-f196.google.com ([209.85.214.196]:42360 "EHLO mail-pl1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727154AbfJUJSf (ORCPT ); Mon, 21 Oct 2019 05:18:35 -0400 Received: by mail-pl1-f196.google.com with SMTP id c16so2576933plz.9 for ; Mon, 21 Oct 2019 02:18:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mbobrowski-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=1pJVjMi2M0WiIX7tanRv1QumHpvd2YITa3EWIKSYzT4=; b=v2WZxYreX0Hy0Ie1QtRqpucc5YVFJXH6zRRlAMqUPIChqGPHKYOyIon9Hsh1EKaM1e pZwoJ+4CO6Femwn2FgSV7h4Y/Z3Wwt/BhP2O/rqYj2ICMXWlPo3dkEhfT6JHttkOltEZ nIjs4CCrd7mQGUn+noJoOewRn7ktHuh+KEoVbaqZ91twWgUFH9MynyLeCFwSyY9bF7dD tBTuVSUZN36ZFZ/Z5Zxn7XpsWYtqkGw9/EXxZreLB73ETF2aJz5uZi3aXpMGHJIM7vgr RojZLsH3D+aaS7T5rt+CZc64QiMRKGDk4LoE8Z5/ZoFDvFYF/1tZvgIXavzsFuxnLPwl la9A== 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:references :mime-version:content-disposition:in-reply-to:user-agent; bh=1pJVjMi2M0WiIX7tanRv1QumHpvd2YITa3EWIKSYzT4=; b=p8QvaNHd6dpF0TQV666sH38iLc++uUGFsNwZIIwXN9P+YGaBfU74HGygLvUHAedPYh 35658UCbXw8h7KktJcfiLZGpjaI+025Hc6yeuM6SyEDWuuHc4QTBnAsb9oxGBpBkbDT/ X89T4zcTLaNlkHrJYmdSZ7OUA9R+xyDTHgP/c2pCXGFMXrA2CL6IlPEuJPENDCMFINkg k/tLbwpI0SQlKsylSxB2omCFS+ZgeOYgPW7bD9wzHCrSJwgRyO6EhYr/RGWT2aTZDsIA Pduzovn7eHKQ+W5/aXiFETmdT9jjIZXBk3hpRiOqDr43yZM8faA+PVT2N96Z4vgV46tV J84g== X-Gm-Message-State: APjAAAXD6VqVZZhGBbjLEu+eNFNNykcpEU7KXgenINDRICt22WX9XdWO 0ii9SJUQ4XUCm3Zg6vTbWEza X-Received: by 2002:a17:902:8bc7:: with SMTP id r7mr24160232plo.333.1571649513991; Mon, 21 Oct 2019 02:18:33 -0700 (PDT) Received: from athena.bobrowski.net (n1-41-199-60.bla2.nsw.optusnet.com.au. [1.41.199.60]) by smtp.gmail.com with ESMTPSA id w6sm17042420pfj.17.2019.10.21.02.18.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Oct 2019 02:18:33 -0700 (PDT) Date: Mon, 21 Oct 2019 20:18:27 +1100 From: mbobrowski@mbobrowski.org To: tytso@mit.edu, jack@suse.cz, adilger.kernel@dilger.ca Cc: linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org, hch@infradead.org, david@fromorbit.com, darrick.wong@oracle.com Subject: [PATCH v5 06/12] xfs: Use iomap_dio_rw_wait() Message-ID: <78aac4cedf43825b3535a0d35dbba179ecbdffeb.1571647179.git.mbobrowski@mbobrowski.org> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org Use iomap_dio_rw() to wait for unaligned direct IO instead of opencoding the wait. Signed-off-by: Jan Kara --- This patch has already been posted through by Jan, but I've just included it within this patch series to mark that it's a clear dependency. fs/xfs/xfs_file.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/fs/xfs/xfs_file.c b/fs/xfs/xfs_file.c index 0739ba72a82e..c0620135a279 100644 --- a/fs/xfs/xfs_file.c +++ b/fs/xfs/xfs_file.c @@ -547,16 +547,12 @@ xfs_file_dio_aio_write( } trace_xfs_file_direct_write(ip, count, iocb->ki_pos); - ret = iomap_dio_rw(iocb, from, &xfs_iomap_ops, &xfs_dio_write_ops, - is_sync_kiocb(iocb)); - /* - * If unaligned, this is the only IO in-flight. If it has not yet - * completed, wait on it before we release the iolock to prevent - * subsequent overlapping IO. + * If unaligned, this is the only IO in-flight. Wait on it before we + * release the iolock to prevent subsequent overlapping IO. */ - if (ret == -EIOCBQUEUED && unaligned_io) - inode_dio_wait(inode); + ret = iomap_dio_rw(iocb, from, &xfs_iomap_ops, &xfs_dio_write_ops, + is_sync_kiocb(iocb) || unaligned_io); out: xfs_iunlock(ip, iolock); -- 2.20.1 ----