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 @@ -131,7 +130,9 @@ static inline void rb_set_color(struct r
35 #define RB_ROOT (struct rb_root) { NULL, }
38 #define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
41 #define container_of(ptr, type, member) ({ \
42 const typeof( ((type *)0)->member ) *__mptr = (ptr); \
43 --- a/include/mtd/ubi-media.h
44 +++ b/include/mtd/ubi-media.h
46 #ifndef __UBI_MEDIA_H__
47 #define __UBI_MEDIA_H__
50 #include <asm/byteorder.h>
53 +typedef uint8_t __u8;
54 +typedef uint16_t __be16;
55 +typedef uint32_t __be32;
56 +typedef uint64_t __be64;
59 /* The version of UBI images supported by this implementation */
61 --- a/mkfs.ubifs/mkfs.ubifs.h
62 +++ b/mkfs.ubifs/mkfs.ubifs.h
66 #include <linux/types.h>
71 +# define O_LARGEFILE 0
73 +# define llseek lseek
77 #include <sys/types.h>
78 --- a/mkfs.ubifs/mkfs.ubifs.c
79 +++ b/mkfs.ubifs/mkfs.ubifs.c
80 @@ -773,8 +773,8 @@ int write_leb(int lnum, int len, void *b
81 if (ubi_leb_change_start(ubi, out_fd, lnum, c->leb_size, dtype))
82 return sys_err_msg("ubi_leb_change_start failed");
84 - if (lseek64(out_fd, pos, SEEK_SET) != pos)
85 - return sys_err_msg("lseek64 failed seeking %lld",
86 + if (llseek(out_fd, pos, SEEK_SET) != pos)
87 + return sys_err_msg("llseek failed seeking %lld",
90 if (write(out_fd, buf, c->leb_size) != c->leb_size)
91 @@ -1029,6 +1029,7 @@ static int add_inode_with_data(struct st
93 if (c->default_compr != UBIFS_COMPR_NONE)
94 use_flags |= UBIFS_COMPR_FL;
95 +#ifndef NO_NATIVE_SUPPORT
96 if (flags & FS_COMPR_FL)
97 use_flags |= UBIFS_COMPR_FL;
98 if (flags & FS_SYNC_FL)
99 @@ -1039,6 +1040,7 @@ static int add_inode_with_data(struct st
100 use_flags |= UBIFS_APPEND_FL;
101 if (flags & FS_DIRSYNC_FL && S_ISDIR(st->st_mode))
102 use_flags |= UBIFS_DIRSYNC_FL;
105 memset(ino, 0, UBIFS_INO_NODE_SZ);
107 @@ -1108,7 +1110,9 @@ static int add_dir_inode(DIR *dir, ino_t
110 return sys_err_msg("dirfd failed");
111 +#ifndef NO_NATIVE_SUPPORT
112 if (ioctl(fd, FS_IOC_GETFLAGS, &flags) == -1)
117 @@ -1293,10 +1297,12 @@ static int add_file(const char *path_nam
118 key_write(&key, &dn->key);
119 dn->size = cpu_to_le32(bytes_read);
120 out_len = NODE_BUFFER_SIZE - UBIFS_DATA_NODE_SZ;
121 +#ifndef NO_NATIVE_SUPPORT
122 if (c->default_compr == UBIFS_COMPR_NONE &&
123 (flags & FS_COMPR_FL))
124 use_compr = UBIFS_COMPR_LZO;
127 use_compr = c->default_compr;
128 compr_type = compress_data(buf, bytes_read, &dn->data,
129 &out_len, use_compr);
130 @@ -1338,7 +1344,9 @@ static int add_non_dir(const char *path_
132 return sys_err_msg("failed to open file '%s'",
134 +#ifndef NO_NATIVE_SUPPORT
135 if (ioctl(fd, FS_IOC_GETFLAGS, &flags) == -1)
139 return sys_err_msg("failed to close file '%s'",
140 --- a/mkfs.ubifs/devtable.c
141 +++ b/mkfs.ubifs/devtable.c
142 @@ -134,6 +134,7 @@ static int interpret_table_entry(const c
143 unsigned int mode = 0755, uid = 0, gid = 0, major = 0, minor = 0;
144 unsigned int start = 0, increment = 0, count = 0;
147 if (sscanf(line, "%1023s %c %o %u %u %u %u %u %u %u",
148 buf, &type, &mode, &uid, &gid, &major, &minor,
149 &start, &increment, &count) < 0)
150 @@ -144,8 +145,8 @@ static int interpret_table_entry(const c
151 buf, type, mode, uid, gid, major, minor, start,
154 - len = strnlen(buf, 1024);
158 return err_msg("too long path");
160 if (!strcmp(buf, "/"))