9
0
Fork 0

fs: Add function to get cdev by mountpath

This is useful to know for the bootloader spec implementation.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This commit is contained in:
Sascha Hauer 2013-11-01 09:33:17 +01:00
parent d85c580eeb
commit b7a66554dc
2 changed files with 15 additions and 0 deletions

13
fs/fs.c
View File

@ -283,6 +283,19 @@ static struct fs_device_d *get_fsdevice_by_path(const char *path)
return fs_dev_root;
}
/*
* get_cdev_by_mountpath - return the cdev the given path
* is mounted on
*/
struct cdev *get_cdev_by_mountpath(const char *path)
{
struct fs_device_d *fsdev;
fsdev = get_fsdevice_by_path(path);
return fsdev->cdev;
}
char *get_mounted_path(const char *path)
{
struct fs_device_d *fdev;

View File

@ -184,6 +184,8 @@ char *normalise_link(const char *pathname, const char* symlink);
char *get_mounted_path(const char *path);
struct cdev *get_cdev_by_mountpath(const char *path);
/* Register a new filesystem driver */
int register_fs_driver(struct fs_driver_d *fsdrv);