From patchwork Sat Nov 17 23:53:15 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jens Axboe X-Patchwork-Id: 10687655 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4BA30109C for ; Sat, 17 Nov 2018 23:53:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3B90A28433 for ; Sat, 17 Nov 2018 23:53:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2FB422A126; Sat, 17 Nov 2018 23:53:31 +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 D6F8528433 for ; Sat, 17 Nov 2018 23:53:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727006AbeKRKLy (ORCPT ); Sun, 18 Nov 2018 05:11:54 -0500 Received: from mail-pf1-f193.google.com ([209.85.210.193]:41807 "EHLO mail-pf1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726984AbeKRKLx (ORCPT ); Sun, 18 Nov 2018 05:11:53 -0500 Received: by mail-pf1-f193.google.com with SMTP id e22-v6so13090542pfn.8 for ; Sat, 17 Nov 2018 15:53:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=bqmn0QyhYBPGN1W7Q5Re0uOw0VeGIUIfH7w/ZR44PEY=; b=xL3ehqknbcyjRgQDSRh5s9R2zFK+VtDD6CRUx9+zPuqdClKfyxFXFXus9YkH1sQk7S AjiQdIa7Iw6ePaYJGykTzo93YBTjFw7TK1oicuN8TBuLXqPbx7B7wEcDoGEhtDJ1KVtr 819G/MxJJ4tSw5SxJD05Oydhyxpvq/RVk+AHD5oRHZURcvb/vgSX3Rhtdf+Q3HLYjsjJ yFFvaAngC2C0ASIMdvT3KnzAd+tQva9PWhZU/GnnMG1QPNl/uu83IyXTiO8IqAG38NVR h+YdoEjztp0hN4xIM/6SA9reTDC7QVeCbFHN0kUslSqrCHTevYQU/tORppER5K+aDuMJ QNeA== 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; bh=bqmn0QyhYBPGN1W7Q5Re0uOw0VeGIUIfH7w/ZR44PEY=; b=mLRC6It/+Hn9dOAtqeqN3yDaYdM1EX2RYyYC7eI+zM3Fgt0VpCGjZ1XTlW489gKGx+ 7cPQua/H9mZrJ8zcI3XqGP1ASjOAlCI6XE5NAwq8Bt+W/tBEVotC9BXaYLCdo4Kzl+f6 xOGXLW1nwXGQXIl+zbjxv7Hglw7izKxDwZLTuqRGT3bpAq4meYgw/9MOjo4J/0B82sO2 BB6aeUgK5cpelRPbbKgUfMFWn9Oy36y/HNhkpZJNOnypLwVp7qfltjoueqmrfhO9oPBQ uVHDYEXw3L6SOw9mQcgTFT4k3TegoI2DoKFnfpKkJQrGsXBf1q7j0lqBwAVybjD7OjbU XImg== X-Gm-Message-State: AGRZ1gJpvnp71XnTHt4Aja35ToqcJafUav69MK8KoSTJzlOL2JytqXV6 QBl9ihGQeWkA84nnCDcCbSiIqw== X-Google-Smtp-Source: AJdET5fjKuz5NIq3t4nt+V1FrmJ4zYa8f/9J1J+4/fL78wjUAjHJ3oloqqIW2oAYPoq8Og7yLYvq6A== X-Received: by 2002:a63:50b:: with SMTP id 11mr14719157pgf.411.1542498808769; Sat, 17 Nov 2018 15:53:28 -0800 (PST) Received: from x1.localdomain (66.29.188.166.static.utbb.net. [66.29.188.166]) by smtp.gmail.com with ESMTPSA id m1sm15812345pgn.9.2018.11.17.15.53.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 17 Nov 2018 15:53:27 -0800 (PST) From: Jens Axboe To: linux-block@vger.kernel.org, linux-aio@kvack.org, linux-fsdevel@vger.kernel.org Cc: Jens Axboe Subject: [PATCH 3/5] aio: add iocb->ki_blk_qc field Date: Sat, 17 Nov 2018 16:53:15 -0700 Message-Id: <20181117235317.7366-4-axboe@kernel.dk> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181117235317.7366-1-axboe@kernel.dk> References: <20181117235317.7366-1-axboe@kernel.dk> 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 Add the field and have the blockdev direct_IO() helpers set it. This is in preparation for being able to poll for iocb completion. Signed-off-by: Jens Axboe --- fs/block_dev.c | 2 ++ include/linux/fs.h | 1 + 2 files changed, 3 insertions(+) diff --git a/fs/block_dev.c b/fs/block_dev.c index d233a59ea364..8a2fed18e3fc 100644 --- a/fs/block_dev.c +++ b/fs/block_dev.c @@ -236,6 +236,7 @@ __blkdev_direct_IO_simple(struct kiocb *iocb, struct iov_iter *iter, bio.bi_opf |= REQ_HIPRI; qc = submit_bio(&bio); + WRITE_ONCE(iocb->ki_blk_qc, qc); for (;;) { __set_current_state(TASK_UNINTERRUPTIBLE); @@ -396,6 +397,7 @@ __blkdev_direct_IO(struct kiocb *iocb, struct iov_iter *iter, int nr_pages) bio->bi_opf |= REQ_HIPRI; qc = submit_bio(bio); + WRITE_ONCE(iocb->ki_blk_qc, qc); break; } diff --git a/include/linux/fs.h b/include/linux/fs.h index c95c0807471f..032761d9b218 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -310,6 +310,7 @@ struct kiocb { int ki_flags; u16 ki_hint; u16 ki_ioprio; /* See linux/ioprio.h */ + u32 ki_blk_qc; } __randomize_layout; static inline bool is_sync_kiocb(struct kiocb *kiocb)