From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from verein.lst.de ([213.95.11.211]:43791 "EHLO newverein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725851AbeKTTVg (ORCPT ); Tue, 20 Nov 2018 14:21:36 -0500 Date: Tue, 20 Nov 2018 09:53:34 +0100 From: Christoph Hellwig To: Carlos Maiolino Cc: Christoph Hellwig , linux-fsdevel@vger.kernel.org, sandeen@redhat.com, david@fromorbit.com, darrick.wong@oracle.com Subject: Re: [PATCH 18/20] Use FIEMAP for FIBMAP calls Message-ID: <20181120085334.GB6785@lst.de> References: <20181030131823.29040-1-cmaiolino@redhat.com> <20181030131823.29040-19-cmaiolino@redhat.com> <20181116160643.GB17130@lst.de> <20181119125028.i7l2kokqvcogfnar@hades.usersys.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181119125028.i7l2kokqvcogfnar@hades.usersys.redhat.com> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Mon, Nov 19, 2018 at 01:50:28PM +0100, Carlos Maiolino wrote: > On Fri, Nov 16, 2018 at 05:06:43PM +0100, Christoph Hellwig wrote: > > On Tue, Oct 30, 2018 at 02:18:21PM +0100, Carlos Maiolino wrote: > > > + if (inode->i_op->fiemap) { > > > + fextent.fe_logical = 0; > > > + fextent.fe_physical = 0; > > > + f_ctx.fc_extents_max = 1; > > > + f_ctx.fc_extents_mapped = 0; > > > + f_ctx.fc_data = &fextent; > > > + f_ctx.fc_start = start; > > > + f_ctx.fc_len = 1; > > > + f_ctx.fc_flags = 0; > > > + f_ctx.fc_cb = fiemap_fill_kernel_extent; > > > + > > > + error = inode->i_op->fiemap(inode, &f_ctx); > > > + > > > + if (error) > > > + goto out; > > > + > > > + *block = (fextent.fe_physical + > > > + (start - fextent.fe_logical)) >> inode->i_blkbits; > > > + > > > > I think this code needs to be split into a helper. > > > > Yup, my idea is to try to reduce as much as possible the shared code between > usr/kernel helpers, I just didn't want to spend more time thinking about it > without having a review of the overall design :P Well, the code in this branch should not change at all by being moved into a helper function..