]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
mm: vmalloc: update outdated comment for renamed vread()
authorKexin Sun <kexinsun@smail.nju.edu.cn>
Sat, 21 Mar 2026 10:58:20 +0000 (18:58 +0800)
committerAndrew Morton <akpm@linux-foundation.org>
Sun, 5 Apr 2026 20:53:34 +0000 (13:53 -0700)
The function vread() was renamed to vread_iter() in commit 4c91c07c93bb
("mm: vmalloc: convert vread() to vread_iter()"), converting from a
buffer-based to an iterator-based interface.

Update the kdoc of vread_iter() to reflect the new interface: replace
references to @buf with @iter, drop the stale "kernel's buffer"
requirement, and update the self-reference from vread() to vread_iter().

Also update the stale vread() reference in pstore's ram_core.c.

Assisted-by: unnamed:deepseek-v3.2 coccinelle
Link: https://lkml.kernel.org/r/20260321105820.7134-1-kexinsun@smail.nju.edu.cn
Signed-off-by: Kexin Sun <kexinsun@smail.nju.edu.cn>
Reviewed-by: Andrew Morton <akpm@linux-foundation.org>
Cc: "Guilherme G. Piccoli" <gpiccoli@igalia.com>
Cc: Julia Lawall <julia.lawall@inria.fr>
Cc: Kees Cook <kees@kernel.org>
Cc: Tony Luck <tony.luck@intel.com>
Cc: "Uladzislau Rezki (Sony)" <urezki@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
fs/pstore/ram_core.c
mm/vmalloc.c

index ed97494abf60fabd0c6c7ce8a35a7ab476dccf7d..738283a85ea2bd6264c4cc7eb7546ef4f6e138d2 100644 (file)
@@ -450,7 +450,7 @@ static void *persistent_ram_vmap(phys_addr_t start, size_t size,
                pages[i] = pfn_to_page(addr >> PAGE_SHIFT);
        }
        /*
-        * VM_IOREMAP used here to bypass this region during vread()
+        * VM_IOREMAP used here to bypass this region during vread_iter()
         * and kmap_atomic() (i.e. kcore) to avoid __va() failures.
         */
        vaddr = vmap(pages, page_count, VM_MAP | VM_IOREMAP, prot);
index c607307c657a69c31a26984f5a6b4b2988ee9472..b31b208f6ecb3ddacb82c4b341ed80225c9b2c77 100644 (file)
@@ -4575,20 +4575,20 @@ finished:
  * @count:        number of bytes to be read.
  *
  * This function checks that addr is a valid vmalloc'ed area, and
- * copy data from that area to a given buffer. If the given memory range
+ * copies data from that area to a given iterator. If the given memory range
  * of [addr...addr+count) includes some valid address, data is copied to
- * proper area of @buf. If there are memory holes, they'll be zero-filled.
+ * proper area of @iter. If there are memory holes, they'll be zero-filled.
  * IOREMAP area is treated as memory hole and no copy is done.
  *
  * If [addr...addr+count) doesn't includes any intersects with alive
- * vm_struct area, returns 0. @buf should be kernel's buffer.
+ * vm_struct area, returns 0.
  *
- * Note: In usual ops, vread() is never necessary because the caller
+ * Note: In usual ops, vread_iter() is never necessary because the caller
  * should know vmalloc() area is valid and can use memcpy().
  * This is for routines which have to access vmalloc area without
  * any information, as /proc/kcore.
  *
- * Return: number of bytes for which addr and buf should be increased
+ * Return: number of bytes for which addr and iter should be advanced
  * (same number as @count) or %0 if [addr...addr+count) doesn't
  * include any intersection with valid vmalloc area
  */