From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.sourceforge.net (lists.sourceforge.net [216.105.38.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 91CE2F5581D for ; Mon, 20 Apr 2026 11:48:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.sourceforge.net; s=beta; h=Content-Transfer-Encoding:Content-Type:Cc: Reply-To:From:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:Subject:MIME-Version:References:In-Reply-To: Message-ID:Date:To:Sender:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=Iwvx6bDz3qZBAZOmV1HoplGro+hQPjtvKLiKDzXnwSI=; b=mMmIMEY0VpcNpcBBs5MmLgbiiM inOauz58eJmy0Pnj38TZjANBcwOfYfZ4s8ZWRIOqoeSmvSi30EJNJN41DfxbclN/byXc9FVYSjqNx allBpqWamouTBzedYOg7S1DU9CZzPXZsA8pNwVbnMSNdptoaqWfemjyBXTQglxOg4iyY=; Received: from [127.0.0.1] (helo=sfs-ml-2.v29.lw.sourceforge.com) by sfs-ml-2.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1wEn6r-0003rF-GW; Mon, 20 Apr 2026 11:48:14 +0000 Received: from [172.30.29.66] (helo=mx.sourceforge.net) by sfs-ml-2.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1wEn6q-0003qy-5i for linux-f2fs-devel@lists.sourceforge.net; Mon, 20 Apr 2026 11:48:12 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Content-Transfer-Encoding:MIME-Version:References: In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type: 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=Mp6uIn4Oj2gkvYgwa4QbfdVuNCDW0x0fJpFki9SOlx0=; b=KZnfatcH/S1TsbK1FyUyQi5DG5 3cwBGDW9xV9L+7fHQkCCPJ0id3VuWvalFo+TL94ZQED3TLF3/OSFoyIwUqVGr6yhTbIFIYYupawvK sbV/OAIYvTsDozyyfkSIzHq89lZew+d1JQhJ1QLPhEnjQ6irt4Bu9wbSNAqgSQJ0sV4k=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID: Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type: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=Mp6uIn4Oj2gkvYgwa4QbfdVuNCDW0x0fJpFki9SOlx0=; b=ifX+TaJ3mRuh2w1+IZIR1XwwFW ospV4nI7Vuqbg7o354LOHWccYj9C/DLqjkCDrafWdweIUpGGj+9kcfPxzpHeacu3pBJry9KxiIGtg qfRO0NJL03hDFf1DD/B3hMa/YvonvKwmIyG006r5FAtQi1HVswcQEMVnrnRR+dN/cLFU=; Received: from sea.source.kernel.org ([172.234.252.31]) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1wEn6q-0007FF-I8 for linux-f2fs-devel@lists.sourceforge.net; Mon, 20 Apr 2026 11:48:12 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sea.source.kernel.org (Postfix) with ESMTP id 2C0F2407C5; Mon, 20 Apr 2026 11:48:02 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 83B77C19425; Mon, 20 Apr 2026 11:47:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1776685682; bh=5p8RSIL/qqpPyP2Ea+WCebFmPMKr9xGnDDmczm8lq+k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FKejZjbdY4Xt9bsYb1u+5N+ij3J3IwSXPRp1BYh4RUh8I5qkaylO1q2dT4Uy5IWd4 8Qol0fNFAGsFJELryHepTKzg0mabjNnQluCr+VKAN40pAxm1O+XwvCg6EHUmYFTjc6 5WYbGJqneMBE4dw9Dao1LacVX9I5mTqtAZEAzzGJcYT7VqCRqP5tNPRK9z51DJieIU BFbbzkyQgn/+FkpcSH/2MRiCZL0EyRggyeYiZPMaLf5ftmOLQKS6A5wtjRij9wFjt1 43Ck/F1tdZgA53yGVtVxkFQwrjYs578M4VEB9i1oMYzFTDlWIPn/7PYhN6KmuF6sSJ AOw/JdMFbugNg== To: linux-xfs@vger.kernel.org, fsverity@lists.linux.dev, linux-fsdevel@vger.kernel.org, ebiggers@kernel.org Date: Mon, 20 Apr 2026 13:46:56 +0200 Message-ID: <20260420114714.1621982-10-aalbersh@kernel.org> X-Mailer: git-send-email 2.51.2 In-Reply-To: <20260420114714.1621982-1-aalbersh@kernel.org> References: <20260420114714.1621982-1-aalbersh@kernel.org> MIME-Version: 1.0 X-Headers-End: 1wEn6q-0007FF-I8 Subject: [f2fs-dev] [PATCH v8 09/22] iomap: introduce iomap_fsverity_write() for writing fsverity metadata X-BeenThere: linux-f2fs-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Andrey Albershteyn via Linux-f2fs-devel Reply-To: Andrey Albershteyn Cc: Andrey Albershteyn , djwong@kernel.org, linux-unionfs@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, linux-ext4@vger.kernel.org, hch@lst.de, linux-btrfs@vger.kernel.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: linux-f2fs-devel-bounces@lists.sourceforge.net This is just a wrapper around iomap_file_buffered_write() to create necessary iterator over metadata. Reviewed-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Andrey Albershteyn --- fs/iomap/buffered-io.c | 25 +++++++++++++++++++++++++ include/linux/iomap.h | 3 +++ 2 files changed, 28 insertions(+) diff --git a/fs/iomap/buffered-io.c b/fs/iomap/buffered-io.c index 843314852663..5c9fd925a62f 100644 --- a/fs/iomap/buffered-io.c +++ b/fs/iomap/buffered-io.c @@ -1287,6 +1287,31 @@ iomap_file_buffered_write(struct kiocb *iocb, struct iov_iter *i, } EXPORT_SYMBOL_GPL(iomap_file_buffered_write); +int iomap_fsverity_write(struct file *file, loff_t pos, size_t length, + const void *buf, const struct iomap_ops *ops, + const struct iomap_write_ops *write_ops) +{ + int ret; + struct iov_iter iiter; + struct kvec kvec = { + .iov_base = (void *)buf, + .iov_len = length, + }; + struct kiocb iocb = { + .ki_filp = file, + .ki_ioprio = get_current_ioprio(), + .ki_pos = pos, + }; + + iov_iter_kvec(&iiter, WRITE, &kvec, 1, length); + + ret = iomap_file_buffered_write(&iocb, &iiter, ops, write_ops, NULL); + if (ret < 0) + return ret; + return ret == length ? 0 : -EIO; +} +EXPORT_SYMBOL_GPL(iomap_fsverity_write); + static void iomap_write_delalloc_ifs_punch(struct inode *inode, struct folio *folio, loff_t start_byte, loff_t end_byte, struct iomap *iomap, iomap_punch_t punch) diff --git a/include/linux/iomap.h b/include/linux/iomap.h index 4d9202cae29f..83586f09f365 100644 --- a/include/linux/iomap.h +++ b/include/linux/iomap.h @@ -359,6 +359,9 @@ static inline bool iomap_want_unshare_iter(const struct iomap_iter *iter) ssize_t iomap_file_buffered_write(struct kiocb *iocb, struct iov_iter *from, const struct iomap_ops *ops, const struct iomap_write_ops *write_ops, void *private); +int iomap_fsverity_write(struct file *file, loff_t pos, size_t length, + const void *buf, const struct iomap_ops *ops, + const struct iomap_write_ops *write_ops); void iomap_read_folio(const struct iomap_ops *ops, struct iomap_read_folio_ctx *ctx, void *private); void iomap_readahead(const struct iomap_ops *ops, -- 2.51.2 _______________________________________________ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel