ext4_journal: journal write skeleton code.
[lwext4.git] / lwext4 / ext4.h
index a09d0cc359223ee2f4e7d8568bffade8939a1fa9..208ddb9a99b916b0529739e73f59c798d090e361 100644 (file)
@@ -38,9 +38,9 @@
 #ifndef EXT4_H_
 #define EXT4_H_
 
-#include "ext4_config.h"
-#include "ext4_types.h"
-#include "ext4_blockdev.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
 
 #include <stdint.h>
 #include <stddef.h>
 
 #else
  #include <unistd.h>
+ #include <fcntl.h>
 #endif
 
+#include "ext4_config.h"
+#include "ext4_types.h"
+#include "ext4_blockdev.h"
+
 /********************************OS LOCK INFERFACE***************************/
 
 /**@brief   OS dependent lock interface.*/
@@ -177,6 +182,13 @@ int ext4_mount(const char *dev_name, const char *mount_point);
  * @return  standard error code */
 int ext4_umount(const char *mount_point);
 
+
+/**@brief   Journal recovery.
+ * @param   mount_point mount point
+ * @warning Must be called after @ref ext4_mount
+ * @return standard error code */
+int ext4_recover(const char *mount_point);
+
 /**@brief   Some of the filesystem stats.*/
 struct ext4_mount_stats {
        uint32_t inodes_count;
@@ -306,8 +318,7 @@ int ext4_fclose(ext4_file *f);
  * @param   ret_ino the inode id of the path
  * @param   ext4_inode buffer
  * @return  standard error code*/
-int ext4_fill_raw_inode(const char *path,
-                       uint32_t *ret_ino,
+int ext4_fill_raw_inode(const char *path, uint32_t *ret_ino,
                        struct ext4_inode *inode);
 
 /**@brief   File truncate function.
@@ -362,6 +373,14 @@ int ext4_fsymlink(const char *target, const char *path);
 
 int ext4_readlink(const char *path, char *buf, size_t bufsize, size_t *rcnt);
 
+int ext4_setxattr(const char *path, const char *name, size_t name_len,
+                 const void *data, size_t data_size, bool replace);
+int ext4_getxattr(const char *path, const char *name, size_t name_len,
+                 void *buf, size_t buf_size, size_t *data_size);
+int ext4_listxattr(const char *path, char *list, size_t size, size_t *ret_size);
+int ext4_removexattr(const char *path, const char *name, size_t name_len);
+
+
 /*********************************DIRECTORY OPERATION***********************/
 
 /**@brief   Recursive directory remove.
@@ -395,6 +414,10 @@ const ext4_direntry *ext4_dir_entry_next(ext4_dir *d);
  * @param   d directory handle*/
 void ext4_dir_entry_rewind(ext4_dir *d);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* EXT4_H_ */
 
 /**