shithub: lwext4

Download patch

ref: 6f29a7eab37d41058924c6e60bb91d74bf91018d
parent: dee6a10ab37fef64f47ddfadeae02a9449fb9294
author: gkostka <kostka.grzegorz@gmail.com>
date: Sat May 20 05:35:40 EDT 2017

ext4_config: add defines allowing disabling xattr and extent modules

--- a/include/ext4_config.h
+++ b/include/ext4_config.h
@@ -88,6 +88,16 @@
 #define CONFIG_JOURNALING_ENABLE 1
 #endif
 
+/**@brief  Enable/disable xattr*/
+#ifndef CONFIG_XATTR_ENABLE
+#define CONFIG_XATTR_ENABLE 1
+#endif
+
+/**@brief  Enable/disable extents*/
+#ifndef CONFIG_EXTENTS_ENABLE
+#define CONFIG_EXTENTS_ENABLE 1
+#endif
+
 /**@brief   Include error codes from ext4_errno or standard library.*/
 #ifndef CONFIG_HAVE_OWN_ERRNO
 #define CONFIG_HAVE_OWN_ERRNO 0
--- a/include/ext4_extent.h
+++ b/include/ext4_extent.h
@@ -1,7 +1,6 @@
 /*
  * Copyright (c) 2013 Grzegorz Kostka (kostka.grzegorz@gmail.com)
  *
- *
  * HelenOS:
  * Copyright (c) 2012 Martin Sucha
  * Copyright (c) 2012 Frantisek Princ
--- a/src/ext4_extent.c
+++ b/src/ext4_extent.c
@@ -27,6 +27,7 @@
 #include <inttypes.h>
 #include <stddef.h>
 
+#if CONFIG_EXTENTS_ENABLE
 /*
  * used by extent splitting.
  */
@@ -2136,3 +2137,4 @@
 
 	return err;
 }
+#endif
--- a/src/ext4_xattr.c
+++ b/src/ext4_xattr.c
@@ -35,6 +35,8 @@
 #include <stdlib.h>
 #include <string.h>
 
+#if CONFIG_XATTR_ENABLE
+
 /**
  * @file  ext4_xattr.c
  * @brief Extended Attribute Manipulation
@@ -1554,6 +1556,8 @@
 out:
 	return ret;
 }
+
+#endif
 
 /**
  * @}