shithub: lwext4

Download patch

ref: 4624a342d4f3b9d067407596506d517fb1bf6827
parent: c2de0281bf8490efacec1a3009e7a3ba11ed3dbe
author: Sigrid Solveig Haflínudóttir <ftrvxmtrx@gmail.com>
date: Thu Nov 5 08:13:52 EST 2020

no GPL; extend plan9-specific config

--- a/include/plan9/generated/ext4_config.h
+++ b/include/plan9/generated/ext4_config.h
@@ -1,9 +1,8 @@
-#ifndef __plan9_generated_config_h__
-#define __plan9_generated_config_h__
+#ifndef __plan9_generated_ext4_config_h__
+#define __plan9_generated_ext4_config_h__
 
 #include <u.h>
 #include <libc.h>
-#include <stdio.h>
 
 typedef u8int uint8_t;
 typedef u16int uint16_t;
@@ -26,5 +25,21 @@
 #define CONFIG_HAVE_OWN_ASSERT 0
 #define CONFIG_DEBUG_PRINTF 0
 #define CONFIG_DEBUG_ASSERT 1
+
+#define CONFIG_EXT4_MAX_BLOCKDEV_NAME 128
+#define CONFIG_EXT4_MAX_MP_NAME 128
+
+#define CONFIG_EXT4_BLOCKDEVS_COUNT 32
+#define CONFIG_EXT4_MOUNTPOINTS_COUNT 32
+#define CONFIG_BLOCK_DEV_CACHE_SIZE 1024
+#define CONFIG_JOURNALING_ENABLE 1
+
+/* thanks, but no GNU/GPL */
+#define CONFIG_EXTENTS_ENABLE 0
+#define CONFIG_XATTR_ENABLE 0
+
+#if defined(__amd64__) || defined(__386__)
+#define CONFIG_UNALIGNED_ACCESS 1
+#endif
 
 #endif
--- a/src/mkfile
+++ b/src/mkfile
@@ -1,6 +1,6 @@
 </$objtype/mkfile
 
-CFLAGS=$CFLAGS -p -I../include/plan9 -I../include
+CFLAGS=$CFLAGS -D__$objtype__ -p -I../include/plan9 -I../include
 LIB=liblwext4.a
 
 HFILES=\
@@ -16,7 +16,6 @@
 	../include/ext4_dir.h\
 	../include/ext4_dir_idx.h\
 	../include/ext4_errno.h\
-	../include/ext4_extent.h\
 	../include/ext4_fs.h\
 	../include/ext4_hash.h\
 	../include/ext4_ialloc.h\
@@ -29,9 +28,19 @@
 	../include/ext4_super.h\
 	../include/ext4_trans.h\
 	../include/ext4_types.h\
-	../include/ext4_xattr.h\
 	../include/misc/queue.h\
 	../include/misc/tree.h\
+	../include/plan9/generated/ext4_config.h\
+	../include/plan9/assert.h\
+	../include/plan9/generated\
+	../include/plan9/inttypes.h\
+	../include/plan9/stdarg.h\
+	../include/plan9/stdbool.h\
+	../include/plan9/stddef.h\
+	../include/plan9/stdint.h\
+	../include/plan9/stdio.h\
+	../include/plan9/stdlib.h\
+	../include/plan9/string.h\
 
 UPDATE=\
 	mkfile\
@@ -49,7 +58,6 @@
 	ext4_debug.$O\
 	ext4_dir.$O\
 	ext4_dir_idx.$O\
-	ext4_extent.$O\
 	ext4_fs.$O\
 	ext4_hash.$O\
 	ext4_ialloc.$O\
@@ -59,7 +67,6 @@
 	ext4_mkfs.$O\
 	ext4_super.$O\
 	ext4_trans.$O\
-	ext4_xattr.$O\
 
 default:V: all