From patchwork Tue Jan 9 14:33:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Wilcox X-Patchwork-Id: 186421 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:2411:b0:101:2151:f287 with SMTP id m17csp150562dyi; Tue, 9 Jan 2024 06:37:21 -0800 (PST) X-Google-Smtp-Source: AGHT+IH3Ymo4j0GFSJUJUcH361VjCO64V1McurgG+MLs11EmKV4qLZEzlFMLaUwpghE/m4M3S0Ux X-Received: by 2002:a17:906:7307:b0:a2a:ffb0:adbb with SMTP id di7-20020a170906730700b00a2affb0adbbmr716561ejc.77.1704811041122; Tue, 09 Jan 2024 06:37:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704811041; cv=none; d=google.com; s=arc-20160816; b=cG7HTWOa1VbpzNxOysZx8LPIC4Af370XnjvKjxp1yXKWE3XuBg7bxF6GKxirG8t1jT rx/CPSNg55HbI2/5x1AZyUw7qOmAt3jtBO+SwJ+tbI4Ah0Sj46ssLDI5l9om81brRnrJ Udn/sZY2UFnzMkP9Dqat3XbufpTWpDmfytDB/N1cxD1x9MIja8PGXMoprx6vuGxvY6Z7 aEIipkOHOy7eAXUEYQ9o+haW3RRetZcBAgr3Aug0lnSQcd57DjtsoFcEBQRD1vqbTAQd w/ZQR44fVKRIsVN0OS+D16vaMZyGlasyut3LPMMdU6X66SuWPq1dqGAvV8StIJS+r7zk Jk0g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=vQE4Vr9H4MhDEQ3ZsfKD//avXDRAF3tvXQ94yS9EaIc=; fh=C1THyYX8mZv7/wM+MHV1ZUcnQSQiZbUrxk0HRhdecS4=; b=ckI8K/bc3McbOghYWUoDuA5VQPh00k8Iiu8Bw7+J+x7iyTfYKxdQmqIXV+RdBPU4ms 3WrG5qo7sPT3L57w08aSiag96UBF7Xk/H0dLM2qi42yY2kjbAl8BFOI540PbHR+x2Ohq BU8BEGuaT9jqgQOpE2kYZO9kejoutnfMvn1z4KJ7lOOnCyKIhy0j4H99XS+WJOcmJz2S I35sCGLU2oCRF15OB3B+UX9V+6cr7fZVGG09DbhHFZ/wrEu0M32ZR1b1bw2HpVTeDXZF V+nN5+hQABzosHy6TQ27q/pw4RB4O94FbDk2Aa/b4xiJtanAbTcASIDPFBTdvdUqCPdM t2+Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=WOy8RXNK; spf=pass (google.com: domain of linux-kernel+bounces-20998-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-20998-ouuuleilei=gmail.com@vger.kernel.org" Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id x17-20020a170906135100b00a29e4d879b1si824612ejb.349.2024.01.09.06.37.20 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Jan 2024 06:37:21 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-20998-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=WOy8RXNK; spf=pass (google.com: domain of linux-kernel+bounces-20998-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-20998-ouuuleilei=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 am.mirrors.kernel.org (Postfix) with ESMTPS id B82F71F24D1E for ; Tue, 9 Jan 2024 14:37:20 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C0FF33C489; Tue, 9 Jan 2024 14:34:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="WOy8RXNK" 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 D3BA53C067; Tue, 9 Jan 2024 14:34:22 +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=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description; bh=vQE4Vr9H4MhDEQ3ZsfKD//avXDRAF3tvXQ94yS9EaIc=; b=WOy8RXNKs6IkvVSwr390DH5rRe 0rst5N0FA/qgl8haZG3WWpgKA98XqBUTBrk6VO84tfKI2gUcXcpXwQNWdwLmkXJ4kLGdQS8yL6k1d YFFIVqft4rvEIVeyqvGjnFTqIiNrNifH3XoCAogibRgbU57ipvSoHdN8OqlAvtrdpZ/iP8zoEKcNl Wpc74Ie6cZstz0i54+BmqZSWqG7rIQ/fZflo7FfJ1OMCcHw1Ql97n2vKjI7g5sIPYm2NnKmVrZP+E uBbWWP25xLMR7PETFxYOVfR+g5nuWaU/y4y10cjIxhvfydceKgEMvwjELoP9fYWoFWYy1W4aa2AZC cUHHeFNQ==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1rNDB1-009xrc-BC; Tue, 09 Jan 2024 14:33:59 +0000 From: "Matthew Wilcox (Oracle)" To: Jonathan Corbet Cc: "Matthew Wilcox (Oracle)" , linux-doc@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 7/8] buffer: Improve bdev_getblk documentation Date: Tue, 9 Jan 2024 14:33:56 +0000 Message-Id: <20240109143357.2375046-8-willy@infradead.org> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20240109143357.2375046-1-willy@infradead.org> References: <20240109143357.2375046-1-willy@infradead.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1787623942180123242 X-GMAIL-MSGID: 1787623942180123242 Add some more information about the state of the buffer_head returned. Signed-off-by: Matthew Wilcox (Oracle) --- fs/buffer.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/fs/buffer.c b/fs/buffer.c index 05b68eccfdcc..562de7e013f7 100644 --- a/fs/buffer.c +++ b/fs/buffer.c @@ -1424,6 +1424,11 @@ EXPORT_SYMBOL(__find_get_block); * @size: The size of buffer_heads for this @bdev. * @gfp: The memory allocation flags to use. * + * The returned buffer head has its reference count incremented, but is + * not locked. The caller should call brelse() when it has finished + * with the buffer. The buffer may not be uptodate. If needed, the + * caller can bring it uptodate either by reading it or overwriting it. + * * Return: The buffer head, or NULL if memory could not be allocated. */ struct buffer_head *bdev_getblk(struct block_device *bdev, sector_t block,