aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChao Yu <yuchao0@huawei.com>2018-10-17 09:40:56 +0800
committerJaegeuk Kim <jaegeuk@kernel.org>2018-11-21 11:38:23 -0800
commite599deb2385ef592d39d61318f1753a611cb0ea5 (patch)
tree0b93049cd92b7f6842b8de8611863ce258c2b35e
parent0057a8c5c2281b2512fe74fe33cdd6c9a8d8d877 (diff)
downloadf2fs-tools-e599deb2385ef592d39d61318f1753a611cb0ea5.tar.gz
mkfs.f2fs: support formating large size file in 32-bits platform
In 32-bits platform, {f,}stat on a large size file during mkfs, it will cause EOVERFLOW error, this patch fixes to add macro definition _FILE_OFFSET_BITS to avoid that error. Signed-off-by: Chao Yu <yuchao0@huawei.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
-rw-r--r--lib/libf2fs.c1
-rw-r--r--mkfs/f2fs_format_utils.c4
2 files changed, 5 insertions, 0 deletions
diff --git a/lib/libf2fs.c b/lib/libf2fs.c
index a1f8beb..fd3e006 100644
--- a/lib/libf2fs.c
+++ b/lib/libf2fs.c
@@ -7,6 +7,7 @@
* Dual licensed under the GPL or LGPL version 2 licenses.
*/
#define _LARGEFILE64_SOURCE
+#define _FILE_OFFSET_BITS 64
#include <f2fs_fs.h>
#include <stdio.h>
diff --git a/mkfs/f2fs_format_utils.c b/mkfs/f2fs_format_utils.c
index bf9ffbd..2c901f2 100644
--- a/mkfs/f2fs_format_utils.c
+++ b/mkfs/f2fs_format_utils.c
@@ -16,6 +16,10 @@
#define _GNU_SOURCE
#endif
+#ifndef _FILE_OFFSET_BITS
+#define _FILE_OFFSET_BITS 64
+#endif
+
#include <f2fs_fs.h>
#include <stdio.h>