Received: by 2002:ab2:6309:0:b0:1fb:d597:ff75 with SMTP id s9csp1275717lqt; Fri, 7 Jun 2024 13:11:37 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUzjrb9PUxR0X0VHO+XInqO0QfOmfoVJ2+PONhls1qvKLlXdJjPXdUE+iTwQJkSJ2usuvFGWffCGciTYjhxki13nlNW2uWAJynkcdb00g== X-Google-Smtp-Source: AGHT+IG3KdIRYZM3l0ccRUHFlsMYGol0SuQ+envT1pXd48m2EEz10p6JIDDxqI86O+kUre9S4cv3 X-Received: by 2002:a17:90a:5e01:b0:2bf:6b68:5219 with SMTP id 98e67ed59e1d1-2c2bcc76d26mr3331502a91.41.1717791096894; Fri, 07 Jun 2024 13:11:36 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717791096; cv=pass; d=google.com; s=arc-20160816; b=adVlVXACBwbhcrn47kunzHgZlqZIp+QcEmvVGxQ7jZo3qv0aWH7QMBeU3YxfIJs2Si pbl+HIPatxtlaKogzxcH95BFuKOR+nAgxMc4TzJR9JPbFR+iQR8YBp4GEjETytcwiYcV lrFQimcYQ523hBxQuS5daXeaszQgyC9jgQjW07a7B6gEkg7iImoKxqEN9VSxWP9j9W/g 828wvhqcVJH4wX+2g8/FmVHCaRdmrTYoBDpJhzV3TuBdKr/qvRZqu/RocaG1RewXmNxj pe+XJIZvJQt7ASvDneIBG3Hs7JsNbc5C2tNCXMYTgrQTwW+Lq2577L7PL6id098ixRRJ lwjg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=eCTR4eCQnyDJGr3WoiKlq3Zd4xvRFUfx0w1DxTE2FHk=; fh=NXk619aQi/tIjokylVtwpcUPW7Pk/U453Q+o/kM/Jbc=; b=WdxMy/m0ncI3OI4RAQv63Zv9cnNuD/7nyy3y0Y52bneNt2lNtwPoqzypwixRn+nvkV 9Xbcf4bI3jACFaPYWZFg6kc7es3ZZXnlI87yTkNkxxrp3x+DAxDFbgDsJ+l6erIiSXYk SZXHDIORoBccYVtmpHJzxue+pUMzVdEx+HkNDb2xKJjQ0NH1rgNg1LsSN/qdyN3hYq6+ sscpMJWJY/RSEQwT9ms+JfIpptg9vM4ZLcdFvJx4bAo+x2FmIE5UUqqwRuqRXEHhiP7w NXlm232cZoAh1aRG/udy9QCHl/GtFBE58XjJRd75WcdORY6TxVmPS+wj9SKfASiRmWjB prRA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=ty0t64Zd; arc=pass (i=1 dkim=pass dkdomain=infradead.org); spf=pass (google.com: domain of linux-kernel+bounces-206445-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-206445-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id 98e67ed59e1d1-2c2806bcbf2si2007297a91.102.2024.06.07.13.11.36 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Jun 2024 13:11:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-206445-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=ty0t64Zd; arc=pass (i=1 dkim=pass dkdomain=infradead.org); spf=pass (google.com: domain of linux-kernel+bounces-206445-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-206445-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 61E42284C38 for ; Fri, 7 Jun 2024 16:02:15 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B0719199384; Fri, 7 Jun 2024 16:02:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="ty0t64Zd" Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2628C168DE for ; Fri, 7 Jun 2024 16:02:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=90.155.50.34 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717776130; cv=none; b=p7f8DJpmPNBMXKZPsj2DOzvM6j020xTxBwt+Q27Uam75XEuVCBzi1d0BMOicA4MvdbY8WT6fhFSl2e13ycKE0ChBRFRz/sIn8k4xSwo9zpFb5I5SW9xtK6WuutfxBJ3eIjAB1ZMmo/fh0gduLIzp01Pqyb8Rhv4QG3od/u/TrP8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717776130; c=relaxed/simple; bh=Z+9m/qleTaeVNnE9xwb25COrIGPFFrhTCVuB+fYOh/M=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=lHNkA7Cgz8RZz5ceFB7iQT5twItCQCTaabMtP6GKLCAlgL7gebCFoPF95zihGuxjgO5NzKDi782TOLblQJi88w2UEdUt7jWshGvYvXmnyz9v4F7FJs5/MTu+e0QNzCL1kUteNb2ElokXrWD4Fo/ANhlGyAyl2HA6nGFIo+A3dzc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org; spf=none smtp.mailfrom=infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=ty0t64Zd; arc=none smtp.client-ip=90.155.50.34 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=infradead.org 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=eCTR4eCQnyDJGr3WoiKlq3Zd4xvRFUfx0w1DxTE2FHk=; b=ty0t64Zdm+td/YOTBVUkZPDwzU M7TU31sGn1m9AbG7scYTTj89O6P47eFre0P1XyqEm1C4Uo7n5uq5f4jv+JZtgn3MGp6+til+mO9cz XG414ub1uno8xMDJcLQIgIOTLNxklDaaW3397qu3Q9rSYpGbJCPlhh6DtuxCG0+HUGTY3s0POD5nQ 8KJ2FF4ZNboZsDXFiymYpaXNhDNp9z17dHfYwWdOADhqCK+FVLzyjeUxpTss022hzyHfqHKOgiPfs jU4Rs/tDvhRSnntiOTDPcc3DiWkr5K0CviCLv93oiheSC1SGJ61AbJFC5FaVGOzIhhBo+C7cj0mBw SPg7c1Gw==; Received: from willy by casper.infradead.org with local (Exim 4.97.1 #2 (Red Hat Linux)) id 1sFc2Z-00000006NPs-02yC; Fri, 07 Jun 2024 16:02:07 +0000 Date: Fri, 7 Jun 2024 17:02:06 +0100 From: Matthew Wilcox To: Chao Yu Cc: jaegeuk@kernel.org, linux-f2fs-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] f2fs: get rid of buffer_head use Message-ID: References: <20240607101829.389015-1-chao@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Fri, Jun 07, 2024 at 10:10:52PM +0800, Chao Yu wrote: > On 2024/6/7 21:33, Matthew Wilcox wrote: > > On Fri, Jun 07, 2024 at 06:18:29PM +0800, Chao Yu wrote: > > > @@ -1990,6 +1989,12 @@ static inline struct f2fs_super_block *F2FS_RAW_SUPER(struct f2fs_sb_info *sbi) > > > return (struct f2fs_super_block *)(sbi->raw_super); > > > } > > > +static inline struct f2fs_super_block *F2FS_SUPER_BLOCK(struct folio *folio) > > > +{ > > > + return (struct f2fs_super_block *)(page_address(folio_page(folio, 0)) + > > > + F2FS_SUPER_OFFSET); > > > +} > > > > This assumes that the superblock is in the first page of the folio. > > That's not necessarily guaranteed; let's say you have a 64KiB folio > > that covers the start of the bdev. > > Oh, I missed to add large folio support in this version. > > For the case: page size is 4KiB, and folio size is 64KiB, > read_mapping_folio(mapping, 0, NULL) and read_mapping_folio(mapping, > 1, NULL) will return the same #0 folio, right? That's right. If you want to pass a page into F2FS_SUPER_BLOCK, that would be fine. Assuming you're not trying to support fs blocksize != PAGE_SIZE.