From patchwork Wed Jun 6 10:40:33 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 10450063 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 20C6460467 for ; Wed, 6 Jun 2018 10:41:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 11B40298D1 for ; Wed, 6 Jun 2018 10:41:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 06AF3298DA; Wed, 6 Jun 2018 10:41:01 +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 A4F92298D1 for ; Wed, 6 Jun 2018 10:41:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932648AbeFFKk5 (ORCPT ); Wed, 6 Jun 2018 06:40:57 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:40882 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932547AbeFFKky (ORCPT ); Wed, 6 Jun 2018 06:40:54 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=References:In-Reply-To:Message-Id: Date:Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=uZ2v1ha01SsXRaLCRXrEQPfDGys0r8P/Lt/+HXHzjzg=; b=gl6y8aQp+VW0SaQm2WoRfqWnW wXVxvsoE80wHucnD4I3qK8MFs6XmF5R4rD+0wujAWuz8ay3wdzIUIugEmkmFzosmse3/8iDHnrrpA UqK05zr6eAmdNYDH6OzFWO1/MRmz9DvNQS01q5rL7A5lBuVhsklaXPNIbKEQzcwNH0JajfgUdpIJV ds+3f6K7YI4MNEp5jGF/8wX73AGcJVJ05BwGIg9pfZQcmizSxBby/7V0HuffoyncbCYPOxIsuC+5S 6HC6k54pZigw4f56AE2MRhg0w4jM107sZtyDMgKfG3fvu6xaPeFkcDWms7BN1e6iC4DFGE5UBmKAj AQGIsNqSA==; Received: from 80-109-164-210.cable.dynamic.surfer.at ([80.109.164.210] helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1fQVs5-0003uG-9C; Wed, 06 Jun 2018 10:40:53 +0000 From: Christoph Hellwig To: Andreas Gruenbacher , linux-xfs@vger.kernel.org Cc: Dan Williams , linux-fsdevel@vger.kernel.org, cluster-devel@redhat.com, linux-ext4@vger.kernel.org Subject: [PATCH 6/6] iomap: add a page_done callback Date: Wed, 6 Jun 2018 12:40:33 +0200 Message-Id: <20180606104033.4947-7-hch@lst.de> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20180606104033.4947-1-hch@lst.de> References: <20180606104033.4947-1-hch@lst.de> X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html 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 This will be used by gfs2 to attach data to transactions for the journaled data mode. But the concept is generic enough that we might be able to use it for other purposes like encryption/integrity post-processing in the future. Based on a patch from Andreas Gruenbacher. Signed-off-by: Christoph Hellwig --- fs/iomap.c | 3 +++ include/linux/iomap.h | 8 ++++++++ 2 files changed, 11 insertions(+) diff --git a/fs/iomap.c b/fs/iomap.c index f2a491b98b7c..a7ecdd5ddd17 100644 --- a/fs/iomap.c +++ b/fs/iomap.c @@ -201,6 +201,9 @@ iomap_write_end(struct inode *inode, loff_t pos, unsigned len, copied, page, NULL); } + if (iomap->page_done) + iomap->page_done(inode, pos, copied, page, iomap); + if (ret < len) iomap_write_failed(inode, pos, len); return ret; diff --git a/include/linux/iomap.h b/include/linux/iomap.h index 69ef622f650e..474e2255ac6e 100644 --- a/include/linux/iomap.h +++ b/include/linux/iomap.h @@ -58,6 +58,14 @@ struct iomap { struct dax_device *dax_dev; void *inline_data; }; + + /* + * Called when finished processing a page in the mapping returned in + * thus iomap. At least for now this is only supported in the buffered + * write path. + */ + void (*page_done)(struct inode *inode, loff_t pos, unsigned copied, + struct page *page, struct iomap *iomap); }; /*