All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pratyush Yadav <pratyush@kernel.org>
To: Mike Rapoport <rppt@kernel.org>,
	Pasha Tatashin <pasha.tatashin@soleen.com>,
	Pratyush Yadav <pratyush@kernel.org>,
	Alexander Graf <graf@amazon.com>,
	Jonathan Corbet <corbet@lwn.net>,
	Shuah Khan <skhan@linuxfoundation.org>,
	Randy Dunlap <rdunlap@infradead.org>,
	David Matlack <dmatlack@google.com>,
	Bjorn Helgaas <bhelgaas@google.com>
Cc: kexec@lists.infradead.org, linux-mm@kvack.org,
	linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-pci@vger.kernel.org
Subject: [PATCH 6/6] kho: don't reference subtree blobs as FDTs
Date: Fri, 27 Nov 2026 12:25:32 +0000	[thread overview]
Message-ID: <20261127122536.3708770-7-pratyush@kernel.org> (raw)
In-Reply-To: <20261127122536.3708770-1-pratyush@kernel.org>

From: "Pratyush Yadav (Google)" <pratyush@kernel.org>

KHO started out with using FDT for all subtrees. This is why debugfs
used "sub_fdts" as the directory name and in the code. Since then, KHO
subtrees started also using raw C structs for serialization. Commit
4916ae386760 ("kho: rename fdt parameter to blob in
kho_add/remove_subtree()") updated some of the code to match this
reality.

Still, references to sub FDTs were left around. The data structure to
track the blobs is still called fdt_debugfs, the list of blobs is called
"fdt_list", and most importantly, the subdirectory holding them in
debugfs is called "sub_fdts".

Update all this to use blob in the naming.

The only functional change is the rename of the debugfs subdirectory
from "sub_fdts" to "sub_blobs". Everything else is a pure rename.

Signed-off-by: Pratyush Yadav (Google) <pratyush@kernel.org>
---
 kernel/liveupdate/kho_debugfs.c  | 50 ++++++++++++++++----------------
 kernel/liveupdate/kho_internal.h |  4 +--
 2 files changed, 27 insertions(+), 27 deletions(-)

diff --git a/kernel/liveupdate/kho_debugfs.c b/kernel/liveupdate/kho_debugfs.c
index 8d04368c1978..1580e1a27566 100644
--- a/kernel/liveupdate/kho_debugfs.c
+++ b/kernel/liveupdate/kho_debugfs.c
@@ -17,7 +17,7 @@
 
 static struct dentry *debugfs_root;
 
-struct fdt_debugfs {
+struct kho_debugfs_blob {
 	struct list_head list;
 	struct debugfs_blob_wrapper wrapper;
 	struct dentry *file;
@@ -27,24 +27,24 @@ static int __kho_debugfs_blob_add(struct list_head *list, struct dentry *dir,
 				  const char *name, const void *blob,
 				  size_t size)
 {
-	struct fdt_debugfs *f;
+	struct kho_debugfs_blob *b;
 	struct dentry *file;
 
-	f = kmalloc_obj(*f);
-	if (!f)
+	b = kmalloc_obj(*b);
+	if (!b)
 		return -ENOMEM;
 
-	f->wrapper.data = (void *)blob;
-	f->wrapper.size = size;
+	b->wrapper.data = (void *)blob;
+	b->wrapper.size = size;
 
-	file = debugfs_create_blob(name, 0400, dir, &f->wrapper);
+	file = debugfs_create_blob(name, 0400, dir, &b->wrapper);
 	if (IS_ERR(file)) {
-		kfree(f);
+		kfree(b);
 		return PTR_ERR(file);
 	}
 
-	f->file = file;
-	list_add(&f->list, list);
+	b->file = file;
+	list_add(&b->list, list);
 
 	return 0;
 }
@@ -57,20 +57,20 @@ int kho_debugfs_blob_add(struct kho_debugfs *dbg, const char *name,
 	if (root)
 		dir = dbg->dir;
 	else
-		dir = dbg->sub_fdt_dir;
+		dir = dbg->sub_blob_dir;
 
-	return __kho_debugfs_blob_add(&dbg->fdt_list, dir, name, blob, size);
+	return __kho_debugfs_blob_add(&dbg->blob_list, dir, name, blob, size);
 }
 
 void kho_debugfs_blob_remove(struct kho_debugfs *dbg, void *blob)
 {
-	struct fdt_debugfs *ff;
+	struct kho_debugfs_blob *b;
 
-	list_for_each_entry(ff, &dbg->fdt_list, list) {
-		if (ff->wrapper.data == blob) {
-			debugfs_remove(ff->file);
-			list_del(&ff->list);
-			kfree(ff);
+	list_for_each_entry(b, &dbg->blob_list, list) {
+		if (b->wrapper.data == blob) {
+			debugfs_remove(b->file);
+			list_del(&b->list);
+			kfree(b);
 			break;
 		}
 	}
@@ -99,7 +99,7 @@ __init void kho_in_debugfs_init(struct kho_debugfs *dbg, const void *fdt)
 	struct dentry *dir;
 	int err;
 
-	INIT_LIST_HEAD(&dbg->fdt_list);
+	INIT_LIST_HEAD(&dbg->blob_list);
 
 	dir = debugfs_create_dir("in", debugfs_root);
 	if (IS_ERR(dir)) {
@@ -107,7 +107,7 @@ __init void kho_in_debugfs_init(struct kho_debugfs *dbg, const void *fdt)
 		goto err_out;
 	}
 
-	err = __kho_debugfs_blob_add(&dbg->fdt_list, dir, "fdt", fdt,
+	err = __kho_debugfs_blob_add(&dbg->blob_list, dir, "fdt", fdt,
 				     fdt_totalsize(fdt));
 	if (err)
 		goto err_rmdir;
@@ -131,16 +131,16 @@ __init void kho_in_debugfs_init(struct kho_debugfs *dbg, const void *fdt)
 
 __init int kho_out_debugfs_init(struct kho_debugfs *dbg)
 {
-	struct dentry *dir, *f, *sub_fdt_dir;
+	struct dentry *dir, *f, *sub_blob_dir;
 
-	INIT_LIST_HEAD(&dbg->fdt_list);
+	INIT_LIST_HEAD(&dbg->blob_list);
 
 	dir = debugfs_create_dir("out", debugfs_root);
 	if (IS_ERR(dir))
 		return -ENOMEM;
 
-	sub_fdt_dir = debugfs_create_dir("sub_fdts", dir);
-	if (IS_ERR(sub_fdt_dir))
+	sub_blob_dir = debugfs_create_dir("sub_blobs", dir);
+	if (IS_ERR(sub_blob_dir))
 		goto err_rmdir;
 
 	f = debugfs_create_file("bootmem_phys", 0400, dir, NULL,
@@ -154,7 +154,7 @@ __init int kho_out_debugfs_init(struct kho_debugfs *dbg)
 		goto err_rmdir;
 
 	dbg->dir = dir;
-	dbg->sub_fdt_dir = sub_fdt_dir;
+	dbg->sub_blob_dir = sub_blob_dir;
 	return 0;
 
 err_rmdir:
diff --git a/kernel/liveupdate/kho_internal.h b/kernel/liveupdate/kho_internal.h
index 5b349f451cf6..22950fe3bcc8 100644
--- a/kernel/liveupdate/kho_internal.h
+++ b/kernel/liveupdate/kho_internal.h
@@ -11,8 +11,8 @@
 
 struct kho_debugfs {
 	struct dentry *dir;
-	struct dentry *sub_fdt_dir;
-	struct list_head fdt_list;
+	struct dentry *sub_blob_dir;
+	struct list_head blob_list;
 };
 
 #else
-- 
2.56.1.839.g22a8290db9-goog



  parent reply	other threads:[~2026-11-27 12:26 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-27 12:25 [PATCH 0/6] kho: housekeeping Pratyush Yadav
2026-11-27 12:25 ` [PATCH 1/6] kho: build KHO objects into a single kho.o Pratyush Yadav
2026-11-27 12:25 ` [PATCH 2/6] kho: use acronym for KHO .c files Pratyush Yadav
2026-11-27 12:25 ` [PATCH 3/6] kho: move kho_{block,radix_tree}.h into include/linux/kho/ Pratyush Yadav
2026-11-27 12:25 ` [PATCH 4/6] kho: use unsigned long for kho_preserve_pages() and co when KHO=n Pratyush Yadav
2026-11-27 12:25 ` [PATCH 5/6] kho: fix kernel-doc return for kho_alloc_preserve() Pratyush Yadav
2026-11-27 12:25 ` Pratyush Yadav [this message]
2026-11-28  0:59   ` [PATCH 6/6] kho: don't reference subtree blobs as FDTs Chris Down
2026-11-28 12:26   ` sashiko-bot
2026-11-29 10:05   ` Mike Rapoport
2026-11-28 12:26 ` [PATCH 0/6] kho: housekeeping sashiko-bot
2026-11-29 17:10 ` (subset) " Mike Rapoport

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=20261127122536.3708770-7-pratyush@kernel.org \
    --to=pratyush@kernel.org \
    --cc=bhelgaas@google.com \
    --cc=corbet@lwn.net \
    --cc=dmatlack@google.com \
    --cc=graf@amazon.com \
    --cc=kexec@lists.infradead.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=pasha.tatashin@soleen.com \
    --cc=rdunlap@infradead.org \
    --cc=rppt@kernel.org \
    --cc=skhan@linuxfoundation.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.