From patchwork Tue Oct 30 13:18:16 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Carlos Maiolino X-Patchwork-Id: 10660907 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 2EF551734 for ; Tue, 30 Oct 2018 13:19:13 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 284FE2A3CD for ; Tue, 30 Oct 2018 13:19:13 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1CD332A3EB; Tue, 30 Oct 2018 13:19:13 +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,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 AA2962A3CD for ; Tue, 30 Oct 2018 13:19:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728111AbeJ3WMg (ORCPT ); Tue, 30 Oct 2018 18:12:36 -0400 Received: from mx1.redhat.com ([209.132.183.28]:37410 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728071AbeJ3WMg (ORCPT ); Tue, 30 Oct 2018 18:12:36 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C7F8F76201; Tue, 30 Oct 2018 13:19:11 +0000 (UTC) Received: from odin.usersys.redhat.com (unknown [10.40.205.68]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2A59F5DD6B; Tue, 30 Oct 2018 13:19:09 +0000 (UTC) From: Carlos Maiolino To: linux-fsdevel@vger.kernel.org Cc: sandeen@redhat.com, hch@lst.de, david@fromorbit.com, darrick.wong@oracle.com Subject: [PATCH 13/20] iomap: Remove direct usage of fiemap_extent_info Date: Tue, 30 Oct 2018 14:18:16 +0100 Message-Id: <20181030131823.29040-14-cmaiolino@redhat.com> In-Reply-To: <20181030131823.29040-1-cmaiolino@redhat.com> References: <20181030131823.29040-1-cmaiolino@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Tue, 30 Oct 2018 13:19:11 +0000 (UTC) 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 struct fiemap_extent_info will be removed in future patches, remove its direct usage from iomap Signed-off-by: Carlos Maiolino --- fs/iomap.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/fs/iomap.c b/fs/iomap.c index 5afca566c2a9..53e6b4bf10a9 100644 --- a/fs/iomap.c +++ b/fs/iomap.c @@ -1099,11 +1099,11 @@ vm_fault_t iomap_page_mkwrite(struct vm_fault *vmf, const struct iomap_ops *ops) EXPORT_SYMBOL_GPL(iomap_page_mkwrite); struct fiemap_iomap_ctx { - struct fiemap_extent_info *fi; + struct fiemap_ctx *f_ctx; struct iomap prev; }; -static int iomap_to_fiemap(struct fiemap_extent_info *fi, +static int iomap_to_fiemap(struct fiemap_ctx *f_ctx, struct iomap *iomap, u32 flags) { switch (iomap->type) { @@ -1128,7 +1128,9 @@ static int iomap_to_fiemap(struct fiemap_extent_info *fi, if (iomap->flags & IOMAP_F_SHARED) flags |= FIEMAP_EXTENT_SHARED; - return fiemap_fill_next_extent(fi, iomap->offset, + return fiemap_fill_next_extent( + (struct fiemap_extent_info *)f_ctx->fc_data, + iomap->offset, iomap->addr != IOMAP_NULL_ADDR ? iomap->addr : 0, iomap->length, flags); } @@ -1143,7 +1145,7 @@ iomap_fiemap_actor(struct inode *inode, loff_t pos, loff_t length, void *data, if (iomap->type == IOMAP_HOLE) return length; - ret = iomap_to_fiemap(ctx->fi, &ctx->prev, 0); + ret = iomap_to_fiemap(ctx->f_ctx, &ctx->prev, 0); ctx->prev = *iomap; switch (ret) { case 0: /* success */ @@ -1158,12 +1160,11 @@ iomap_fiemap_actor(struct inode *inode, loff_t pos, loff_t length, void *data, int iomap_fiemap(struct inode *inode, struct fiemap_ctx *f_ctx, loff_t start, loff_t len, const struct iomap_ops *ops) { - struct fiemap_extent_info *fi = f_ctx->fc_data; struct fiemap_iomap_ctx ctx; loff_t ret; memset(&ctx, 0, sizeof(ctx)); - ctx.fi = fi; + ctx.f_ctx = f_ctx; ctx.prev.type = IOMAP_HOLE; ret = fiemap_check_flags(f_ctx, FIEMAP_FLAG_SYNC); @@ -1192,7 +1193,7 @@ int iomap_fiemap(struct inode *inode, struct fiemap_ctx *f_ctx, } if (ctx.prev.type != IOMAP_HOLE) { - ret = iomap_to_fiemap(fi, &ctx.prev, FIEMAP_EXTENT_LAST); + ret = iomap_to_fiemap(f_ctx, &ctx.prev, FIEMAP_EXTENT_LAST); if (ret < 0) return ret; }