From: "Pankaj Raghav (Samsung)" <kernel@pankajraghav.com>
To: Matthew Wilcox <willy@infradead.org>
Cc: Jonathan Corbet <corbet@lwn.net>,
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
Date: Mon, 8 Jan 2024 19:53:31 +0100 [thread overview]
Message-ID: <20240108185331.nswciqsn676dhav3@localhost> (raw)
In-Reply-To: <ZZweHfmMWnlBFKdV@casper.infradead.org>
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)" <willy@infradead.org>
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)" <willy@infradead.org>
Signed-off-by: Pankaj Raghav <p.raghav@samsung.com>
---
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
next prev parent reply other threads:[~2024-01-08 18:53 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-04 16:36 [PATCH 0/5] Improve buffer head documentation Matthew Wilcox (Oracle)
2024-01-04 16:36 ` [PATCH 1/5] doc: Improve the description of __folio_mark_dirty Matthew Wilcox (Oracle)
2024-01-04 21:08 ` Randy Dunlap
2024-01-04 16:36 ` [PATCH 2/5] buffer: Add kernel-doc for block_dirty_folio() Matthew Wilcox (Oracle)
2024-01-04 21:06 ` Randy Dunlap
2024-01-04 22:41 ` Matthew Wilcox
2024-01-08 13:31 ` Pankaj Raghav (Samsung)
2024-01-08 13:35 ` Matthew Wilcox
2024-01-08 16:32 ` Matthew Wilcox
2024-01-08 17:47 ` Pankaj Raghav (Samsung)
2024-01-04 16:36 ` [PATCH 3/5] buffer: Add kernel-doc for try_to_free_buffers() Matthew Wilcox (Oracle)
2024-01-04 16:36 ` [PATCH 4/5] buffer: Fix __bread() kernel-doc Matthew Wilcox (Oracle)
2024-01-08 14:58 ` Pankaj Raghav (Samsung)
2024-01-08 16:09 ` Matthew Wilcox
2024-01-08 18:53 ` Pankaj Raghav (Samsung) [this message]
2024-01-04 16:36 ` [PATCH 5/5] doc: Split buffer.rst out of api-summary.rst Matthew Wilcox (Oracle)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240108185331.nswciqsn676dhav3@localhost \
--to=kernel@pankajraghav.com \
--cc=corbet@lwn.net \
--cc=linux-doc@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=p.raghav@samsung.com \
--cc=willy@infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.