fs: Add support for a directory
Filesystems can have a number of directories within them. U-Boot only worries about directories that have been accessed. Add the concept of a directory, with the filesystem as parent. Note that this is not a hierarchical device structure, so UCLASS_DIR devices always have a UCLASS_FS as the parent. Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
21
include/fs.h
21
include/fs.h
@@ -54,6 +54,17 @@ struct fs_ops {
|
||||
* Return 0 if OK, -ENOTCONN if not mounted, other -ve on error
|
||||
*/
|
||||
int (*unmount)(struct udevice *dev);
|
||||
|
||||
/**
|
||||
* lookup_dir() - Look up a directory on a filesystem
|
||||
*
|
||||
* @dev: Filesystem device
|
||||
* @path: Path to look up, empty or "/" for the root
|
||||
* @dirp: Returns associated directory device, creating if necessary
|
||||
* Return 0 if OK, -ENOENT, other -ve on error
|
||||
*/
|
||||
int (*lookup_dir)(struct udevice *dev, const char *path,
|
||||
struct udevice **dirp);
|
||||
};
|
||||
|
||||
/* Get access to a filesystem's operations */
|
||||
@@ -75,4 +86,14 @@ int fs_mount(struct udevice *dev);
|
||||
*/
|
||||
int fs_unmount(struct udevice *dev);
|
||||
|
||||
/**
|
||||
* fs_lookup_dir() - Look up a directory on a filesystem
|
||||
*
|
||||
* @dev: Filesystem device
|
||||
* @path: Path to look up, empty or "/" for the root
|
||||
* @dirp: Returns associated directory device, creating if necessary
|
||||
* Return 0 if OK, -ENOENT, other -ve on error
|
||||
*/
|
||||
int fs_lookup_dir(struct udevice *dev, const char *path, struct udevice **dirp);
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user