* [PATCH] fs: ramfs: do not bother unmounting ramfs on shutdown
@ 2025-06-05 11:26 Ahmad Fatoum
2025-06-05 11:57 ` Sascha Hauer
0 siblings, 1 reply; 2+ messages in thread
From: Ahmad Fatoum @ 2025-06-05 11:26 UTC (permalink / raw)
To: barebox; +Cc: Ahmad Fatoum
It's pointless to free memory when we are about to boot a kernel that
will reclaim all memory anyway.
As ramfs only consists of such memory buffers, let's just skip its
freeing.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
fs/fs.c | 2 ++
fs/ramfs.c | 5 -----
2 files changed, 2 insertions(+), 5 deletions(-)
diff --git a/fs/fs.c b/fs/fs.c
index 0f821451103f..4d478eaf1f72 100644
--- a/fs/fs.c
+++ b/fs/fs.c
@@ -835,6 +835,8 @@ static void fs_remove(struct device *dev)
int ret;
if (fsdev->dev.driver) {
+ if (!dev->driver->remove)
+ return;
dev->driver->remove(dev);
list_del(&fsdev->list);
}
diff --git a/fs/ramfs.c b/fs/ramfs.c
index ab3c44270d43..e971f608545c 100644
--- a/fs/ramfs.c
+++ b/fs/ramfs.c
@@ -435,10 +435,6 @@ static int ramfs_probe(struct device *dev)
return 0;
}
-static void ramfs_remove(struct device *dev)
-{
-}
-
static struct fs_driver ramfs_driver = {
.read = ramfs_read,
.write = ramfs_write,
@@ -446,7 +442,6 @@ static struct fs_driver ramfs_driver = {
.truncate = ramfs_truncate,
.drv = {
.probe = ramfs_probe,
- .remove = ramfs_remove,
.name = "ramfs",
}
};
--
2.39.5
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] fs: ramfs: do not bother unmounting ramfs on shutdown
2025-06-05 11:26 [PATCH] fs: ramfs: do not bother unmounting ramfs on shutdown Ahmad Fatoum
@ 2025-06-05 11:57 ` Sascha Hauer
0 siblings, 0 replies; 2+ messages in thread
From: Sascha Hauer @ 2025-06-05 11:57 UTC (permalink / raw)
To: barebox, Ahmad Fatoum
On Thu, 05 Jun 2025 13:26:18 +0200, Ahmad Fatoum wrote:
> It's pointless to free memory when we are about to boot a kernel that
> will reclaim all memory anyway.
>
> As ramfs only consists of such memory buffers, let's just skip its
> freeing.
>
>
> [...]
Applied, thanks!
[1/1] fs: ramfs: do not bother unmounting ramfs on shutdown
https://git.pengutronix.de/cgit/barebox/commit/?id=3e29a3404edc (link may not be stable)
Best regards,
--
Sascha Hauer <s.hauer@pengutronix.de>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-06-05 11:58 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-06-05 11:26 [PATCH] fs: ramfs: do not bother unmounting ramfs on shutdown Ahmad Fatoum
2025-06-05 11:57 ` Sascha Hauer
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox