summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorKaho Ng <ngkaho1234@gmail.com>2016-06-30 05:17:33 +0800
committerKaho Ng <ngkaho1234@gmail.com>2016-06-30 05:40:06 +0800
commit0ac15f45592212176fb388cd51995c6cc53950ed (patch)
tree4cc4aeac7bbfcffa37fb22db1d0313f8ff482c2d /include
parenta84a1b68d698d9a5cfa5efd55b057df7724996b2 (diff)
ext4: special inode creation support
Diffstat (limited to 'include')
-rw-r--r--include/ext4.h8
-rw-r--r--include/ext4_inode.h12
2 files changed, 20 insertions, 0 deletions
diff --git a/include/ext4.h b/include/ext4.h
index fede38f..b1c7a61 100644
--- a/include/ext4.h
+++ b/include/ext4.h
@@ -373,6 +373,14 @@ int ext4_file_set_ctime(const char *path, uint32_t ctime);
* @return standard error code*/
int ext4_fsymlink(const char *target, const char *path);
+/**@brief Create special file
+ * @param path path to new file
+ * @param filetype The filetype of the new special file
+ * (that must not be regular file, directory, or unknown type)
+ * @param dev if filetype is char device or block device,
+ * the device number will become the payload in the inode
+ * @return standard error code*/
+int ext4_mknod(const char *path, int filetype, uint32_t dev);
/**@brief Read symbolic link payload
* @param path to symlink
diff --git a/include/ext4_inode.h b/include/ext4_inode.h
index 9498f0a..e0ca6e3 100644
--- a/include/ext4_inode.h
+++ b/include/ext4_inode.h
@@ -267,6 +267,18 @@ uint32_t ext4_inode_get_indirect_block(struct ext4_inode *inode, uint32_t idx);
void ext4_inode_set_indirect_block(struct ext4_inode *inode, uint32_t idx,
uint32_t block);
+/**@brief Get device number
+ * @param inode I-node to get device number from
+ * @return Device number
+ */
+uint32_t ext4_inode_get_dev(struct ext4_inode *inode);
+
+/**@brief Set device number
+ * @param inode I-node to set device number to
+ * @param dev Device number
+ */
+void ext4_inode_set_dev(struct ext4_inode *inode, uint32_t dev);
+
/**@brief return the type of i-node
* @param sb Superblock
* @param inode I-node to return the type of