]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
buffer: add kernel-doc for bforget() and __bforget()
authorMatthew Wilcox (Oracle) <willy@infradead.org>
Tue, 16 Apr 2024 03:17:50 +0000 (04:17 +0100)
committerAndrew Morton <akpm@linux-foundation.org>
Mon, 6 May 2024 00:53:40 +0000 (17:53 -0700)
Distinguish these functions from brelse() and __brelse().

Link: https://lkml.kernel.org/r/20240416031754.4076917-7-willy@infradead.org
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Tested-by: Randy Dunlap <rdunlap@infradead.org>
Cc: Pankaj Raghav <p.raghav@samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
fs/buffer.c
include/linux/buffer_head.h

index e5beca3868a77e5b3c82e6869e7bdd2721065d9d..60829312787ab3e8df92aaf5024785644cb844d5 100644 (file)
@@ -1242,9 +1242,12 @@ void __brelse(struct buffer_head *bh)
 }
 EXPORT_SYMBOL(__brelse);
 
-/*
- * bforget() is like brelse(), except it discards any
- * potentially dirty data.
+/**
+ * __bforget - Discard any dirty data in a buffer.
+ * @bh: The buffer to forget.
+ *
+ * This variant of bforget() can be called if @bh is guaranteed to not
+ * be NULL.
  */
 void __bforget(struct buffer_head *bh)
 {
index c145817c6ca0bb81ee48b2add2c74dcadddb72be..a1c0bdd0cca66b947280a448c96ee3d1629398ed 100644 (file)
@@ -325,6 +325,16 @@ static inline void brelse(struct buffer_head *bh)
                __brelse(bh);
 }
 
+/**
+ * bforget - Discard any dirty data in a buffer.
+ * @bh: The buffer to forget.
+ *
+ * Call this function instead of brelse() if the data written to a buffer
+ * no longer needs to be written back.  It will clear the buffer's dirty
+ * flag so writeback of this buffer will be skipped.
+ *
+ * Context: Any context.
+ */
 static inline void bforget(struct buffer_head *bh)
 {
        if (bh)