mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: barebox@lists.infradead.org
Cc: Ahmad Fatoum <a.fatoum@pengutronix.de>
Subject: [PATCH] fs: export file system detection functionality
Date: Fri, 30 Sep 2022 17:40:53 +0200	[thread overview]
Message-ID: <20220930154053.752237-1-a.fatoum@pengutronix.de> (raw)

This will come in handy when using barebox as EFI loader, so give it a
more generic name and export it.

Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 fs/fs.c      | 4 ++--
 include/fs.h | 2 ++
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/fs/fs.c b/fs/fs.c
index a314a49b2db7..95813b6089c7 100644
--- a/fs/fs.c
+++ b/fs/fs.c
@@ -756,7 +756,7 @@ int register_fs_driver(struct fs_driver_d *fsdrv)
 }
 EXPORT_SYMBOL(register_fs_driver);
 
-static const char *detect_fs(const char *filename, const char *fsoptions)
+const char *fs_detect(const char *filename, const char *fsoptions)
 {
 	enum filetype type;
 	struct driver_d *drv;
@@ -2980,7 +2980,7 @@ int mount(const char *device, const char *fsname, const char *pathname,
 			device, pathname, fsname, fsoptions);
 
 	if (!fsname)
-		fsname = detect_fs(device, fsoptions);
+		fsname = fs_detect(device, fsoptions);
 
 	if (!fsname) {
 		ret = -ENOENT;
diff --git a/include/fs.h b/include/fs.h
index 9ea522dc2cc3..b501db38addd 100644
--- a/include/fs.h
+++ b/include/fs.h
@@ -179,4 +179,6 @@ static inline const char *devpath_to_name(const char *devpath)
 	return devpath;
 }
 
+const char *fs_detect(const char *filename, const char *fsoptions);
+
 #endif /* __FS_H */
-- 
2.30.2




             reply	other threads:[~2022-09-30 15:46 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-30 15:40 Ahmad Fatoum [this message]
2022-10-05  6:27 ` 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=20220930154053.752237-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