#include <linux/jffs2.h>
#include "common.h"
#include "compr.h"
---- a/jffsX-utils/rbtree.h
-+++ b/jffsX-utils/rbtree.h
+--- a/include/rbtree.h
++++ b/include/rbtree.h
@@ -94,8 +94,7 @@ static inline struct page * rb_insert_pa
#ifndef _LINUX_RBTREE_H
#define _LINUX_RBTREE_H
#include <sys/types.h>
--- a/ubifs-utils/mkfs.ubifs/mkfs.ubifs.c
+++ b/ubifs-utils/mkfs.ubifs/mkfs.ubifs.c
-@@ -1554,6 +1554,7 @@ static int add_inode(struct stat *st, in
+@@ -1568,6 +1568,7 @@ static int add_inode(struct stat *st, in
if (c->default_compr != UBIFS_COMPR_NONE)
use_flags |= UBIFS_COMPR_FL;
if (flags & FS_COMPR_FL)
use_flags |= UBIFS_COMPR_FL;
if (flags & FS_SYNC_FL)
-@@ -1566,6 +1567,7 @@ static int add_inode(struct stat *st, in
+@@ -1580,6 +1581,7 @@ static int add_inode(struct stat *st, in
use_flags |= UBIFS_DIRSYNC_FL;
if (fctx)
use_flags |= UBIFS_CRYPT_FL;
memset(ino, 0, UBIFS_INO_NODE_SZ);
ino_key_init(&key, inum);
-@@ -1651,7 +1653,9 @@ static int add_dir_inode(const char *pat
+@@ -1665,7 +1667,9 @@ static int add_dir_inode(const char *pat
fd = dirfd(dir);
if (fd == -1)
return sys_err_msg("dirfd failed");
flags = 0;
}
-@@ -1862,6 +1866,7 @@ static int add_file(const char *path_nam
+@@ -1878,6 +1882,7 @@ static int add_file(const char *path_nam
dn->ch.node_type = UBIFS_DATA_NODE;
key_write(&key, &dn->key);
out_len = NODE_BUFFER_SIZE - UBIFS_DATA_NODE_SZ;
if (c->default_compr == UBIFS_COMPR_NONE &&
!c->encrypted && (flags & FS_COMPR_FL))
#ifdef WITH_LZO
-@@ -1872,6 +1877,7 @@ static int add_file(const char *path_nam
+@@ -1888,6 +1893,7 @@ static int add_file(const char *path_nam
use_compr = UBIFS_COMPR_NONE;
#endif
else
use_compr = c->default_compr;
compr_type = compress_data(buf, bytes_read, &dn->data,
&out_len, use_compr);
-@@ -1931,7 +1937,9 @@ static int add_non_dir(const char *path_
+@@ -1947,7 +1953,9 @@ static int add_non_dir(const char *path_
if (fd == -1)
return sys_err_msg("failed to open file '%s'",
path_name);
--- a/jffsX-utils/Makemodule.am
+++ b/jffsX-utils/Makemodule.am
-@@ -10,8 +10,9 @@ mkfs_jffs2_SOURCES = \
- jffsX-utils/summary.h \
- include/linux/jffs2.h \
- include/mtd/jffs2-user.h
+@@ -9,8 +9,9 @@ mkfs_jffs2_SOURCES = \
+ include/mtd/jffs2-user.h \
+ include/list.h \
+ include/rbtree.h
+
mkfs_jffs2_LDADD = libmtd.a $(ZLIB_LIBS) $(LZO_LIBS)
-mkfs_jffs2_CPPFLAGS = $(AM_CPPFLAGS) $(ZLIB_CFLAGS) $(LZO_CFLAGS)
jffs2reader_SOURCES = jffsX-utils/jffs2reader.c include/mtd/jffs2-user.h
jffs2reader_LDADD = libmtd.a $(ZLIB_LIBS) $(LZO_LIBS)
-@@ -33,6 +34,14 @@ if WITH_ZLIB
+@@ -32,6 +33,14 @@ if WITH_ZLIB
mkfs_jffs2_SOURCES += jffsX-utils/compr_zlib.c
endif
dist_man1_MANS += jffsX-utils/mkfs.jffs2.1
--- a/jffsX-utils/compr.c
+++ b/jffsX-utils/compr.c
-@@ -520,6 +520,9 @@ int jffs2_compressors_init(void)
+@@ -471,6 +471,9 @@ int jffs2_compressors_init(void)
#ifdef WITH_LZO
jffs2_lzo_init();
#endif
return 0;
}
-@@ -534,5 +537,8 @@ int jffs2_compressors_exit(void)
+@@ -485,5 +488,8 @@ int jffs2_compressors_exit(void)
#ifdef WITH_LZO
jffs2_lzo_exit();
#endif
}
--- a/jffsX-utils/compr.h
+++ b/jffsX-utils/compr.h
-@@ -21,8 +21,9 @@
+@@ -22,8 +22,9 @@
#define JFFS2_RUBINMIPS_PRIORITY 10
#define JFFS2_DYNRUBIN_PRIORITY 20
#define JFFS2_RTIME_PRIORITY 50
#define JFFS2_COMPR_MODE_NONE 0
#define JFFS2_COMPR_MODE_PRIORITY 1
-@@ -113,5 +114,10 @@ void jffs2_rtime_exit(void);
+@@ -110,5 +111,10 @@ void jffs2_rtime_exit(void);
int jffs2_lzo_init(void);
void jffs2_lzo_exit(void);
#endif
AC_ARG_WITH([selinux],
[AS_HELP_STRING([--with-selinux],
[Support for selinux extended attributes])],
-@@ -268,6 +272,7 @@ fi
+@@ -269,6 +273,7 @@ fi
AM_CONDITIONAL([WITH_LZO], [test "x$with_lzo" = "xyes"])
AM_CONDITIONAL([WITH_ZLIB], [test "x$with_zlib" = "xyes"])
AM_CONDITIONAL([WITH_ZSTD], [test "x$with_zstd" = "xyes"])
AM_CONDITIONAL([WITH_XATTR], [test "x$with_xattr" = "xyes"])
AM_CONDITIONAL([WITH_SELINUX], [test "x$with_selinux" = "xyes"])
AM_CONDITIONAL([WITH_CRYPTO], [test "x$with_crypto" = "xyes"])
-@@ -312,6 +317,7 @@ AC_MSG_RESULT([
+@@ -313,6 +318,7 @@ AC_MSG_RESULT([
lzo support: ${with_lzo}
zlib support: ${with_zlib}
zstd support: ${with_zstd}