From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: barebox@lists.infradead.org
Cc: Ahmad Fatoum <a.fatoum@pengutronix.de>
Subject: [PATCH] fs: ramfs: do not bother unmounting ramfs on shutdown
Date: Thu, 5 Jun 2025 13:26:18 +0200 [thread overview]
Message-ID: <20250605112618.1972479-1-a.fatoum@pengutronix.de> (raw)
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
next reply other threads:[~2025-06-05 11:37 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-05 11:26 Ahmad Fatoum [this message]
2025-06-05 11:57 ` Sascha Hauer
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=20250605112618.1972479-1-a.fatoum@pengutronix.de \
--to=a.fatoum@pengutronix.de \
--cc=barebox@lists.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox