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=-3.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS 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 94A4DC4363A for ; Tue, 27 Oct 2020 18:58:14 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id AB66120878 for ; Tue, 27 Oct 2020 18:58:13 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="b4/4PvdY" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AB66120878 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 2A9AC6B006C; Tue, 27 Oct 2020 14:58:13 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 232206B006E; Tue, 27 Oct 2020 14:58:13 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0FB036B0070; Tue, 27 Oct 2020 14:58:13 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0076.hostedemail.com [216.40.44.76]) by kanga.kvack.org (Postfix) with ESMTP id D3F036B006C for ; Tue, 27 Oct 2020 14:58:12 -0400 (EDT) Received: from smtpin05.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 65CAC180AD80F for ; Tue, 27 Oct 2020 18:58:12 +0000 (UTC) X-FDA: 77418615624.05.cause60_150caa02727e Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin05.hostedemail.com (Postfix) with ESMTP id 4189F1826B6B2 for ; Tue, 27 Oct 2020 18:58:12 +0000 (UTC) X-HE-Tag: cause60_150caa02727e X-Filterd-Recvd-Size: 3132 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf40.hostedemail.com (Postfix) with ESMTP for ; Tue, 27 Oct 2020 18:58:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=mE1cwDDEmEjCnd5IdzIeq1L8rwr+K0PfUJkE+ZW/YUw=; b=b4/4PvdY33liOR8x2ruSgiRKg8 DgfQufrKwk4krix3uddSCJ90fBypGZ5jqxEthiA8wLgWHvzVTiqmOBmF7DGw1F+U1cxZ+hgfy/sci rG0R8W79qM7PiMSGqnInGAblwFDSpSkQLUe9l+WseAHcFHUpQoJ0wDuq9bNxpekgx3QbFUp4Dp+BE H3xM1AeFVBnHKz3lj7tnOByIKWtXF2+4h2MAuMbQyv4oZQLAUY5UYjOKjqlA8kk4rTDH3YPhPQhPt kyUJLBdkS1DzIGvNv6BSM8KwUMNazSO+lB6joRAQLrkmpfMsF3oMkUW5GxmcohVj12mAVXgLe55TD WT+Dd5FA==; Received: from hch by casper.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1kXUAb-0004F1-Qa; Tue, 27 Oct 2020 18:58:09 +0000 Date: Tue, 27 Oct 2020 18:58:09 +0000 From: Christoph Hellwig To: "Matthew Wilcox (Oracle)" Cc: linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, Andrew Morton , Hugh Dickins , Johannes Weiner , Yang Shi , Dave Chinner , linux-kernel@vger.kernel.org, William Kucharski Subject: Re: [PATCH v3 04/12] mm/filemap: Add mapping_seek_hole_data Message-ID: <20201027185809.GB15201@infradead.org> References: <20201026041408.25230-1-willy@infradead.org> <20201026041408.25230-5-willy@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201026041408.25230-5-willy@infradead.org> X-SRS-Rewrite: SMTP reverse-path rewritten from by casper.infradead.org. See http://www.infradead.org/rpr.html X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: > +/** > + * mapping_seek_hole_data - Seek for SEEK_DATA / SEEK_HOLE in the page cache. > + * @mapping: Address space to search. > + * @start: First byte to consider. > + * @end: Limit of search (exclusive). > + * @whence: Either SEEK_HOLE or SEEK_DATA. > + * > + * If the page cache knows which blocks contain holes and which blocks > + * contain data, your filesystem can use this function to implement > + * SEEK_HOLE and SEEK_DATA. This is useful for filesystems which are > + * entirely memory-based such as tmpfs, and filesystems which support > + * unwritten extents. > + * > + * Return: The requested offset on successs, or -ENXIO if @whence specifies > + * SEEK_DATA and there is no data after @start. There is an implicit hole > + * after @end - 1, so SEEK_HOLE returns @end if all the bytes between @start > + * and @end contain data. > + */ This seems to just lift the tmpfs one to common code. If it really is supposed to be generic it should be able to replace page_cache_seek_hole_data as well. So I don't think moving this without removing the other common one is an all that good idea.