7 -#include <asm/types.h>
8 #include <linux/jffs2.h>
17 -#include <asm/types.h>
18 #include <linux/jffs2.h>
23 @@ -94,8 +94,7 @@ static inline struct page * rb_insert_pa
24 #ifndef _LINUX_RBTREE_H
25 #define _LINUX_RBTREE_H
27 -#include <linux/kernel.h>
28 -#include <linux/stddef.h>
33 --- a/include/mtd/ubi-media.h
34 +++ b/include/mtd/ubi-media.h
36 #ifndef __UBI_MEDIA_H__
37 #define __UBI_MEDIA_H__
40 #include <asm/byteorder.h>
43 +typedef uint8_t __u8;
44 +typedef uint16_t __be16;
45 +typedef uint32_t __be32;
46 +typedef uint64_t __be64;
49 /* The version of UBI images supported by this implementation */
51 --- a/mkfs.ubifs/mkfs.ubifs.h
52 +++ b/mkfs.ubifs/mkfs.ubifs.h
56 #include <linux/types.h>
59 +# if defined(__x86_64__) && defined(__ILP32__)
60 +# define llseek lseek64
64 +# define O_LARGEFILE 0
66 +# define llseek lseek
70 #include <sys/types.h>
71 --- a/mkfs.ubifs/mkfs.ubifs.c
72 +++ b/mkfs.ubifs/mkfs.ubifs.c
73 @@ -1010,6 +1010,7 @@ static int add_inode_with_data(struct st
75 if (c->default_compr != UBIFS_COMPR_NONE)
76 use_flags |= UBIFS_COMPR_FL;
77 +#ifndef NO_NATIVE_SUPPORT
78 if (flags & FS_COMPR_FL)
79 use_flags |= UBIFS_COMPR_FL;
80 if (flags & FS_SYNC_FL)
81 @@ -1020,6 +1021,7 @@ static int add_inode_with_data(struct st
82 use_flags |= UBIFS_APPEND_FL;
83 if (flags & FS_DIRSYNC_FL && S_ISDIR(st->st_mode))
84 use_flags |= UBIFS_DIRSYNC_FL;
87 memset(ino, 0, UBIFS_INO_NODE_SZ);
89 @@ -1089,7 +1091,9 @@ static int add_dir_inode(DIR *dir, ino_t
92 return sys_err_msg("dirfd failed");
93 +#ifndef NO_NATIVE_SUPPORT
94 if (ioctl(fd, FS_IOC_GETFLAGS, &flags) == -1)
99 @@ -1274,10 +1278,12 @@ static int add_file(const char *path_nam
100 key_write(&key, &dn->key);
101 dn->size = cpu_to_le32(bytes_read);
102 out_len = NODE_BUFFER_SIZE - UBIFS_DATA_NODE_SZ;
103 +#ifndef NO_NATIVE_SUPPORT
104 if (c->default_compr == UBIFS_COMPR_NONE &&
105 (flags & FS_COMPR_FL))
106 use_compr = UBIFS_COMPR_LZO;
109 use_compr = c->default_compr;
110 compr_type = compress_data(buf, bytes_read, &dn->data,
111 &out_len, use_compr);
112 @@ -1319,7 +1325,9 @@ static int add_non_dir(const char *path_
114 return sys_err_msg("failed to open file '%s'",
116 +#ifndef NO_NATIVE_SUPPORT
117 if (ioctl(fd, FS_IOC_GETFLAGS, &flags) == -1)
121 return sys_err_msg("failed to close file '%s'",
122 --- a/mkfs.ubifs/devtable.c
123 +++ b/mkfs.ubifs/devtable.c
124 @@ -134,6 +134,7 @@ static int interpret_table_entry(const c
125 unsigned int mode = 0755, uid = 0, gid = 0, major = 0, minor = 0;
126 unsigned int start = 0, increment = 0, count = 0;
129 if (sscanf(line, "%1023s %c %o %u %u %u %u %u %u %u",
130 buf, &type, &mode, &uid, &gid, &major, &minor,
131 &start, &increment, &count) < 0)
132 @@ -144,8 +145,8 @@ static int interpret_table_entry(const c
133 buf, type, mode, uid, gid, major, minor, start,
136 - len = strnlen(buf, 1024);
140 return err_msg("too long path");
142 if (!strcmp(buf, "/"))
143 --- a/include/common.h
144 +++ b/include/common.h
149 -#include <features.h>
150 #include <inttypes.h>
153 --- a/include/mtd/ubifs-media.h
154 +++ b/include/mtd/ubifs-media.h
156 #ifndef __UBIFS_MEDIA_H__
157 #define __UBIFS_MEDIA_H__
160 #include <asm/byteorder.h>
163 +typedef uint8_t __u8;
164 +typedef uint16_t __be16;
165 +typedef uint32_t __be32;
166 +typedef uint64_t __be64;
169 /* UBIFS node magic number (must not have the padding byte first or last) */
170 #define UBIFS_NODE_MAGIC 0x06101831