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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 47BC1C433EF for ; Thu, 23 Dec 2021 14:22:46 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 837196B007B; Thu, 23 Dec 2021 09:22:45 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 7E6726B007E; Thu, 23 Dec 2021 09:22:45 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6D51D6B0081; Thu, 23 Dec 2021 09:22:45 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0105.hostedemail.com [216.40.44.105]) by kanga.kvack.org (Postfix) with ESMTP id 5869F6B007B for ; Thu, 23 Dec 2021 09:22:45 -0500 (EST) Received: from smtpin03.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 10BFF8476B for ; Thu, 23 Dec 2021 14:22:45 +0000 (UTC) X-FDA: 78949275090.03.3E73AEF Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf17.hostedemail.com (Postfix) with ESMTP id 8D46140028 for ; Thu, 23 Dec 2021 14:22:32 +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=9rXZLYcPFrczYMK7u+QWj33Y06uzQ/T0+vv+Pk6PyLY=; b=Wt3daIStnfTHmAYw/0I18D/FRs +vhd1/l3n65yU8BfiIPKsjsWHGb8aXBdrxd4+jSgJledfDyjmFg8LwAp5nfy3PSb78NbKhS0p0/tl fMMyMd6K214+yzsFxDwosY4b0kWf8/hWuIjwvCwQnH/KHK81KAVldVXe1/3icshxwcYZKGGV8tpZv Hk+0ZWU4SDMli1lykKWpJOXZaw8Oxk7m15iNQCrCbrQsl35k7dpOQmJ+2U0/yBzxwwRZ+29Ul2G51 7avS3HSFenqgAYTlG0UenJHZNFL1MdLYNioKwBnIeBdRT9hhHOyyps79k+ETFxzz6Gy1sjgDwAHVj Mrugj+NQ==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1n0OzS-004KcT-1Q; Thu, 23 Dec 2021 14:22:42 +0000 Date: Thu, 23 Dec 2021 14:22:42 +0000 From: Matthew Wilcox To: Christoph Hellwig Cc: linux-fsdevel@vger.kernel.org, linux-mm@kvack.org Subject: Re: [PATCH 06/48] iov_iter: Add copy_folio_to_iter() Message-ID: References: <20211208042256.1923824-1-willy@infradead.org> <20211208042256.1923824-7-willy@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Authentication-Results: imf17.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=Wt3daISt; spf=none (imf17.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org; dmarc=none X-Rspamd-Queue-Id: 8D46140028 X-Stat-Signature: y4whx74gmawox5nu8u4ai8nr577uq7uz X-Rspamd-Server: rspam04 X-HE-Tag: 1640269352-446336 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: On Wed, Dec 22, 2021 at 10:55:20PM -0800, Christoph Hellwig wrote: > On Wed, Dec 08, 2021 at 04:22:14AM +0000, Matthew Wilcox (Oracle) wrote: > > +static inline size_t copy_folio_to_iter(struct folio *folio, size_t offset, > > + size_t bytes, struct iov_iter *i) > > +{ > > + return copy_page_to_iter((struct page *)folio, offset, bytes, i); > > +} > > I think we had this 2 or three series ago, but these open coded casts > are a bad idea. I think we need a proper and well documented helper for > them. I don't want to see casts between folio & page in most code, but I think having it in this kind of helper is fine. It literally exists in order to document that the callee handles folios correctly.