perf: fix build on PowerPC
[openwrt/openwrt.git] / tools / mtd-utils / patches / 110-portability.patch
index a2942270d72f4bfff1fa197abaeb261351de86b5..e25fd82bb3c29641455caca655ff07efa3fff0e5 100644 (file)
@@ -70,7 +70,7 @@
  #include <sys/types.h>
 --- a/ubifs-utils/mkfs.ubifs/mkfs.ubifs.c
 +++ b/ubifs-utils/mkfs.ubifs/mkfs.ubifs.c
-@@ -1219,6 +1219,7 @@ static int add_inode(struct stat *st, in
+@@ -1542,6 +1542,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)
-@@ -1229,6 +1230,7 @@ static int add_inode(struct stat *st, in
-               use_flags |= UBIFS_APPEND_FL;
-       if (flags & FS_DIRSYNC_FL && S_ISDIR(st->st_mode))
+@@ -1554,6 +1555,7 @@ static int add_inode(struct stat *st, in
                use_flags |= UBIFS_DIRSYNC_FL;
+       if (fctx)
+               use_flags |= UBIFS_CRYPT_FL;
 +#endif
        memset(ino, 0, UBIFS_INO_NODE_SZ);
  
-@@ -1293,7 +1295,9 @@ static int add_dir_inode(const char *pat
+       ino_key_init(&key, inum);
+@@ -1639,7 +1641,9 @@ static int add_dir_inode(const char *pat
                fd = dirfd(dir);
                if (fd == -1)
                        return sys_err_msg("dirfd failed");
                        flags = 0;
        }
  
-@@ -1476,6 +1480,7 @@ static int add_file(const char *path_nam
+@@ -1850,6 +1854,7 @@ static int add_file(const char *path_nam
+               dn->ch.node_type = UBIFS_DATA_NODE;
                key_write(&key, &dn->key);
-               dn->size = cpu_to_le32(bytes_read);
                out_len = NODE_BUFFER_SIZE - UBIFS_DATA_NODE_SZ;
 +#ifndef NO_NATIVE_SUPPORT
                if (c->default_compr == UBIFS_COMPR_NONE &&
-                   (flags & FS_COMPR_FL))
+                   !c->encrypted && (flags & FS_COMPR_FL))
  #ifdef WITHOUT_LZO
-@@ -1484,6 +1489,7 @@ static int add_file(const char *path_nam
+@@ -1858,6 +1863,7 @@ static int add_file(const char *path_nam
                        use_compr = UBIFS_COMPR_LZO;
  #endif
                else
                        use_compr = c->default_compr;
                compr_type = compress_data(buf, bytes_read, &dn->data,
                                           &out_len, use_compr);
-@@ -1527,7 +1533,9 @@ static int add_non_dir(const char *path_
+@@ -1917,7 +1923,9 @@ static int add_non_dir(const char *path_
                if (fd == -1)
                        return sys_err_msg("failed to open file '%s'",
                                           path_name);