Received: by 2002:a05:7412:98c1:b0:fa:551:50a7 with SMTP id kc1csp1810709rdb; Mon, 8 Jan 2024 10:53:52 -0800 (PST) X-Google-Smtp-Source: AGHT+IFaoepCRmNZfQDLCyzT4l21sB5HpA4LdUwnVeOWSIa2jn4howsCtaGkR6Tt2lDZ+Qf/P6cJ X-Received: by 2002:a2e:880a:0:b0:2cc:f9e1:f9ed with SMTP id x10-20020a2e880a000000b002ccf9e1f9edmr1812889ljh.105.1704740031941; Mon, 08 Jan 2024 10:53:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704740031; cv=none; d=google.com; s=arc-20160816; b=oT+ovefvtCGLWLqPpZY+/kqJhJzSBqVGfqJBJ6UXSqrk9CDI59MWeLL5Qxw/fNe+Eu LZak2UJHFOnGQbzCbwwpyTDFmxlgqG8/e4yB5YwcOAjeI1ouyENPqEOrQ2BCgWAL4Nsh U0jIOIKxQlOhbXV3tYsls5d7vPy7pd4xUosEVq9QcxFs+r7dWPylQQ0pK8vIC4Fa3pP+ WqNz2QC//8LX6Gp6tqCMmNtOyHlNE+FfNHPOgOJgHF8Cu94G0qanAtU6V/6MRNWtqJL/ Wk9WKsGLJT7RuaYi6ZdS2DGeZFvsjLn4GtffO1IwZRStvWBohzCadWHKhBFtUDd6sqt9 WexQ== 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=XHWcZ2JmsqaWiasTCZlaDPgHas1hb4zo67ReyMpu1tI=; fh=DpCtZ80kt+1LEP3sY2wunNKCm6FoYnNcLv+SQtaiwQY=; b=OiQjmTI+f705Isl+omSMLI/MxI8UMH/tIOaxksMxl+bs2Oa2VQ8KCYV7L+HGWZdQI6 oouRxfyiOP9NOwzMP6cvbF3x5u+ZpmXnHGyI2xEEPRIgWCVVg9tBlvXl3EwJa53BAKtB Xl9Fvilz2XIci+VTjiGJIqZUhc+qHIhDpgLEBw8BNNkjiHkT7wBGkfXPodp9CFDmZYkH NUk0OsbZmUUWyuWi4fmGUG56b6L3YcTc6/ynMn+bN5/mOUTRhIGg4aWEp48ATJJ30r8Q x+gvQe0L6wgFG14djUP+NSoOkbvg0BfbV0p8bzGxB1/38gDbc9EusPYAdm/kHg36WMMm jFUg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@pankajraghav.com header.s=MBO0001 header.b=X4lA5tGA; spf=pass (google.com: domain of linux-kernel+bounces-19995-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-19995-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 v25-20020a50d599000000b0055433016eaesi112819edi.356.2024.01.08.10.53.51 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Jan 2024 10:53:51 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-19995-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=@pankajraghav.com header.s=MBO0001 header.b=X4lA5tGA; spf=pass (google.com: domain of linux-kernel+bounces-19995-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-19995-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 ACB711F2365D for ; Mon, 8 Jan 2024 18:53:51 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CE6B954BFB; Mon, 8 Jan 2024 18:53:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=pankajraghav.com header.i=@pankajraghav.com header.b="X4lA5tGA" X-Original-To: linux-kernel@vger.kernel.org Received: from mout-p-102.mailbox.org (mout-p-102.mailbox.org [80.241.56.152]) (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 139FF54BE3; Mon, 8 Jan 2024 18:53:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pankajraghav.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pankajraghav.com Received: from smtp102.mailbox.org (smtp102.mailbox.org [10.196.197.102]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-102.mailbox.org (Postfix) with ESMTPS id 4T839p37gxz9skW; Mon, 8 Jan 2024 19:53:34 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pankajraghav.com; s=MBO0001; t=1704740014; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=XHWcZ2JmsqaWiasTCZlaDPgHas1hb4zo67ReyMpu1tI=; b=X4lA5tGAla/+Tth6KDfxt2BEwdrniSB6SuTwfgew/Cq4J8m2frjkG59L1T9LEVZfICopI7 8DWThZRwAdYVX9P4QtYnyabHVIqyn7f0DHiTeWTGpnthtJG3PetxKFkIBbliqPMBUrpZUx j/MR682xahqMupc3AkjyQL5KhQRu8yqdp1Cpo36cueSL9T8gsY1mOidll0tzn+c7dAZI50 utJAIesYsvSpXMxg+MLRATtMZ7SmgNnvzZMPpG9IkSZdL3+8IBO2gMQewXn4SlkJmmxbbt QyIws8lyXiNBxuAjf5xp0N5rum7Dkte9KjoQhbG3DPDizRwJSJg+S32PFsMVcA== Date: Mon, 8 Jan 2024 19:53:31 +0100 From: "Pankaj Raghav (Samsung)" To: Matthew Wilcox Cc: Jonathan Corbet , linux-doc@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, p.raghav@samsung.com Subject: Re: [PATCH 4/5] buffer: Fix __bread() kernel-doc Message-ID: <20240108185331.nswciqsn676dhav3@localhost> References: <20240104163652.3705753-1-willy@infradead.org> <20240104163652.3705753-5-willy@infradead.org> <20240108145808.2k4rob3ntdknrkp3@localhost> 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 Mon, Jan 08, 2024 at 04:09:01PM +0000, Matthew Wilcox wrote: > On Mon, Jan 08, 2024 at 03:58:08PM +0100, Pankaj Raghav (Samsung) wrote: > > On Thu, Jan 04, 2024 at 04:36:51PM +0000, Matthew Wilcox (Oracle) wrote: > > > The extra indentation confused the kernel-doc parser, so remove it. > > > Fix some other wording while I'm here, and advise the user they need to > > > call brelse() on this buffer. > > > > > It looks like __bread_gfp has the same problem: > > I'm happy to incorporate this patch, but I'll need your S-o-B on it. Something like this: From: "Matthew Wilcox (Oracle)" Date: Mon, 8 Jan 2024 19:37:41 +0100 Subject: [PATCH] buffer: Update __bread() and __bread_gfp kernel-doc The extra indentation confused the kernel-doc parser, so remove it. Fix some other wording while I'm here, and advise the user they need to call brelse() on this buffer. Instead of duplicating the doc in __bread() and __bread_gfp(), update __bread_gfp() doc and point to it from __bread(). Signed-off-by: "Matthew Wilcox (Oracle)" Signed-off-by: Pankaj Raghav --- fs/buffer.c | 21 ++++++++++++--------- include/linux/buffer_head.h | 9 +-------- 2 files changed, 13 insertions(+), 17 deletions(-) diff --git a/fs/buffer.c b/fs/buffer.c index 967f34b70aa8..ea55fb3fcfae 100644 --- a/fs/buffer.c +++ b/fs/buffer.c @@ -1446,16 +1446,19 @@ void __breadahead(struct block_device *bdev, sector_t block, unsigned size) EXPORT_SYMBOL(__breadahead); /** - * __bread_gfp() - reads a specified block and returns the bh - * @bdev: the block_device to read from - * @block: number of block - * @size: size (in bytes) to read - * @gfp: page allocation flag + * __bread_gfp() - Read a block. + * @bdev: The block device to read from. + * @block: Block number in units of block size. + * @size: Block size in bytes. + * @gfp: gfp flags. * - * Reads a specified block, and returns buffer head that contains it. - * The page cache can be allocated from non-movable area - * not to prevent page migration if you set gfp to zero. - * It returns NULL if the block was unreadable. + * Read a specified block, and return the buffer head that refers to it. + * The memory can be allocated from a non-movable area to not to prevent + * page migration if you set gfp to zero. The buffer head has its + * refcount elevated and the caller should call brelse() when it has + * finished with the buffer. + * + * Return: NULL if the block was unreadable. */ struct buffer_head * __bread_gfp(struct block_device *bdev, sector_t block, diff --git a/include/linux/buffer_head.h b/include/linux/buffer_head.h index 5f23ee599889..ac56014b29dd 100644 --- a/include/linux/buffer_head.h +++ b/include/linux/buffer_head.h @@ -440,14 +440,7 @@ static inline void bh_readahead_batch(int nr, struct buffer_head *bhs[], } /** - * __bread() - reads a specified block and returns the bh - * @bdev: the block_device to read from - * @block: number of block - * @size: size (in bytes) to read - * - * Reads a specified block, and returns buffer head that contains it. - * The page cache is allocated from movable area so that it can be migrated. - * It returns NULL if the block was unreadable. + * See __bread_gfp() */ static inline struct buffer_head * __bread(struct block_device *bdev, sector_t block, unsigned size) -- 2.40.1