summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorgkostka <kostka.grzegorz@gmail.com>2017-02-17 00:54:06 +0100
committergkostka <kostka.grzegorz@gmail.com>2017-02-17 00:54:06 +0100
commit406d9c3c653b53f4202f0de3f9b3e8a0a1eec70c (patch)
tree199dbea7d56001d3e6cf297d77204e2f31b65789 /include
parentec5adbc6757768592da6917a07f6bc1c588ad2f8 (diff)
ext4: add block device unregister by name & all methods
Diffstat (limited to 'include')
-rw-r--r--include/ext4.h33
-rw-r--r--include/ext4_config.h12
2 files changed, 35 insertions, 10 deletions
diff --git a/include/ext4.h b/include/ext4.h
index ec74689..41b2eae 100644
--- a/include/ext4.h
+++ b/include/ext4.h
@@ -108,25 +108,38 @@ typedef struct ext4_dir {
/********************************MOUNT OPERATIONS****************************/
-/**@brief Register a block device to a name.
- * @warning Block device has to be filled by
- * Block cache may by created automatically when bc parameter is NULL.
- * @param bd block device
- * @param bd block device cache
- * @param dev_name register name
- * @param standard error code*/
+/**@brief Register block device.
+ *
+ * @param bd Block device.
+ * @param bd Block device cache.
+ * @param dev_name Block device name.
+ *
+ * @return Standard error code.*/
int ext4_device_register(struct ext4_blockdev *bd, struct ext4_bcache *bc,
const char *dev_name);
+/**@brief Un-register block device.
+ *
+ * @param dev_name Block device name.
+ *
+ * @return Standard error code.*/
+int ext4_device_unregister(const char *dev_name);
+
+/**@brief Un-register all block devices.
+ *
+ * @return Standard error code.*/
+int ext4_device_unregister_all(void);
+
/**@brief Mount a block device with EXT4 partition to the mount point.
- * @param dev_name block device name (@ref ext4_device_register)
- * @param mount_point mount point, for example
+ *
+ * @param dev_name block Device name (@ref ext4_device_register).
+ * @param mount_point Mount point, for example:
* - /
* - /my_partition/
* - /my_second_partition/
* @param read_only mount as read-only mode.
*
- * @return standard error code */
+ * @return Standard error code */
int ext4_mount(const char *dev_name,
const char *mount_point,
bool read_only);
diff --git a/include/ext4_config.h b/include/ext4_config.h
index f42b6fc..8b8c6d8 100644
--- a/include/ext4_config.h
+++ b/include/ext4_config.h
@@ -123,11 +123,23 @@ extern "C" {
#define CONFIG_BLOCK_DEV_CACHE_SIZE 8
#endif
+
+/**@brief Maximum block device name*/
+#ifndef CONFIG_EXT4_MAX_BLOCKDEV_NAME
+#define CONFIG_EXT4_MAX_BLOCKDEV_NAME 32
+#endif
+
+
/**@brief Maximum block device count*/
#ifndef CONFIG_EXT4_BLOCKDEVS_COUNT
#define CONFIG_EXT4_BLOCKDEVS_COUNT 2
#endif
+/**@brief Maximum mountpoint name*/
+#ifndef CONFIG_EXT4_MAX_MP_NAME
+#define CONFIG_EXT4_MAX_MP_NAME 32
+#endif
+
/**@brief Maximum mountpoint count*/
#ifndef CONFIG_EXT4_MOUNTPOINTS_COUNT
#define CONFIG_EXT4_MOUNTPOINTS_COUNT 2