From: Simon Glass <sjg@chromium.org>
The name for this comes from the devicetree node. The 'fs' name is to
generic, so rename it to 'hostfs'.
Signed-off-by: Simon Glass <sjg@chromium.org>
---
arch/sandbox/dts/test.dts | 2 +-
fs/sandbox/sandboxfs.c | 5 +++++
test/dm/fs.c | 6 +++---
3 files changed, 9 insertions(+), 4 deletions(-)
@@ -589,7 +589,7 @@
compatible = "denx,u-boot-devres-test";
};
- fs {
+ hostfs {
compatible = "sandbox,fs";
};
@@ -179,10 +179,15 @@ int fs_write_sandbox(const char *filename, void *buf, loff_t offset,
static int sandbox_fs_mount(struct udevice *dev)
{
struct fs_priv *uc_priv = dev_get_uclass_priv(dev);
+ struct fs_plat *plat = dev_get_uclass_plat(dev);
if (uc_priv->mounted)
return log_msg_ret("vfi", -EISCONN);
+ /* Reject block-device mounts - sandboxfs uses the host OS */
+ if (plat->desc)
+ return log_msg_ret("vfb", -ENODEV);
+
uc_priv->mounted = true;
return 0;
@@ -46,7 +46,7 @@ static int dm_test_fs_dir(struct unit_test_state *uts)
ut_asserteq(-ENOENT, fs_lookup_dir(fsdev, "does-not-exit", &dir));
ut_assertok(fs_lookup_dir(fsdev, "", &dir));
ut_assertnonnull(dir);
- ut_asserteq_str("fs.dir", dir->name);
+ ut_asserteq_str("hostfs.dir", dir->name);
ut_assertok(dir_open(dir, &strm));
found = 0;
@@ -81,12 +81,12 @@ static int dm_test_fs_file(struct unit_test_state *uts)
ut_assertok(fs_lookup_dir(fsdev, "", &dir));
ut_assertnonnull(dir);
- ut_asserteq_str("fs.dir", dir->name);
+ ut_asserteq_str("hostfs.dir", dir->name);
/* check the start and end of the README, which perhaps won't change */
ut_assertok(dir_open_file(dir, "README", DIR_O_RDONLY, &fil));
ut_assertnonnull(fil);
- ut_asserteq_str("fs.dir.file.1", fil->name);
+ ut_asserteq_str("hostfs.dir.file.1", fil->name);
uc_priv = dev_get_uclass_priv(fil);
ut_asserteq_str("README", uc_priv->leaf);
ut_asserteq(0, uc_priv->pos);