Received: by 2002:a05:7412:e794:b0:fa:551:50a7 with SMTP id o20csp363430rdd; Tue, 9 Jan 2024 06:37:13 -0800 (PST) X-Google-Smtp-Source: AGHT+IEU54rE33eI3AnRyM76ZFnrGaSUrSmRznz5fcpMRx4rl///84EqDrC6BNGXPhTQaW5qQ6He X-Received: by 2002:a50:9b44:0:b0:558:1700:70e6 with SMTP id a4-20020a509b44000000b00558170070e6mr581888edj.36.1704811033005; Tue, 09 Jan 2024 06:37:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704811032; cv=none; d=google.com; s=arc-20160816; b=D3b80P/0JQFOsgWOjpjLAYBcDeemOcylOFsIzzUpenjSihybbfKXyAi3HrCi7ZUfua J59YCsRyc6jnzU3ra4UIiOi2GPjB2snA8yYe0FMUDY736cdai2hwOMIyILAtbQhWlXZr dxzvs+5NhFQ4tfbfGWTgov8mdF1I6BwDMTUj2Kx7w41JzJyucuq20pEBgLH9/CUBlN5e j9PnztCWHk2DlO+9v7Bi2wMCkfnWdEEIOJZtVnSOgwvx1OteKVj/2bsK/l57zmSvQH+E Rq2R3vtTUeAaGF66JqHeB+2AMCkwb4EogEwSgtGNd/ueEJB10os5/r9QtlNj6MmUNNcF 5KFQ== 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-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-20998-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id s24-20020a508d18000000b005533fb37c69si795805eds.549.2024.01.09.06.37.12 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Jan 2024 06:37:12 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-20998-linux.lists.archive=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-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-20998-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 2ADB51F220AF for ; Tue, 9 Jan 2024 14:37:12 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E55053C46E; Tue, 9 Jan 2024 14:34:24 +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 Content-Transfer-Encoding: 8bit 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, -- 2.43.0