summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorPhilipp Zabel <p.zabel@pengutronix.de>2017-06-01 12:37:29 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2017-06-06 09:16:23 +0200
commitf3cd5b1bbcb27108496eb572ae2ff7cd526ddc55 (patch)
tree4a0e5586df03dd50f6190525c5cb71db34128113 /include
parent7bcbc91a5eb2c3fbb3a6d67103ca0ff8fc8e4412 (diff)
downloadbarebox-f3cd5b1bbcb27108496eb572ae2ff7cd526ddc55.tar.gz
barebox-f3cd5b1bbcb27108496eb572ae2ff7cd526ddc55.tar.xz
fs: add cdev_create_loop and cdev_remove_loop for loop mount option
Allow to create a loopback cdev from a file. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Fixed up with: fs: Makefile: Add parseopt to all builds parseopt.h was included to fs.c with commit 9248b, but parseopt.o has a dependency to CONFIG_FS_NFS. Moved parseopt.o to the default build to eliminate build failures. Signed-off-by: Daniel Schultz <d.schultz@phytec.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'include')
-rw-r--r--include/driver.h2
-rw-r--r--include/fs.h1
2 files changed, 3 insertions, 0 deletions
diff --git a/include/driver.h b/include/driver.h
index 1edc1575c8..3d701f2439 100644
--- a/include/driver.h
+++ b/include/driver.h
@@ -473,6 +473,8 @@ struct cdev *lcdev_by_name(const char *filename);
struct cdev *cdev_readlink(struct cdev *cdev);
struct cdev *cdev_by_device_node(struct device_node *node);
struct cdev *cdev_open(const char *name, unsigned long flags);
+struct cdev *cdev_create_loop(const char *path, ulong flags);
+void cdev_remove_loop(struct cdev *cdev);
int cdev_do_open(struct cdev *, unsigned long flags);
void cdev_close(struct cdev *cdev);
int cdev_flush(struct cdev *cdev);
diff --git a/include/fs.h b/include/fs.h
index 6a592893a9..1b40ff55fe 100644
--- a/include/fs.h
+++ b/include/fs.h
@@ -92,6 +92,7 @@ struct fs_device_d {
struct fs_driver_d *driver;
struct cdev *cdev;
+ bool loop;
char *path;
struct device_d *parent_device;
struct list_head list;