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 X-Spam-Level: X-Spam-Status: No, score=-2.3 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0DA5EC433FF for ; Tue, 6 Aug 2019 05:46:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E2D6D20880 for ; Tue, 6 Aug 2019 05:46:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726036AbfHFFqJ (ORCPT ); Tue, 6 Aug 2019 01:46:09 -0400 Received: from verein.lst.de ([213.95.11.211]:53335 "EHLO verein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725798AbfHFFqJ (ORCPT ); Tue, 6 Aug 2019 01:46:09 -0400 Received: by verein.lst.de (Postfix, from userid 2407) id BBDA868B02; Tue, 6 Aug 2019 07:46:04 +0200 (CEST) Date: Tue, 6 Aug 2019 07:46:04 +0200 From: Christoph Hellwig To: "Darrick J. Wong" Cc: linux-fsdevel@vger.kernel.org, hch@lst.de, adilger@dilger.ca, jaegeuk@kernel.org, miklos@szeredi.hu, rpeterso@redhat.com, linux-xfs@vger.kernel.org Subject: Re: [PATCH 8/9] Use FIEMAP for FIBMAP calls Message-ID: <20190806054604.GK13409@lst.de> References: <20190731141245.7230-1-cmaiolino@redhat.com> <20190731141245.7230-9-cmaiolino@redhat.com> <20190731232254.GW1561054@magnolia> <20190802134816.usmauocewduggrjt@pegasus.maiolino.io> <20190802152902.GI7138@magnolia> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190802152902.GI7138@magnolia> User-Agent: Mutt/1.5.17 (2007-11-01) Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org On Fri, Aug 02, 2019 at 08:29:02AM -0700, Darrick J. Wong wrote: > It's harder for me to tell when I don't have a branch containing the > final product to look at, but I'd have thought that _fill_kernel fills > out an in-kernel fiemap extent; and then _fill_user would declare one on > the stack, call _fill_kernel to set the fields, and then copy_to_user? That works fine for small, fixed-sized structures. But for large variable sized structures it is very inefficient, as we need to do a possibly large kernel allocation and just copy it on. Thus I told Carlos to follow the readdir model with the ->actor (used to be ->filldir) callback that can fill out the actual kernel or user data directly. Another example of this high-level model is our struct iov_iter used in the I/O path.