shithub: lwext4

Download patch

ref: bf878b59ccb34a4cdafa48dbcdcd57c22f335c03
parent: fbafe5ad58ac4e2b9c3997934ea9e4b0115fa4b3
author: Sigrid Solveig Haflínudóttir <[email protected]>
date: Sat Nov 14 22:28:04 EST 2020

size_t to uvlong

--- a/include/ext4.h
+++ b/include/ext4.h
@@ -403,7 +403,7 @@
  *
  * @param path    Parh to file/dir/link.
  * @param type    Inode type.
- *                @ref EXT4_DIRENTRY_UNKNOWN
+ *                @ref EXT4_DE_UNKNOWN
  *                @ref EXT4_DE_REG_FILE
  *                @ref EXT4_DE_DIR
  *                @ref EXT4_DE_CHRDEV
--- a/include/ext4_inode.h
+++ b/include/ext4_inode.h
@@ -137,6 +137,12 @@
  */
 uint32_t ext4_inode_get_del_time(struct ext4_inode *inode);
 
+/**@brief Get time, when i-node was created.
+ * @param inode I-node
+ * @return Time of the create action (POSIX)
+ */
+uint32_t ext4_inode_get_creation_time(struct ext4_inode *inode);
+
 /**@brief Set time, when i-node was deleted.
  * @param inode I-node
  * @param time  Time of the delete action (POSIX)
--- a/include/plan9/generated/ext4_config.h
+++ b/include/plan9/generated/ext4_config.h
@@ -12,7 +12,7 @@
 typedef s32int int32_t;
 typedef s64int int64_t;
 
-typedef ulong size_t;
+typedef uintptr size_t;
 typedef uintptr ptrdiff_t;
 
 typedef enum { false, true } bool;
--- a/src/ext4_bcache.c
+++ b/src/ext4_bcache.c
@@ -274,7 +274,8 @@
 	ext4_assert(bc && b);
 
 	/*Check if valid.*/
-	ext4_assert(b->lb_id);
+	if (!b->lb_id)
+	    return EINVAL;
 
 	/*Block should have a valid pointer to ext4_buf.*/
 	ext4_assert(buf);
--- a/src/ext4_inode.c
+++ b/src/ext4_inode.c
@@ -173,6 +173,11 @@
 	inode->deletion_time = to_le32(time);
 }
 
+uint32_t ext4_inode_get_creation_time(struct ext4_inode *inode)
+{
+	return to_le32(inode->crtime);
+}
+
 uint32_t ext4_inode_get_gid(struct ext4_inode *inode)
 {
 	return to_le32(inode->gid);