Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp7988184rdb; Thu, 4 Jan 2024 14:42:09 -0800 (PST) X-Google-Smtp-Source: AGHT+IF2X1y2GiS71ToMesUwnQ1nCgtY6pM78GotROq5b7SNTpBDgaHfUbUGec+xZEBMqlMgpGNd X-Received: by 2002:a05:6808:118d:b0:3bb:c5df:ffe0 with SMTP id j13-20020a056808118d00b003bbc5dfffe0mr1221793oil.107.1704408128799; Thu, 04 Jan 2024 14:42:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704408128; cv=none; d=google.com; s=arc-20160816; b=QU/5s7/F+vZaXnu4vuAbqxyqAeCgFcX9CWhxTawDF4J4L/KieF8LFMsOm6Rnkkvham x3QPOzuTRxjdfbNgSkKbj8fI9ZIDLHncf4vOAWROlhsksmpKTNLiTSFn+008XORjHags J8IhCGwcfY/sC79UDHGBa9tScjmSVWICCqAGauTjBeZVRec+5Aa4Illzuz+C3/q6nIWA YPWbkhnRaCf/PtVXu+pPyHNDQxvb3YhSGsJBMH7twC3cime/9EnDnGQRAbmhSZIr7kmD qfo/f8Ca7qgzrODtVpyQz6wLnPhhyNh7ZbGq0RTOHze4YE4I3KlVzPzJmvFqCPoc+4cf +GHw== ARC-Message-Signature: i=1; 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=KaEe4j2YqFtbEdXkete4TcSZkc6Zq8WOCZ/Wk+4hPjQ=; fh=z3KJ8mKGmVEcl0QyJUZ9Hd00oplDS7Ez0SjJ1qMesEU=; b=OZ3swxWotcYvLh9yKBZBntzYKEvBVnAsgdGNTkpCceaDPQxgYnRe4VBF9e+7WOKw+N cdbPwrsO8Qr/nDGLCj5e5L3/2U0r3CVSfzZ0o+8piKtZ4ds6No4NdXKDnbkBDE7H1i1D Bj/QeCCjLIRafAfXPSg0Iz9mymWGixbJZ1oOkHMfZ81qjDAq5sy+ZyaPmSp7Vpb6X6hl Jy17A3RrgTp7++IqdQpCTxTRn60HIYKOvgVwKxCRZVX2nOXjZhVzsCIfC02g+qgjbJDl ShbF9GTmLTa485uctFE7fqxeTkIh/qK1rZ3EP9qjqfcBn62hnFg4x0HD8qCcLnMKMAtp LC+Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=TQZk5Zen; spf=pass (google.com: domain of linux-kernel+bounces-17298-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-17298-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id r5-20020a0cb285000000b0067f8f1666c5si432696qve.430.2024.01.04.14.42.08 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Jan 2024 14:42:08 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-17298-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=TQZk5Zen; spf=pass (google.com: domain of linux-kernel+bounces-17298-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-17298-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 862541C22A73 for ; Thu, 4 Jan 2024 22:42:08 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 393B12D02B; Thu, 4 Jan 2024 22:41:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="TQZk5Zen" X-Original-To: linux-kernel@vger.kernel.org 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 286642CCAD; Thu, 4 Jan 2024 22:41:55 +0000 (UTC) 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=KaEe4j2YqFtbEdXkete4TcSZkc6Zq8WOCZ/Wk+4hPjQ=; b=TQZk5Zen9UZsk8HJmdS/ge2mcZ DKG7C5jljUoCnAxOSxOfi/Dh0EGTGv8yKsIOxzJhI2pobAFPdujqXLrWH5oFQMfUWS+a0ZFsk65bk v5gE8gsUgLoh6F7PCghJzCh9LKCazVcQ1RlRf58TaFlMMdv/WN6NEteTaMokBM9Q3tKiKwIfyKj2M ylOg2P3mS5Ie0SLGptFNgzASbbXJUq0kOzLxSx2bEuTQU5xzIxbIT6Tv0GzgY94rGTnK5ouNWOA+Y xPVdPFBrVYEb70TAMm0o5EAy9psdfwwJclgeJ7GoS2iZMzO4Yj8BgWmz+cCzH9rNlOVrBis+6YMt2 lLv4m3zA==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1rLWPP-00GCek-RS; Thu, 04 Jan 2024 22:41:51 +0000 Date: Thu, 4 Jan 2024 22:41:51 +0000 From: Matthew Wilcox To: Randy Dunlap Cc: Jonathan Corbet , linux-doc@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/5] buffer: Add kernel-doc for block_dirty_folio() Message-ID: References: <20240104163652.3705753-1-willy@infradead.org> <20240104163652.3705753-3-willy@infradead.org> <133cd73f-3080-4362-bc3e-ef4cc8880a20@infradead.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: <133cd73f-3080-4362-bc3e-ef4cc8880a20@infradead.org> On Thu, Jan 04, 2024 at 01:06:10PM -0800, Randy Dunlap wrote: > > +/** > > + * block_dirty_folio - Mark a folio as dirty. > > + * @mapping: The address space containing this folio. > > + * @folio: The folio to mark dirty. > > + * > > + * Filesystems which use buffer_heads can use this function as their > > + * ->dirty_folio implementation. Some filesystems need to do a little > > + * work before calling this function. Filesystems which do not use > > + * buffer_heads should call filemap_dirty_folio() instead. > > + * > > + * If the folio has buffers, the uptodate buffers are set dirty, to > > + * preserve dirty-state coherency between the folio and the buffers. > > + * It the folio does not have buffers then when they are later attached > > + * they will all be set dirty. > > + * > > + * The buffers are dirtied before the folio is dirtied. There's a small > > + * race window in which writeback may see the folio cleanness but not the > > + * buffer dirtiness. That's fine. If this code were to set the folio > > + * dirty before the buffers, writeback could clear the folio dirty flag, > > + * see a bunch of clean buffers and we'd end up with dirty buffers/clean > > + * folio on the dirty folio list. > > + * > > + * We use private_lock to lock against try_to_free_buffers() while > > + * using the folio's buffer list. This also prevents clean buffers > > + * being added to the folio after it was set dirty. > > + * > > + * Context: May only be called from process context. Does not sleep. > > + * Caller must ensure that @folio cannot be truncated during this call, > > + * typically by holding the folio lock or having a page in the folio > > + * mapped and holding the page table lock. > > * Return: tbd + * + * Return: True if the folio was dirtied; false if it was already dirtied.