From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-f67.google.com ([209.85.221.67]:39392 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727743AbeIJPZ0 (ORCPT ); Mon, 10 Sep 2018 11:25:26 -0400 Received: by mail-wr1-f67.google.com with SMTP id s14-v6so12362808wrw.6 for ; Mon, 10 Sep 2018 03:32:01 -0700 (PDT) Date: Mon, 10 Sep 2018 12:31:57 +0200 From: Carlos Maiolino To: Christoph Hellwig Cc: Matthew Wilcox , linux-fsdevel@vger.kernel.org, sandeen@redhat.com, david@fromorbit.com Subject: Re: [PATCH 2/2] Use fiemap internal infra-structure to handle FIBMAP Message-ID: <20180910103157.nkakndcxnc2vtkhg@odin.usersys.redhat.com> References: <20180905135748.30098-1-cmaiolino@redhat.com> <20180905135748.30098-3-cmaiolino@redhat.com> <20180905143147.GC3729@bombadil.infradead.org> <20180905185649.GB423@lst.de> <20180906083105.tsqbpypdalekpaom@odin.usersys.redhat.com> <20180910075039.GA14999@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180910075039.GA14999@lst.de> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Mon, Sep 10, 2018 at 09:50:39AM +0200, Christoph Hellwig wrote: > On Thu, Sep 06, 2018 at 10:31:05AM +0200, Carlos Maiolino wrote: > > > > Sorry, I'm not 100% sure I followed your point here, do you mind to detail it a > > bit? > > Passing fiemap_fill_next_extent() as a pointer to what? ->fiemap() interface? > > Yes. > > > Sounds interesting, but doing this looks like I'll need to do what I was trying > > to avoid from the beginning, which is the creating of a second struct > > fiemap_extent_info, to be used in-lernel only, so, the last field doesn't need > > to be tagged as __user. I'm ok with that though, I was just trying a way to > > avoid adding unneeded data structures if possible, but looks like it ended up > > not being a good approach :P > > fieinfo is mostly used as an opaqueue cookie, so I think it should > be possible to just pass a void pointer to fiemap and only let the 'filler' > callback (that is fiemap_fill_next_extent or whatever a kernel caller > passed) interpret it. > > The only thing breaking this right now seems to be fi_flags, so maybe > we just need to pass that explicitly as another argument to ->fiemap. > > Something like: > > typedef int (fiemap_fill_cb)(struct inode *inode, void *data, u64 logical, > u64 phys, u64 len, u32 flags); > > struct file_operations { > ... > int (*fiemap)(struct inode *, unsigned int, fiemap_fill_cb, > void *, u64 start, u64 len); > ... Thanks, this gives me some extra information to keep working on it. And I agree this is a good way to refactor this infra-structure. I'll work on something based on this and send it out to the list. > }; -- Carlos