summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorFranck Jullien <franck.jullien@gmail.com>2011-11-09 12:29:21 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2011-11-11 12:13:34 +0100
commit84b222987eea1a57308732c47a3006fecd6c8219 (patch)
tree1844500fc7f6977cd363bd0531ace9ec3c91afd8 /fs
parent21d6ca209275a5f8449524658991c8ed99b88d08 (diff)
downloadbarebox-84b222987eea1a57308732c47a3006fecd6c8219.tar.gz
barebox-84b222987eea1a57308732c47a3006fecd6c8219.tar.xz
mount: Fix the printing of device name
Mount without argument always print a "none" as device name mounted because entry->parent_device is always NULL. The problem is the mount function in fs/fs.c. parent_device is initialized to NULL and never updated. With this patch, parent_device is set with the mounted device name. Moreover, the mount function has been modified to print the device name plus device id using the dev_name function. Signed-off-by: Franck Jullien <franck.jullien@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'fs')
-rw-r--r--fs/fs.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/fs/fs.c b/fs/fs.c
index 56b822b6a0..13df71c923 100644
--- a/fs/fs.c
+++ b/fs/fs.c
@@ -743,6 +743,7 @@ int mount(const char *device, const char *fsname, const char *_path)
struct mtab_entry *entry;
struct fs_device_d *fsdev;
struct device_d *dev, *parent_device = NULL;
+ struct cdev *cdev = NULL;
int ret;
char *path = normalise_path(_path);
@@ -808,6 +809,12 @@ int mount(const char *device, const char *fsname, const char *_path)
goto out2;
}
+ if (!strncmp(device, "/dev/", 5)) {
+ cdev = cdev_by_name(device + 5);
+ if(cdev)
+ parent_device = cdev->dev;
+ }
+
if (parent_device)
dev_add_child(parent_device, &fsdev->dev);