* [PATCH xfsprogs 03/14] replace fstat64 by equivalent fstat
[not found] <cover.1470555003.git.felix.janda@posteo.de>
@ 2016-08-06 10:45 ` Felix Janda
2016-08-09 7:36 ` Christoph Hellwig
2016-08-06 10:45 ` [PATCH xfsprogs 04/14] replace lstat64 by equivalent lstat Felix Janda
` (12 subsequent siblings)
13 siblings, 1 reply; 37+ messages in thread
From: Felix Janda @ 2016-08-06 10:45 UTC (permalink / raw)
To: xfs
Signed-off-by: Felix Janda <felix.janda@posteo.de>
---
copy/xfs_copy.c | 2 +-
fsr/xfs_fsr.c | 4 ++--
include/darwin.h | 1 -
include/freebsd.h | 1 -
io/copy_file_range.c | 4 ++--
io/open.c | 12 ++++++------
io/sendfile.c | 4 ++--
libxfs/darwin.c | 2 +-
libxfs/init.c | 2 +-
libxfs/irix.c | 2 +-
libxfs/linux.c | 4 ++--
mkfs/proto.c | 2 +-
repair/xfs_repair.c | 2 +-
13 files changed, 20 insertions(+), 22 deletions(-)
diff --git a/copy/xfs_copy.c b/copy/xfs_copy.c
index 3c8998c..6dcc51a 100644
--- a/copy/xfs_copy.c
+++ b/copy/xfs_copy.c
@@ -641,7 +641,7 @@ main(int argc, char **argv)
die_perror();
}
- if (fstat64(source_fd, &statbuf) < 0) {
+ if (fstat(source_fd, &statbuf) < 0) {
do_log(_("%s: couldn't stat source \"%s\"\n"),
progname, source_name);
die_perror();
diff --git a/fsr/xfs_fsr.c b/fsr/xfs_fsr.c
index d75990a..2eaf1e7 100644
--- a/fsr/xfs_fsr.c
+++ b/fsr/xfs_fsr.c
@@ -514,7 +514,7 @@ fsrallfs(char *mtab, int howlong, char *leftofffile)
if ( (fd = open(leftofffile, O_RDONLY)) == -1 ) {
fsrprintf(_("%s: open failed\n"), leftofffile);
}
- else if ( fstat64(fd, &sb2) == 0) {
+ else if ( fstat(fd, &sb2) == 0) {
/*
* Verify that lstat & fstat point to the
* same regular file (no links/no quick spoofs)
@@ -1054,7 +1054,7 @@ fsr_setup_attr_fork(
/* attr2 w/ fork offsets */
- if (fstat64(tfd, &tstatbuf) < 0) {
+ if (fstat(tfd, &tstatbuf) < 0) {
fsrprintf(_("unable to stat temp file: %s\n"),
strerror(errno));
return -1;
diff --git a/include/darwin.h b/include/darwin.h
index 45e0c03..1666294 100644
--- a/include/darwin.h
+++ b/include/darwin.h
@@ -142,7 +142,6 @@ typedef u_int32_t xfs_dev_t;
typedef int64_t xfs_daddr_t;
#define stat64 stat
-#define fstat64 fstat
#define lseek64 lseek
#define pread64 pread
#define pwrite64 pwrite
diff --git a/include/freebsd.h b/include/freebsd.h
index 6e77427..d6e75f4 100644
--- a/include/freebsd.h
+++ b/include/freebsd.h
@@ -34,7 +34,6 @@
#define __LITTLE_ENDIAN LITTLE_ENDIAN
/* FreeBSD file API is 64-bit aware */
-#define fstat64 fstat
#define ftruncate64 ftruncate
#define lseek64 lseek
#define stat64 stat
diff --git a/io/copy_file_range.c b/io/copy_file_range.c
index eddc634..a354fab 100644
--- a/io/copy_file_range.c
+++ b/io/copy_file_range.c
@@ -62,8 +62,8 @@ copy_src_filesize(int fd)
{
struct stat64 st;
- if (fstat64(fd, &st) < 0) {
- perror("fstat64");
+ if (fstat(fd, &st) < 0) {
+ perror("fstat");
return -1;
};
return st.st_size;
diff --git a/io/open.c b/io/open.c
index 2303527..766ac48 100644
--- a/io/open.c
+++ b/io/open.c
@@ -54,8 +54,8 @@ filesize(void)
{
struct stat64 st;
- if (fstat64(file->fd, &st) < 0) {
- perror("fstat64");
+ if (fstat(file->fd, &st) < 0) {
+ perror("fstat");
return -1;
}
return st.st_size;
@@ -102,8 +102,8 @@ stat_f(
file->flags & IO_APPEND ? _(",append-only") : "",
file->flags & IO_NONBLOCK ? _(",non-block") : "",
file->flags & IO_TMPFILE ? _(",tmpfile") : "");
- if (fstat64(file->fd, &st) < 0) {
- perror("fstat64");
+ if (fstat(file->fd, &st) < 0) {
+ perror("fstat");
} else {
printf(_("stat.ino = %lld\n"), (long long)st.st_ino);
printf(_("stat.type = %s\n"), filetype(st.st_mode));
@@ -576,8 +576,8 @@ set_extsize(const char *path, int fd, long extsz)
struct fsxattr fsx;
struct stat64 stat;
- if (fstat64(fd, &stat) < 0) {
- perror("fstat64");
+ if (fstat(fd, &stat) < 0) {
+ perror("fstat");
return 0;
}
if ((xfsctl(path, fd, FS_IOC_FSGETXATTR, &fsx)) < 0) {
diff --git a/io/sendfile.c b/io/sendfile.c
index 21ab444..0dc6154 100644
--- a/io/sendfile.c
+++ b/io/sendfile.c
@@ -135,8 +135,8 @@ sendfile_f(
} else {
struct stat64 stat;
- if (fstat64(fd, &stat) < 0) {
- perror("fstat64");
+ if (fstat(fd, &stat) < 0) {
+ perror("fstat");
goto done;
}
count = stat.st_size;
diff --git a/libxfs/darwin.c b/libxfs/darwin.c
index 017e190..3923473 100644
--- a/libxfs/darwin.c
+++ b/libxfs/darwin.c
@@ -71,7 +71,7 @@ platform_findsizes(char *path, int fd, long long *sz, int *bsz)
__uint64_t size;
struct stat64 st;
- if (fstat64(fd, &st) < 0) {
+ if (fstat(fd, &st) < 0) {
fprintf(stderr,
_("%s: cannot stat the device file \"%s\": %s\n"),
progname, path, strerror(errno));
diff --git a/libxfs/init.c b/libxfs/init.c
index e04b6e0..919a510 100644
--- a/libxfs/init.c
+++ b/libxfs/init.c
@@ -124,7 +124,7 @@ retry:
exit(1);
}
- if (fstat64(fd, &statb) < 0) {
+ if (fstat(fd, &statb) < 0) {
fprintf(stderr, _("%s: cannot stat %s: %s\n"),
progname, path, strerror(errno));
exit(1);
diff --git a/libxfs/irix.c b/libxfs/irix.c
index 65aaa7e..532ea34 100644
--- a/libxfs/irix.c
+++ b/libxfs/irix.c
@@ -53,7 +53,7 @@ platform_findsizes(char *path, int fd, long long *sz, int *bsz)
{
struct stat64 st;
- if (fstat64(fd, &st) < 0) {
+ if (fstat(fd, &st) < 0) {
fprintf(stderr,
_("%s: cannot stat the device file \"%s\": %s\n"),
progname, path, strerror(errno));
diff --git a/libxfs/linux.c b/libxfs/linux.c
index c9f2baf..175156d 100644
--- a/libxfs/linux.c
+++ b/libxfs/linux.c
@@ -129,7 +129,7 @@ platform_flush_device(int fd, dev_t device)
if (major(device) == RAMDISK_MAJOR)
return;
- if (fstat64(fd, &st) < 0)
+ if (fstat(fd, &st) < 0)
return;
if (S_ISREG(st.st_mode))
@@ -145,7 +145,7 @@ platform_findsizes(char *path, int fd, long long *sz, int *bsz)
__uint64_t size;
int error;
- if (fstat64(fd, &st) < 0) {
+ if (fstat(fd, &st) < 0) {
fprintf(stderr, _("%s: "
"cannot stat the device file \"%s\": %s\n"),
progname, path, strerror(errno));
diff --git a/mkfs/proto.c b/mkfs/proto.c
index 5f7f0b4..a008801 100644
--- a/mkfs/proto.c
+++ b/mkfs/proto.c
@@ -784,7 +784,7 @@ filesize(
{
struct stat64 stb;
- if (fstat64(fd, &stb) < 0)
+ if (fstat(fd, &stb) < 0)
return -1;
return (long)stb.st_size;
}
diff --git a/repair/xfs_repair.c b/repair/xfs_repair.c
index 50a1ac9..4986cc5 100644
--- a/repair/xfs_repair.c
+++ b/repair/xfs_repair.c
@@ -670,7 +670,7 @@ main(int argc, char **argv)
int fd = libxfs_device_to_fd(x.ddev);
struct stat64 statbuf;
- if (fstat64(fd, &statbuf) < 0)
+ if (fstat(fd, &statbuf) < 0)
do_warn(_("%s: couldn't stat \"%s\"\n"),
progname, fs_name);
else if (S_ISREG(statbuf.st_mode))
--
2.7.3
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply related [flat|nested] 37+ messages in thread
* [PATCH xfsprogs 04/14] replace lstat64 by equivalent lstat
[not found] <cover.1470555003.git.felix.janda@posteo.de>
2016-08-06 10:45 ` [PATCH xfsprogs 03/14] replace fstat64 by equivalent fstat Felix Janda
@ 2016-08-06 10:45 ` Felix Janda
2016-08-09 7:37 ` Christoph Hellwig
2016-08-06 10:45 ` [PATCH xfsprogs 05/14] replace stat64 by equivalent stat Felix Janda
` (11 subsequent siblings)
13 siblings, 1 reply; 37+ messages in thread
From: Felix Janda @ 2016-08-06 10:45 UTC (permalink / raw)
To: xfs
Signed-off-by: Felix Janda <felix.janda@posteo.de>
---
fsr/xfs_fsr.c | 4 ++--
include/darwin.h | 1 -
2 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/fsr/xfs_fsr.c b/fsr/xfs_fsr.c
index 2eaf1e7..6099dc2 100644
--- a/fsr/xfs_fsr.c
+++ b/fsr/xfs_fsr.c
@@ -327,7 +327,7 @@ main(int argc, char **argv)
for (; optind < argc; optind++) {
argname = argv[optind];
- if (lstat64(argname, &sb) < 0) {
+ if (lstat(argname, &sb) < 0) {
fprintf(stderr,
_("%s: could not stat: %s: %s\n"),
progname, argname, strerror(errno));
@@ -510,7 +510,7 @@ fsrallfs(char *mtab, int howlong, char *leftofffile)
fs = fsbase;
/* where'd we leave off last time? */
- if (lstat64(leftofffile, &sb) == 0) {
+ if (lstat(leftofffile, &sb) == 0) {
if ( (fd = open(leftofffile, O_RDONLY)) == -1 ) {
fsrprintf(_("%s: open failed\n"), leftofffile);
}
diff --git a/include/darwin.h b/include/darwin.h
index 1666294..6d24957 100644
--- a/include/darwin.h
+++ b/include/darwin.h
@@ -222,7 +222,6 @@ static inline int timer_gettime (timer_t timerid, struct itimerspec *value)
#include <sys/ucred.h>
#include <errno.h>
#define statvfs64 statfs
-#define lstat64 lstat
#define _PATH_MOUNTED "/etc/mtab"
struct mntent
--
2.7.3
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply related [flat|nested] 37+ messages in thread
* [PATCH xfsprogs 05/14] replace stat64 by equivalent stat
[not found] <cover.1470555003.git.felix.janda@posteo.de>
2016-08-06 10:45 ` [PATCH xfsprogs 03/14] replace fstat64 by equivalent fstat Felix Janda
2016-08-06 10:45 ` [PATCH xfsprogs 04/14] replace lstat64 by equivalent lstat Felix Janda
@ 2016-08-06 10:45 ` Felix Janda
2016-08-09 7:37 ` Christoph Hellwig
2016-08-06 10:45 ` [PATCH xfsprogs 06/14] replace ftruncate64 by equivalent ftruncate Felix Janda
` (10 subsequent siblings)
13 siblings, 1 reply; 37+ messages in thread
From: Felix Janda @ 2016-08-06 10:45 UTC (permalink / raw)
To: xfs
[-- Attachment #1: Type: text/plain, Size: 18931 bytes --]
Signed-off-by: Felix Janda <felix.janda@posteo.de>
---
copy/xfs_copy.c | 6 +++---
fsr/xfs_fsr.c | 26 +++++++++++++-------------
include/darwin.h | 3 +--
include/freebsd.h | 1 -
io/copy_file_range.c | 2 +-
io/open.c | 6 +++---
io/sendfile.c | 2 +-
libxcmd/paths.c | 4 ++--
libxfs/darwin.c | 6 +++---
libxfs/freebsd.c | 8 ++++----
libxfs/init.c | 10 +++++-----
libxfs/init.h | 6 +++---
libxfs/irix.c | 6 +++---
libxfs/linux.c | 16 ++++++++--------
mdrestore/xfs_mdrestore.c | 6 +++---
mkfs/proto.c | 2 +-
mkfs/xfs_mkfs.c | 4 ++--
po/de.po | 8 ++++----
po/pl.po | 8 ++++----
repair/xfs_repair.c | 2 +-
rtcp/xfs_rtcp.c | 18 +++++++++---------
21 files changed, 74 insertions(+), 76 deletions(-)
diff --git a/copy/xfs_copy.c b/copy/xfs_copy.c
index 6dcc51a..55a9e2c 100644
--- a/copy/xfs_copy.c
+++ b/copy/xfs_copy.c
@@ -28,7 +28,7 @@
#define rounddown(x, y) (((x)/(y))*(y))
#define uuid_equal(s,d) (platform_uuid_compare((s),(d)) == 0)
-extern int platform_check_ismounted(char *, char *, struct stat64 *, int);
+extern int platform_check_ismounted(char *, char *, struct stat *, int);
int logfd;
char *logfile_name;
@@ -560,7 +560,7 @@ main(int argc, char **argv)
extern int optind;
libxfs_init_t xargs;
thread_args *tcarg;
- struct stat64 statbuf;
+ struct stat statbuf;
progname = basename(argv[0]);
@@ -792,7 +792,7 @@ main(int argc, char **argv)
for (i = 0; i < num_targets; i++) {
int write_last_block = 0;
- if (stat64(target[i].name, &statbuf) < 0) {
+ if (stat(target[i].name, &statbuf) < 0) {
/* ok, assume it's a file and create it */
do_out(_("Creating file %s\n"), target[i].name);
diff --git a/fsr/xfs_fsr.c b/fsr/xfs_fsr.c
index 6099dc2..36e0705 100644
--- a/fsr/xfs_fsr.c
+++ b/fsr/xfs_fsr.c
@@ -174,12 +174,12 @@ aborter(int unused)
* of that.
*/
static char *
-find_mountpoint_check(struct stat64 *sb, struct mntent *t)
+find_mountpoint_check(struct stat *sb, struct mntent *t)
{
- struct stat64 ms;
+ struct stat ms;
if (S_ISDIR(sb->st_mode)) { /* mount point */
- if (stat64(t->mnt_dir, &ms) < 0)
+ if (stat(t->mnt_dir, &ms) < 0)
return NULL;
if (sb->st_ino != ms.st_ino)
return NULL;
@@ -188,7 +188,7 @@ find_mountpoint_check(struct stat64 *sb, struct mntent *t)
if (strcmp(t->mnt_type, MNTTYPE_XFS) != 0)
return NULL;
} else { /* device */
- if (stat64(t->mnt_fsname, &ms) < 0)
+ if (stat(t->mnt_fsname, &ms) < 0)
return NULL;
if (sb->st_rdev != ms.st_rdev)
return NULL;
@@ -198,7 +198,7 @@ find_mountpoint_check(struct stat64 *sb, struct mntent *t)
* Make sure the mountpoint given by mtab is accessible
* before using it.
*/
- if (stat64(t->mnt_dir, &ms) < 0)
+ if (stat(t->mnt_dir, &ms) < 0)
return NULL;
}
@@ -206,7 +206,7 @@ find_mountpoint_check(struct stat64 *sb, struct mntent *t)
}
static char *
-find_mountpoint(char *mtab, char *argname, struct stat64 *sb)
+find_mountpoint(char *mtab, char *argname, struct stat *sb)
{
struct mntent_cursor cursor;
struct mntent *t = NULL;
@@ -230,7 +230,7 @@ find_mountpoint(char *mtab, char *argname, struct stat64 *sb)
int
main(int argc, char **argv)
{
- struct stat64 sb;
+ struct stat sb;
char *argname;
int c;
char *mntp;
@@ -335,9 +335,9 @@ main(int argc, char **argv)
}
if (S_ISLNK(sb.st_mode)) {
- struct stat64 sb2;
+ struct stat sb2;
- if (stat64(argname, &sb2) == 0 &&
+ if (stat(argname, &sb2) == 0 &&
(S_ISBLK(sb2.st_mode) ||
S_ISCHR(sb2.st_mode)))
sb = sb2;
@@ -405,7 +405,7 @@ initallfs(char *mtab)
struct mntent *mnt= NULL;
int mi;
char *cp;
- struct stat64 sb;
+ struct stat sb;
/* malloc a number of descriptors, increased later if needed */
if (!(fsbase = (fsdesc_t *)malloc(fsbufsize * sizeof(fsdesc_t)))) {
@@ -427,7 +427,7 @@ initallfs(char *mtab)
int rw = 0;
if (strcmp(mnt->mnt_type, MNTTYPE_XFS ) != 0 ||
- stat64(mnt->mnt_fsname, &sb) == -1 ||
+ stat(mnt->mnt_fsname, &sb) == -1 ||
!S_ISBLK(sb.st_mode))
continue;
@@ -502,7 +502,7 @@ fsrallfs(char *mtab, int howlong, char *leftofffile)
char *ptr;
xfs_ino_t startino = 0;
fsdesc_t *fsp;
- struct stat64 sb, sb2;
+ struct stat sb, sb2;
fsrprintf("xfs_fsr -m %s -t %d -f %s ...\n", mtab, howlong, leftofffile);
@@ -1027,7 +1027,7 @@ fsr_setup_attr_fork(
xfs_bstat_t *bstatp)
{
#ifdef HAVE_FSETXATTR
- struct stat64 tstatbuf;
+ struct stat tstatbuf;
int i;
int diff = 0;
int last_forkoff = 0;
diff --git a/include/darwin.h b/include/darwin.h
index 6d24957..8708324 100644
--- a/include/darwin.h
+++ b/include/darwin.h
@@ -141,7 +141,6 @@ typedef u_int64_t xfs_ino_t;
typedef u_int32_t xfs_dev_t;
typedef int64_t xfs_daddr_t;
-#define stat64 stat
#define lseek64 lseek
#define pread64 pread
#define pwrite64 pwrite
@@ -221,7 +220,7 @@ static inline int timer_gettime (timer_t timerid, struct itimerspec *value)
# include <sys/param.h>
#include <sys/ucred.h>
#include <errno.h>
-#define statvfs64 statfs
+#define statvfs64 statfs
#define _PATH_MOUNTED "/etc/mtab"
struct mntent
diff --git a/include/freebsd.h b/include/freebsd.h
index d6e75f4..f7ab8fa 100644
--- a/include/freebsd.h
+++ b/include/freebsd.h
@@ -36,7 +36,6 @@
/* FreeBSD file API is 64-bit aware */
#define ftruncate64 ftruncate
#define lseek64 lseek
-#define stat64 stat
#define pwrite64 pwrite
#define pread64 pread
#define fdatasync fsync
diff --git a/io/copy_file_range.c b/io/copy_file_range.c
index a354fab..7ba42b6 100644
--- a/io/copy_file_range.c
+++ b/io/copy_file_range.c
@@ -60,7 +60,7 @@ copy_file_range(int fd, loff_t *src, loff_t *dst, size_t len)
static off64_t
copy_src_filesize(int fd)
{
- struct stat64 st;
+ struct stat st;
if (fstat(fd, &st) < 0) {
perror("fstat");
diff --git a/io/open.c b/io/open.c
index 766ac48..d4ec13c 100644
--- a/io/open.c
+++ b/io/open.c
@@ -52,7 +52,7 @@ static long extsize;
off64_t
filesize(void)
{
- struct stat64 st;
+ struct stat st;
if (fstat(file->fd, &st) < 0) {
perror("fstat");
@@ -90,7 +90,7 @@ stat_f(
{
struct dioattr dio;
struct fsxattr fsx, fsxa;
- struct stat64 st;
+ struct stat st;
int verbose = (argc == 2 && !strcmp(argv[1], "-v"));
printf(_("fd.path = \"%s\"\n"), file->name);
@@ -574,7 +574,7 @@ static int
set_extsize(const char *path, int fd, long extsz)
{
struct fsxattr fsx;
- struct stat64 stat;
+ struct stat stat;
if (fstat(fd, &stat) < 0) {
perror("fstat");
diff --git a/io/sendfile.c b/io/sendfile.c
index 0dc6154..c082acf 100644
--- a/io/sendfile.c
+++ b/io/sendfile.c
@@ -133,7 +133,7 @@ sendfile_f(
goto done;
}
} else {
- struct stat64 stat;
+ struct stat stat;
if (fstat(fd, &stat) < 0) {
perror("fstat");
diff --git a/libxcmd/paths.c b/libxcmd/paths.c
index 71af25f..bd91ae0 100644
--- a/libxcmd/paths.c
+++ b/libxcmd/paths.c
@@ -43,9 +43,9 @@ fs_device_number(
const char *name,
dev_t *devnum)
{
- struct stat64 sbuf;
+ struct stat sbuf;
- if (stat64(name, &sbuf) < 0)
+ if (stat(name, &sbuf) < 0)
return errno;
/*
* We want to match st_rdev if the path provided is a device
diff --git a/libxfs/darwin.c b/libxfs/darwin.c
index 3923473..bc552ba 100644
--- a/libxfs/darwin.c
+++ b/libxfs/darwin.c
@@ -27,13 +27,13 @@ int platform_has_uuid = 1;
extern char *progname;
int
-platform_check_ismounted(char *name, char *block, struct stat64 *s, int verbose)
+platform_check_ismounted(char *name, char *block, struct stat *s, int verbose)
{
return 0;
}
int
-platform_check_iswritable(char *name, char *block, struct stat64 *s, int fatal)
+platform_check_iswritable(char *name, char *block, struct stat *s, int fatal)
{
int fd, writable;
@@ -69,7 +69,7 @@ void
platform_findsizes(char *path, int fd, long long *sz, int *bsz)
{
__uint64_t size;
- struct stat64 st;
+ struct stat st;
if (fstat(fd, &st) < 0) {
fprintf(stderr,
diff --git a/libxfs/freebsd.c b/libxfs/freebsd.c
index 6c9f089..1f1b5b9 100644
--- a/libxfs/freebsd.c
+++ b/libxfs/freebsd.c
@@ -27,14 +27,14 @@ int platform_has_uuid = 1;
extern char *progname;
int
-platform_check_ismounted(char *name, char *block, struct stat64 *s, int verbose)
+platform_check_ismounted(char *name, char *block, struct stat *s, int verbose)
{
- struct stat64 st;
+ struct stat st;
int cnt, i;
struct statfs *fsinfo;
if (!s) {
- if (stat64(block, &st) < 0)
+ if (stat(block, &st) < 0)
return 0;
s = &st;
}
@@ -66,7 +66,7 @@ platform_check_ismounted(char *name, char *block, struct stat64 *s, int verbose)
}
int
-platform_check_iswritable(char *name, char *block, struct stat64 *s, int fatal)
+platform_check_iswritable(char *name, char *block, struct stat *s, int fatal)
{
int cnt, i;
struct statfs *fsinfo;
diff --git a/libxfs/init.c b/libxfs/init.c
index 919a510..2057320 100644
--- a/libxfs/init.c
+++ b/libxfs/init.c
@@ -65,9 +65,9 @@ static struct dev_to_fd {
static int
check_isactive(char *name, char *block, int fatal)
{
- struct stat64 st;
+ struct stat st;
- if (stat64(block, &st) < 0)
+ if (stat(block, &st) < 0)
return 0;
if ((st.st_mode & S_IFMT) != S_IFBLK)
return 0;
@@ -104,7 +104,7 @@ libxfs_device_open(char *path, int creat, int xflags, int setblksize)
dev_t dev;
int fd, d, flags;
int readonly, dio, excl;
- struct stat64 statb;
+ struct stat statb;
readonly = (xflags & LIBXFS_ISREADONLY);
excl = (xflags & LIBXFS_EXCLUSIVELY) && !creat;
@@ -199,9 +199,9 @@ check_open(char *path, int flags, char **rawfile, char **blockfile)
int readonly = (flags & LIBXFS_ISREADONLY);
int inactive = (flags & LIBXFS_ISINACTIVE);
int dangerously = (flags & LIBXFS_DANGEROUSLY);
- struct stat64 stbuf;
+ struct stat stbuf;
- if (stat64(path, &stbuf) < 0) {
+ if (stat(path, &stbuf) < 0) {
perror(path);
return 0;
}
diff --git a/libxfs/init.h b/libxfs/init.h
index 112febb..baf2f68 100644
--- a/libxfs/init.h
+++ b/libxfs/init.h
@@ -18,12 +18,12 @@
#ifndef LIBXFS_INIT_H
#define LIBXFS_INIT_H
-struct stat64;
+struct stat;
extern int platform_check_ismounted (char *path, char *block,
- struct stat64 *sptr, int verbose);
+ struct stat *sptr, int verbose);
extern int platform_check_iswritable (char *path, char *block,
- struct stat64 *sptr, int fatal);
+ struct stat *sptr, int fatal);
extern int platform_set_blocksize (int fd, char *path, dev_t device, int bsz, int fatal);
extern void platform_flush_device (int fd, dev_t device);
extern char *platform_findrawpath(char *path);
diff --git a/libxfs/irix.c b/libxfs/irix.c
index 532ea34..a3bd832 100644
--- a/libxfs/irix.c
+++ b/libxfs/irix.c
@@ -25,13 +25,13 @@ extern char *progname;
extern __int64_t findsize(char *);
int
-platform_check_ismounted(char *name, char *block, struct stat64 *s, int verbose)
+platform_check_ismounted(char *name, char *block, struct stat *s, int verbose)
{
return 0;
}
int
-platform_check_iswritable(char *name, char *block, struct stat64 *s, int fatal)
+platform_check_iswritable(char *name, char *block, struct stat *s, int fatal)
{
return 1;
}
@@ -51,7 +51,7 @@ platform_flush_device(int fd, dev_t device)
void
platform_findsizes(char *path, int fd, long long *sz, int *bsz)
{
- struct stat64 st;
+ struct stat st;
if (fstat(fd, &st) < 0) {
fprintf(stderr,
diff --git a/libxfs/linux.c b/libxfs/linux.c
index 175156d..7da6dd6 100644
--- a/libxfs/linux.c
+++ b/libxfs/linux.c
@@ -49,14 +49,14 @@ static int max_block_alignment;
#define PROC_MOUNTED "/proc/mounts"
int
-platform_check_ismounted(char *name, char *block, struct stat64 *s, int verbose)
+platform_check_ismounted(char *name, char *block, struct stat *s, int verbose)
{
/* Pad ust; pre-2.6.28 linux copies out too much in 32bit compat mode */
struct ustat ust[2];
- struct stat64 st;
+ struct stat st;
if (!s) {
- if (stat64(block, &st) < 0)
+ if (stat(block, &st) < 0)
return 0;
if ((st.st_mode & S_IFMT) != S_IFBLK)
return 0;
@@ -74,11 +74,11 @@ platform_check_ismounted(char *name, char *block, struct stat64 *s, int verbose)
}
int
-platform_check_iswritable(char *name, char *block, struct stat64 *s, int fatal)
+platform_check_iswritable(char *name, char *block, struct stat *s, int fatal)
{
int sts = 0;
FILE *f;
- struct stat64 mst;
+ struct stat mst;
struct mntent *mnt;
char mounts[MAXPATHLEN];
@@ -89,7 +89,7 @@ platform_check_iswritable(char *name, char *block, struct stat64 *s, int fatal)
return fatal;
}
while ((mnt = getmntent(f)) != NULL) {
- if (stat64(mnt->mnt_fsname, &mst) < 0)
+ if (stat(mnt->mnt_fsname, &mst) < 0)
continue;
if ((mst.st_mode & S_IFMT) != S_IFBLK)
continue;
@@ -125,7 +125,7 @@ platform_set_blocksize(int fd, char *path, dev_t device, int blocksize, int fata
void
platform_flush_device(int fd, dev_t device)
{
- struct stat64 st;
+ struct stat st;
if (major(device) == RAMDISK_MAJOR)
return;
@@ -141,7 +141,7 @@ platform_flush_device(int fd, dev_t device)
void
platform_findsizes(char *path, int fd, long long *sz, int *bsz)
{
- struct stat64 st;
+ struct stat st;
__uint64_t size;
int error;
diff --git a/mdrestore/xfs_mdrestore.c b/mdrestore/xfs_mdrestore.c
index a22efc2..26d61eb 100644
--- a/mdrestore/xfs_mdrestore.c
+++ b/mdrestore/xfs_mdrestore.c
@@ -197,7 +197,7 @@ usage(void)
exit(1);
}
-extern int platform_check_ismounted(char *, char *, struct stat64 *, int);
+extern int platform_check_ismounted(char *, char *, struct stat *, int);
int
main(
@@ -208,7 +208,7 @@ main(
int dst_fd;
int c;
int open_flags;
- struct stat64 statbuf;
+ struct stat statbuf;
int is_target_file;
progname = basename(argv[0]);
@@ -244,7 +244,7 @@ main(
/* check and open target */
open_flags = O_RDWR;
is_target_file = 0;
- if (stat64(argv[optind], &statbuf) < 0) {
+ if (stat(argv[optind], &statbuf) < 0) {
/* ok, assume it's a file and create it */
open_flags |= O_CREAT;
is_target_file = 1;
diff --git a/mkfs/proto.c b/mkfs/proto.c
index a008801..7de0a99 100644
--- a/mkfs/proto.c
+++ b/mkfs/proto.c
@@ -782,7 +782,7 @@ static long
filesize(
int fd)
{
- struct stat64 stb;
+ struct stat stb;
if (fstat(fd, &stb) < 0)
return -1;
diff --git a/mkfs/xfs_mkfs.c b/mkfs/xfs_mkfs.c
index 8b02983..8b98a8a 100644
--- a/mkfs/xfs_mkfs.c
+++ b/mkfs/xfs_mkfs.c
@@ -794,7 +794,7 @@ check_device_type(
bool force_overwrite,
const char *optname)
{
- struct stat64 statbuf;
+ struct stat statbuf;
if (*isfile && (no_size || no_name)) {
fprintf(stderr,
@@ -808,7 +808,7 @@ check_device_type(
usage();
}
- if (stat64(name, &statbuf)) {
+ if (stat(name, &statbuf)) {
if (errno == ENOENT && *isfile) {
if (create)
*create = 1;
diff --git a/po/de.po b/po/de.po
index fc62525..61a60f3 100644
--- a/po/de.po
+++ b/po/de.po
@@ -13873,8 +13873,8 @@ msgstr "%s: Dateien zum Kopieren müssen angegeben werden\n"
#: .././rtcp/xfs_rtcp.c:86
#, c-format
-msgid "%s: stat64 of %s failed\n"
-msgstr "%s: stat64 von %s fehlgeschlagen\n"
+msgid "%s: stat of %s failed\n"
+msgstr "%s: stat von %s fehlgeschlagen\n"
#: .././rtcp/xfs_rtcp.c:93
#, c-format
@@ -13883,8 +13883,8 @@ msgstr "%s: letztes Argument ist kein Verzeichnis\n"
#: .././rtcp/xfs_rtcp.c:140
#, c-format
-msgid "%s: failed stat64 on %s: %s\n"
-msgstr "%s: stat64 auf %s fehlgeschlagen: %s\n"
+msgid "%s: failed stat on %s: %s\n"
+msgstr "%s: stat auf %s fehlgeschlagen: %s\n"
#: .././rtcp/xfs_rtcp.c:161
#, c-format
diff --git a/po/pl.po b/po/pl.po
index a950f77..9d5128f 100644
--- a/po/pl.po
+++ b/po/pl.po
@@ -13005,8 +13005,8 @@ msgstr "%s: trzeba podaÄ pliki do skopiowania\n"
#: .././rtcp/xfs_rtcp.c:84
#, c-format
-msgid "%s: stat64 of %s failed\n"
-msgstr "%s: stat64 na %s nie powiodÅo siÄ\n"
+msgid "%s: stat of %s failed\n"
+msgstr "%s: stat na %s nie powiodÅo siÄ\n"
#: .././rtcp/xfs_rtcp.c:91
#, c-format
@@ -13015,8 +13015,8 @@ msgstr "%s: ostatni argument nie jest katalogiem\n"
#: .././rtcp/xfs_rtcp.c:138
#, c-format
-msgid "%s: failed stat64 on %s: %s\n"
-msgstr "%s: nie udaÅo siÄ wykonaÄ stat64 na %s: %s\n"
+msgid "%s: failed stat on %s: %s\n"
+msgstr "%s: nie udaÅo siÄ wykonaÄ stat na %s: %s\n"
#: .././rtcp/xfs_rtcp.c:159
#, c-format
diff --git a/repair/xfs_repair.c b/repair/xfs_repair.c
index 4986cc5..361bace 100644
--- a/repair/xfs_repair.c
+++ b/repair/xfs_repair.c
@@ -668,7 +668,7 @@ main(int argc, char **argv)
/* -f forces this, but let's be nice and autodetect it, as well. */
if (!isa_file) {
int fd = libxfs_device_to_fd(x.ddev);
- struct stat64 statbuf;
+ struct stat statbuf;
if (fstat(fd, &statbuf) < 0)
do_warn(_("%s: couldn't stat \"%s\"\n"),
diff --git a/rtcp/xfs_rtcp.c b/rtcp/xfs_rtcp.c
index 3044350..705e958 100644
--- a/rtcp/xfs_rtcp.c
+++ b/rtcp/xfs_rtcp.c
@@ -35,7 +35,7 @@ int
main(int argc, char **argv)
{
int c, i, r, errflg = 0;
- struct stat64 s2;
+ struct stat s2;
int extsize = - 1;
progname = basename(argv[0]);
@@ -80,8 +80,8 @@ main(int argc, char **argv)
* which really exists.
*/
if (argc > 2) {
- if (stat64(argv[argc-1], &s2) < 0) {
- fprintf(stderr, _("%s: stat64 of %s failed\n"),
+ if (stat(argv[argc-1], &s2) < 0) {
+ fprintf(stderr, _("%s: stat of %s failed\n"),
progname, argv[argc-1]);
exit(2);
}
@@ -115,7 +115,7 @@ rtcp( char *source, char *target, int fextsize)
int remove = 0, rtextsize;
char *sp, *fbuf, *ptr;
char tbuf[ PATH_MAX ];
- struct stat64 s1, s2;
+ struct stat s1, s2;
struct fsxattr fsxattr;
struct dioattr dioattr;
@@ -134,8 +134,8 @@ rtcp( char *source, char *target, int fextsize)
*sp = '\0';
}
- if ( stat64(source, &s1) ) {
- fprintf(stderr, _("%s: failed stat64 on %s: %s\n"),
+ if ( stat(source, &s1) ) {
+ fprintf(stderr, _("%s: failed stat on %s: %s\n"),
progname, source, strerror(errno));
return( -1);
}
@@ -144,7 +144,7 @@ rtcp( char *source, char *target, int fextsize)
* check for a realtime partition
*/
snprintf(tbuf, sizeof(tbuf), "%s", target);
- if ( stat64(target, &s2) ) {
+ if ( stat(target, &s2) ) {
if (!S_ISDIR(s2.st_mode)) {
/* take out target file name */
if ((ptr = strrchr(tbuf, '/')) != NULL)
@@ -165,14 +165,14 @@ rtcp( char *source, char *target, int fextsize)
* check if target is a directory
*/
snprintf(tbuf, sizeof(tbuf), "%s", target);
- if ( !stat64(target, &s2) ) {
+ if ( !stat(target, &s2) ) {
if (S_ISDIR(s2.st_mode)) {
snprintf(tbuf, sizeof(tbuf), "%s/%s", target,
basename(source));
}
}
- if ( stat64(tbuf, &s2) ) {
+ if ( stat(tbuf, &s2) ) {
/*
* create the file if it does not exist
*/
--
2.7.3
[-- Attachment #2: Type: text/plain, Size: 121 bytes --]
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply related [flat|nested] 37+ messages in thread
* [PATCH xfsprogs 06/14] replace ftruncate64 by equivalent ftruncate
[not found] <cover.1470555003.git.felix.janda@posteo.de>
` (2 preceding siblings ...)
2016-08-06 10:45 ` [PATCH xfsprogs 05/14] replace stat64 by equivalent stat Felix Janda
@ 2016-08-06 10:45 ` Felix Janda
2016-08-09 7:38 ` Christoph Hellwig
2016-08-06 10:45 ` [PATCH xfsprogs 07/14] replace lseek64 by equivalent lseek Felix Janda
` (9 subsequent siblings)
13 siblings, 1 reply; 37+ messages in thread
From: Felix Janda @ 2016-08-06 10:45 UTC (permalink / raw)
To: xfs
Signed-off-by: Felix Janda <felix.janda@posteo.de>
---
copy/xfs_copy.c | 2 +-
fsr/xfs_fsr.c | 2 +-
include/darwin.h | 1 -
include/freebsd.h | 1 -
io/copy_file_range.c | 4 ++--
io/truncate.c | 2 +-
mdrestore/xfs_mdrestore.c | 2 +-
mkfs/xfs_mkfs.c | 2 +-
8 files changed, 7 insertions(+), 9 deletions(-)
diff --git a/copy/xfs_copy.c b/copy/xfs_copy.c
index 55a9e2c..f038c2e 100644
--- a/copy/xfs_copy.c
+++ b/copy/xfs_copy.c
@@ -832,7 +832,7 @@ main(int argc, char **argv)
if (write_last_block) {
/* ensure regular files are correctly sized */
- if (ftruncate64(target[i].fd, mp->m_sb.sb_dblocks *
+ if (ftruncate(target[i].fd, mp->m_sb.sb_dblocks *
source_blocksize)) {
do_log(_("%s: cannot grow data section.\n"),
progname);
diff --git a/fsr/xfs_fsr.c b/fsr/xfs_fsr.c
index 36e0705..d87d020 100644
--- a/fsr/xfs_fsr.c
+++ b/fsr/xfs_fsr.c
@@ -1451,7 +1451,7 @@ packfile(char *fname, char *tname, int fd,
}
}
}
- if (ftruncate64(tfd, statp->bs_size) < 0) {
+ if (ftruncate(tfd, statp->bs_size) < 0) {
fsrprintf(_("could not truncate tmpfile: %s : %s\n"),
fname, strerror(errno));
goto out;
diff --git a/include/darwin.h b/include/darwin.h
index 8708324..5c149a0 100644
--- a/include/darwin.h
+++ b/include/darwin.h
@@ -144,7 +144,6 @@ typedef int64_t xfs_daddr_t;
#define lseek64 lseek
#define pread64 pread
#define pwrite64 pwrite
-#define ftruncate64 ftruncate
#define fdatasync fsync
#define memalign(a,sz) valloc(sz)
diff --git a/include/freebsd.h b/include/freebsd.h
index f7ab8fa..f5e7fa9 100644
--- a/include/freebsd.h
+++ b/include/freebsd.h
@@ -34,7 +34,6 @@
#define __LITTLE_ENDIAN LITTLE_ENDIAN
/* FreeBSD file API is 64-bit aware */
-#define ftruncate64 ftruncate
#define lseek64 lseek
#define pwrite64 pwrite
#define pread64 pread
diff --git a/io/copy_file_range.c b/io/copy_file_range.c
index 7ba42b6..88203e9 100644
--- a/io/copy_file_range.c
+++ b/io/copy_file_range.c
@@ -72,9 +72,9 @@ copy_src_filesize(int fd)
static int
copy_dst_truncate(void)
{
- int ret = ftruncate64(file->fd, 0);
+ int ret = ftruncate(file->fd, 0);
if (ret < 0)
- perror("ftruncate64");
+ perror("ftruncate");
return ret;
}
diff --git a/io/truncate.c b/io/truncate.c
index f2df168..20bada8 100644
--- a/io/truncate.c
+++ b/io/truncate.c
@@ -38,7 +38,7 @@ truncate_f(
return 0;
}
- if (ftruncate64(file->fd, offset) < 0) {
+ if (ftruncate(file->fd, offset) < 0) {
perror("ftruncate");
return 0;
}
diff --git a/mdrestore/xfs_mdrestore.c b/mdrestore/xfs_mdrestore.c
index 26d61eb..1540dcd 100644
--- a/mdrestore/xfs_mdrestore.c
+++ b/mdrestore/xfs_mdrestore.c
@@ -124,7 +124,7 @@ perform_restore(
if (is_target_file) {
/* ensure regular files are correctly sized */
- if (ftruncate64(dst_fd, sb.sb_dblocks * sb.sb_blocksize))
+ if (ftruncate(dst_fd, sb.sb_dblocks * sb.sb_blocksize))
fatal("cannot set filesystem image size: %s\n",
strerror(errno));
} else {
diff --git a/mkfs/xfs_mkfs.c b/mkfs/xfs_mkfs.c
index 8b98a8a..5d5fcb7 100644
--- a/mkfs/xfs_mkfs.c
+++ b/mkfs/xfs_mkfs.c
@@ -2815,7 +2815,7 @@ _("size %s specified for log subvolume is too large, maximum is %lld blocks\n"),
* code will succeed.
*/
if (xi.disfile && xi.dsize * xi.dbsize < dblocks * blocksize) {
- if (ftruncate64(xi.dfd, dblocks * blocksize) < 0) {
+ if (ftruncate(xi.dfd, dblocks * blocksize) < 0) {
fprintf(stderr,
_("%s: Growing the data section failed\n"),
progname);
--
2.7.3
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply related [flat|nested] 37+ messages in thread
* [PATCH xfsprogs 07/14] replace lseek64 by equivalent lseek
[not found] <cover.1470555003.git.felix.janda@posteo.de>
` (3 preceding siblings ...)
2016-08-06 10:45 ` [PATCH xfsprogs 06/14] replace ftruncate64 by equivalent ftruncate Felix Janda
@ 2016-08-06 10:45 ` Felix Janda
2016-08-09 7:38 ` Christoph Hellwig
2016-08-06 10:45 ` [PATCH xfsprogs 08/14] replace pread64 by equivalent pread Felix Janda
` (8 subsequent siblings)
13 siblings, 1 reply; 37+ messages in thread
From: Felix Janda @ 2016-08-06 10:45 UTC (permalink / raw)
To: xfs
[-- Attachment #1: Type: text/plain, Size: 11252 bytes --]
Signed-off-by: Felix Janda <felix.janda@posteo.de>
---
copy/xfs_copy.c | 10 +++++-----
fsr/xfs_fsr.c | 10 +++++-----
include/darwin.h | 1 -
include/freebsd.h | 1 -
io/pread.c | 6 +++---
io/seek.c | 6 +++---
libxfs/rdwr.c | 2 +-
logprint/log_misc.c | 4 ++--
logprint/logprint.c | 2 +-
po/de.po | 16 ++++++++--------
po/pl.po | 16 ++++++++--------
repair/sb.c | 6 +++---
12 files changed, 39 insertions(+), 41 deletions(-)
diff --git a/copy/xfs_copy.c b/copy/xfs_copy.c
index f038c2e..cc5207d 100644
--- a/copy/xfs_copy.c
+++ b/copy/xfs_copy.c
@@ -162,7 +162,7 @@ check_errors(void)
if (target[i].err_type == 0)
do_log(_("write error"));
else
- do_log(_("lseek64 error"));
+ do_log(_("lseek error"));
do_log(_(" at offset %lld\n"), target[i].position);
}
}
@@ -192,7 +192,7 @@ do_write(
buf = &w_buf;
if (target[args->id].position != buf->position) {
- if (lseek64(args->fd, buf->position, SEEK_SET) < 0) {
+ if (lseek(args->fd, buf->position, SEEK_SET) < 0) {
error = target[args->id].err_type = 1;
} else {
target[args->id].position = buf->position;
@@ -263,7 +263,7 @@ handler(int sig)
target[i].position);
} else {
do_warn(
- _("%s: lseek64 error on target %d \"%s\" at offset %lld\n"),
+ _("%s: lseek error on target %d \"%s\" at offset %lld\n"),
progname, i, target[i].name,
target[i].position);
}
@@ -388,9 +388,9 @@ read_wbuf(int fd, wbuf *buf, xfs_mount_t *mp)
}
if (source_position != buf->position) {
- lres = lseek64(fd, buf->position, SEEK_SET);
+ lres = lseek(fd, buf->position, SEEK_SET);
if (lres < 0LL) {
- do_warn(_("%s: lseek64 failure at offset %lld\n"),
+ do_warn(_("%s: lseek failure at offset %lld\n"),
progname, source_position);
die_perror();
}
diff --git a/fsr/xfs_fsr.c b/fsr/xfs_fsr.c
index d87d020..98390e7 100644
--- a/fsr/xfs_fsr.c
+++ b/fsr/xfs_fsr.c
@@ -1318,7 +1318,7 @@ packfile(char *fname, char *tname, int fd,
fsrprintf(_("could not trunc tmp %s\n"),
tname);
}
- if (lseek64(tfd, outmap[extent].bmv_length, SEEK_CUR) < 0) {
+ if (lseek(tfd, outmap[extent].bmv_length, SEEK_CUR) < 0) {
fsrprintf(_("could not lseek in tmpfile: %s : %s\n"),
tname, strerror(errno));
goto out;
@@ -1338,7 +1338,7 @@ packfile(char *fname, char *tname, int fd,
" %s\n"), tname);
goto out;
}
- if (lseek64(tfd, outmap[extent].bmv_length, SEEK_CUR) < 0) {
+ if (lseek(tfd, outmap[extent].bmv_length, SEEK_CUR) < 0) {
fsrprintf(_("could not lseek in tmpfile: %s : %s\n"),
tname, strerror(errno));
goto out;
@@ -1346,7 +1346,7 @@ packfile(char *fname, char *tname, int fd,
}
} /* end of space allocation loop */
- if (lseek64(tfd, 0, SEEK_SET)) {
+ if (lseek(tfd, 0, SEEK_SET)) {
fsrprintf(_("Couldn't rewind on temporary file\n"));
goto out;
}
@@ -1366,12 +1366,12 @@ packfile(char *fname, char *tname, int fd,
for (extent = 0; extent < nextents; extent++) {
pos = outmap[extent].bmv_offset;
if (outmap[extent].bmv_block == -1) {
- if (lseek64(tfd, outmap[extent].bmv_length, SEEK_CUR) < 0) {
+ if (lseek(tfd, outmap[extent].bmv_length, SEEK_CUR) < 0) {
fsrprintf(_("could not lseek in tmpfile: %s : %s\n"),
tname, strerror(errno));
goto out;
}
- if (lseek64(fd, outmap[extent].bmv_length, SEEK_CUR) < 0) {
+ if (lseek(fd, outmap[extent].bmv_length, SEEK_CUR) < 0) {
fsrprintf(_("could not lseek in file: %s : %s\n"),
fname, strerror(errno));
goto out;
diff --git a/include/darwin.h b/include/darwin.h
index 5c149a0..850d733 100644
--- a/include/darwin.h
+++ b/include/darwin.h
@@ -141,7 +141,6 @@ typedef u_int64_t xfs_ino_t;
typedef u_int32_t xfs_dev_t;
typedef int64_t xfs_daddr_t;
-#define lseek64 lseek
#define pread64 pread
#define pwrite64 pwrite
#define fdatasync fsync
diff --git a/include/freebsd.h b/include/freebsd.h
index f5e7fa9..784e287 100644
--- a/include/freebsd.h
+++ b/include/freebsd.h
@@ -34,7 +34,6 @@
#define __LITTLE_ENDIAN LITTLE_ENDIAN
/* FreeBSD file API is 64-bit aware */
-#define lseek64 lseek
#define pwrite64 pwrite
#define pread64 pread
#define fdatasync fsync
diff --git a/io/pread.c b/io/pread.c
index b98355f..cafead0 100644
--- a/io/pread.c
+++ b/io/pread.c
@@ -233,7 +233,7 @@ read_random(
int ops = 0;
srandom(seed);
- end = lseek64(fd, 0, SEEK_END);
+ end = lseek(fd, 0, SEEK_END);
offset = (eof || offset > end) ? end : offset;
if ((bytes = (offset % buffersize)))
offset -= bytes;
@@ -279,8 +279,8 @@ read_backward(
long long cnt = *count;
int ops = 0;
- end = lseek64(fd, 0, SEEK_END);
- off = eof ? end : min(end, lseek64(fd, off, SEEK_SET));
+ end = lseek(fd, 0, SEEK_END);
+ off = eof ? end : min(end, lseek(fd, off, SEEK_SET));
if ((end = off - cnt) < 0) {
cnt += end; /* subtraction, end is negative */
end = 0;
diff --git a/io/seek.c b/io/seek.c
index 35a369e..d06375d 100644
--- a/io/seek.c
+++ b/io/seek.c
@@ -147,7 +147,7 @@ seek_f(
* decide if we want to display that type of entry.
*/
if (flag & SEEK_HFLAG) {
- offset = lseek64(file->fd, start, SEEK_HOLE);
+ offset = lseek(file->fd, start, SEEK_HOLE);
if ((start == offset) || !(flag & SEEK_DFLAG)) {
/*
* this offset is a hole or are only displaying holes.
@@ -162,7 +162,7 @@ seek_f(
/* The offset is not a hole, or we are looking just for data */
current = DATA;
- offset = lseek64(file->fd, start, SEEK_DATA);
+ offset = lseek(file->fd, start, SEEK_DATA);
found_hole:
/*
@@ -202,7 +202,7 @@ found_hole:
current ^= 1; /* alternate between data and hole */
start = offset;
- offset = lseek64(file->fd, start, seekinfo[current].seektype);
+ offset = lseek(file->fd, start, seekinfo[current].seektype);
}
return 0;
}
diff --git a/libxfs/rdwr.c b/libxfs/rdwr.c
index 0ec38c5..cb74b3c 100644
--- a/libxfs/rdwr.c
+++ b/libxfs/rdwr.c
@@ -88,7 +88,7 @@ libxfs_device_zero(struct xfs_buftarg *btp, xfs_daddr_t start, uint len)
fd = libxfs_device_to_fd(btp->dev);
start_offset = LIBXFS_BBTOOFF64(start);
- if ((lseek64(fd, start_offset, SEEK_SET)) < 0) {
+ if ((lseek(fd, start_offset, SEEK_SET)) < 0) {
fprintf(stderr, _("%s: %s seek to offset %llu failed: %s\n"),
progname, __FUNCTION__,
(unsigned long long)start_offset, strerror(errno));
diff --git a/logprint/log_misc.c b/logprint/log_misc.c
index e6ee832..8a687d5 100644
--- a/logprint/log_misc.c
+++ b/logprint/log_misc.c
@@ -887,8 +887,8 @@ xlog_print_lseek(struct xlog *log, int fd, xfs_daddr_t blkno, int whence)
offset = BBTOOFF64(blkno+log->l_logBBstart);
else
offset = BBTOOFF64(blkno);
- if (lseek64(fd, offset, whence) < 0) {
- fprintf(stderr, _("%s: lseek64 to %lld failed: %s\n"),
+ if (lseek(fd, offset, whence) < 0) {
+ fprintf(stderr, _("%s: lseek to %lld failed: %s\n"),
progname, (long long)offset, strerror(errno));
exit(1);
}
diff --git a/logprint/logprint.c b/logprint/logprint.c
index a5c9b32..37b8cb9 100644
--- a/logprint/logprint.c
+++ b/logprint/logprint.c
@@ -80,7 +80,7 @@ logstat(xfs_mount_t *mp)
x.dname, strerror(errno));
exit(1);
}
- lseek64(fd, 0, SEEK_SET);
+ lseek(fd, 0, SEEK_SET);
if (read(fd, buf, sizeof(buf)) != sizeof(buf)) {
fprintf(stderr, _(" read of XFS superblock failed\n"));
exit(1);
diff --git a/po/de.po b/po/de.po
index 61a60f3..ff1930e 100644
--- a/po/de.po
+++ b/po/de.po
@@ -45,8 +45,8 @@ msgid "write error"
msgstr "Schreibfehler"
#: .././copy/xfs_copy.c:146
-msgid "lseek64 error"
-msgstr "lseek64-Fehler"
+msgid "lseek error"
+msgstr "lseek-Fehler"
#: .././copy/xfs_copy.c:147
#, c-format
@@ -70,8 +70,8 @@ msgstr "%s: Schreibfehler auf Ziel %d »%s« bei Versatz %lld\n"
#: .././copy/xfs_copy.c:260
#, c-format
-msgid "%s: lseek64 error on target %d \"%s\" at offset %lld\n"
-msgstr "%s: lseek64-Fehler auf Ziel %d »%s« bei Versatz %lld\n"
+msgid "%s: lseek error on target %d \"%s\" at offset %lld\n"
+msgstr "%s: lseek-Fehler auf Ziel %d »%s« bei Versatz %lld\n"
#: .././copy/xfs_copy.c:266
#, c-format
@@ -104,8 +104,8 @@ msgstr "Aufruf: %s [-bd] [-L Protokolldatei] Quelle Ziel [Ziel ...]\n"
#: .././copy/xfs_copy.c:386
#, c-format
-msgid "%s: lseek64 failure at offset %lld\n"
-msgstr "%s: lseek64-Fehlschlag bei Versatz %lld\n"
+msgid "%s: lseek failure at offset %lld\n"
+msgstr "%s: lseek-Fehlschlag bei Versatz %lld\n"
#: .././copy/xfs_copy.c:401
#, c-format
@@ -6472,8 +6472,8 @@ msgstr "DQUOT: Magische 0x%hx Markierungen 0%ho\n"
#: .././logprint/log_misc.c:821
#, c-format
-msgid "%s: lseek64 to %lld failed: %s\n"
-msgstr "%s: lseek64 auf %lld fehlgeschlagen: %s\n"
+msgid "%s: lseek to %lld failed: %s\n"
+msgstr "%s: lseek auf %lld fehlgeschlagen: %s\n"
#: .././logprint/log_misc.c:864
#, c-format
diff --git a/po/pl.po b/po/pl.po
index 9d5128f..33a9d81 100644
--- a/po/pl.po
+++ b/po/pl.po
@@ -44,8 +44,8 @@ msgid "write error"
msgstr "bÅÄ
d zapisu"
#: .././copy/xfs_copy.c:146
-msgid "lseek64 error"
-msgstr "bÅÄ
d lseek64"
+msgid "lseek error"
+msgstr "bÅÄ
d lseek"
#: .././copy/xfs_copy.c:147
#, c-format
@@ -69,8 +69,8 @@ msgstr "%s: bÅÄ
d zapisu przy celu %d \"%s\" pod offsetem %lld\n"
#: .././copy/xfs_copy.c:241
#, c-format
-msgid "%s: lseek64 error on target %d \"%s\" at offset %lld\n"
-msgstr "%s: bÅÄ
d lseek64 przy celu %d \"%s\" pod offsetem %lld\n"
+msgid "%s: lseek error on target %d \"%s\" at offset %lld\n"
+msgstr "%s: bÅÄ
d lseek przy celu %d \"%s\" pod offsetem %lld\n"
#: .././copy/xfs_copy.c:247
#, c-format
@@ -103,8 +103,8 @@ msgstr "SkÅadnia: %s [-bdV] [-L plik_logu] źródÅo cel [cel ...]\n"
#: .././copy/xfs_copy.c:367
#, c-format
-msgid "%s: lseek64 failure at offset %lld\n"
-msgstr "%s: niepowodzenie lseek64 pod offsetem %lld\n"
+msgid "%s: lseek failure at offset %lld\n"
+msgstr "%s: niepowodzenie lseek pod offsetem %lld\n"
#: .././copy/xfs_copy.c:382
#, c-format
@@ -6394,8 +6394,8 @@ msgstr ""
#: .././logprint/log_misc.c:863
#, c-format
-msgid "%s: lseek64 to %lld failed: %s\n"
-msgstr "%s: lseek64 na %lld nie powiodÅo siÄ: %s\n"
+msgid "%s: lseek to %lld failed: %s\n"
+msgstr "%s: lseek na %lld nie powiodÅo siÄ: %s\n"
#: .././logprint/log_misc.c:909
#, c-format
diff --git a/repair/sb.c b/repair/sb.c
index a8170ba..ad1a29f 100644
--- a/repair/sb.c
+++ b/repair/sb.c
@@ -138,7 +138,7 @@ __find_secondary_sb(
/*
* read disk 1 MByte at a time.
*/
- if (lseek64(x.dfd, off, SEEK_SET) != off) {
+ if (lseek(x.dfd, off, SEEK_SET) != off) {
done = 1;
}
@@ -512,7 +512,7 @@ write_primary_sb(xfs_sb_t *sbp, int size)
}
memset(buf, 0, size);
- if (lseek64(x.dfd, 0LL, SEEK_SET) != 0LL) {
+ if (lseek(x.dfd, 0LL, SEEK_SET) != 0LL) {
free(buf);
do_error(_("couldn't seek to offset 0 in filesystem\n"));
}
@@ -551,7 +551,7 @@ get_sb(xfs_sb_t *sbp, xfs_off_t off, int size, xfs_agnumber_t agno)
/* try and read it first */
- if (lseek64(x.dfd, off, SEEK_SET) != off) {
+ if (lseek(x.dfd, off, SEEK_SET) != off) {
do_warn(
_("error reading superblock %u -- seek to offset %" PRId64 " failed\n"),
agno, off);
--
2.7.3
[-- Attachment #2: Type: text/plain, Size: 121 bytes --]
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply related [flat|nested] 37+ messages in thread
* [PATCH xfsprogs 08/14] replace pread64 by equivalent pread
[not found] <cover.1470555003.git.felix.janda@posteo.de>
` (4 preceding siblings ...)
2016-08-06 10:45 ` [PATCH xfsprogs 07/14] replace lseek64 by equivalent lseek Felix Janda
@ 2016-08-06 10:45 ` Felix Janda
2016-08-09 7:38 ` Christoph Hellwig
2016-08-06 10:45 ` [PATCH xfsprogs 09/14] replace pwrite64 by equivalent pwrite Felix Janda
` (7 subsequent siblings)
13 siblings, 1 reply; 37+ messages in thread
From: Felix Janda @ 2016-08-06 10:45 UTC (permalink / raw)
To: xfs
Signed-off-by: Felix Janda <felix.janda@posteo.de>
---
include/darwin.h | 1 -
include/freebsd.h | 1 -
io/pread.c | 10 +++++-----
libxfs/rdwr.c | 2 +-
repair/prefetch.c | 2 +-
5 files changed, 7 insertions(+), 9 deletions(-)
diff --git a/include/darwin.h b/include/darwin.h
index 850d733..f4dbd9f 100644
--- a/include/darwin.h
+++ b/include/darwin.h
@@ -141,7 +141,6 @@ typedef u_int64_t xfs_ino_t;
typedef u_int32_t xfs_dev_t;
typedef int64_t xfs_daddr_t;
-#define pread64 pread
#define pwrite64 pwrite
#define fdatasync fsync
#define memalign(a,sz) valloc(sz)
diff --git a/include/freebsd.h b/include/freebsd.h
index 784e287..041dafe 100644
--- a/include/freebsd.h
+++ b/include/freebsd.h
@@ -35,7 +35,6 @@
/* FreeBSD file API is 64-bit aware */
#define pwrite64 pwrite
-#define pread64 pread
#define fdatasync fsync
#define memalign(a,sz) valloc(sz)
diff --git a/io/pread.c b/io/pread.c
index cafead0..3395503 100644
--- a/io/pread.c
+++ b/io/pread.c
@@ -214,7 +214,7 @@ do_pread(
ssize_t buffer_size)
{
if (!vectors)
- return pread64(fd, buffer, min(count, buffer_size), offset);
+ return pread(fd, buffer, min(count, buffer_size), offset);
return do_preadv(fd, offset, count, buffer_size);
}
@@ -254,7 +254,7 @@ read_random(
if (bytes == 0)
break;
if (bytes < 0) {
- perror("pread64");
+ perror("pread");
return -1;
}
ops++;
@@ -296,7 +296,7 @@ read_backward(
if (bytes == 0)
return ops;
if (bytes < 0) {
- perror("pread64");
+ perror("pread");
return -1;
}
ops++;
@@ -314,7 +314,7 @@ read_backward(
if (bytes == 0)
break;
if (bytes < 0) {
- perror("pread64");
+ perror("pread");
return -1;
}
ops++;
@@ -345,7 +345,7 @@ read_forward(
if (bytes == 0)
break;
if (bytes < 0) {
- perror("pread64");
+ perror("pread");
return -1;
}
ops++;
diff --git a/libxfs/rdwr.c b/libxfs/rdwr.c
index cb74b3c..36c39d9 100644
--- a/libxfs/rdwr.c
+++ b/libxfs/rdwr.c
@@ -915,7 +915,7 @@ __read_buf(int fd, void *buf, int len, off64_t offset, int flags)
{
int sts;
- sts = pread64(fd, buf, len, offset);
+ sts = pread(fd, buf, len, offset);
if (sts < 0) {
int error = errno;
fprintf(stderr, _("%s: read failed: %s\n"),
diff --git a/repair/prefetch.c b/repair/prefetch.c
index b4f20d9..175594c 100644
--- a/repair/prefetch.c
+++ b/repair/prefetch.c
@@ -565,7 +565,7 @@ pf_batch_read(
/*
* now read the data and put into the xfs_but_t's
*/
- len = pread64(mp_fd, buf, (int)(last_off - first_off), first_off);
+ len = pread(mp_fd, buf, (int)(last_off - first_off), first_off);
/*
* Check the last buffer on the list to see if we need to
--
2.7.3
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply related [flat|nested] 37+ messages in thread
* [PATCH xfsprogs 09/14] replace pwrite64 by equivalent pwrite
[not found] <cover.1470555003.git.felix.janda@posteo.de>
` (5 preceding siblings ...)
2016-08-06 10:45 ` [PATCH xfsprogs 08/14] replace pread64 by equivalent pread Felix Janda
@ 2016-08-06 10:45 ` Felix Janda
2016-08-09 7:39 ` Christoph Hellwig
2016-08-06 10:52 ` [PATCH xfsprogs 12/14] replace off64_t by off_t outside of public headers Felix Janda
` (6 subsequent siblings)
13 siblings, 1 reply; 37+ messages in thread
From: Felix Janda @ 2016-08-06 10:45 UTC (permalink / raw)
To: xfs
[-- Attachment #1: Type: text/plain, Size: 5661 bytes --]
Signed-off-by: Felix Janda <felix.janda@posteo.de>
---
copy/xfs_copy.c | 2 +-
include/darwin.h | 1 -
include/freebsd.h | 1 -
io/pwrite.c | 10 +++++-----
libxfs/rdwr.c | 6 +++---
mdrestore/xfs_mdrestore.c | 4 ++--
mkfs/xfs_mkfs.c | 2 +-
po/de.po | 4 ++--
po/pl.po | 8 ++++----
9 files changed, 18 insertions(+), 20 deletions(-)
diff --git a/copy/xfs_copy.c b/copy/xfs_copy.c
index cc5207d..816ab29 100644
--- a/copy/xfs_copy.c
+++ b/copy/xfs_copy.c
@@ -860,7 +860,7 @@ main(int argc, char **argv)
off = mp->m_sb.sb_dblocks * source_blocksize;
off -= sizeof(lb);
- if (pwrite64(target[i].fd, lb, sizeof(lb), off) < 0) {
+ if (pwrite(target[i].fd, lb, sizeof(lb), off) < 0) {
do_log(_("%s: failed to write last block\n"),
progname);
do_log(_("\tIs target \"%s\" too small?\n"),
diff --git a/include/darwin.h b/include/darwin.h
index f4dbd9f..fb13915 100644
--- a/include/darwin.h
+++ b/include/darwin.h
@@ -141,7 +141,6 @@ typedef u_int64_t xfs_ino_t;
typedef u_int32_t xfs_dev_t;
typedef int64_t xfs_daddr_t;
-#define pwrite64 pwrite
#define fdatasync fsync
#define memalign(a,sz) valloc(sz)
diff --git a/include/freebsd.h b/include/freebsd.h
index 041dafe..df924ef 100644
--- a/include/freebsd.h
+++ b/include/freebsd.h
@@ -34,7 +34,6 @@
#define __LITTLE_ENDIAN LITTLE_ENDIAN
/* FreeBSD file API is 64-bit aware */
-#define pwrite64 pwrite
#define fdatasync fsync
#define memalign(a,sz) valloc(sz)
diff --git a/io/pwrite.c b/io/pwrite.c
index 67631ce..7c0bb7f 100644
--- a/io/pwrite.c
+++ b/io/pwrite.c
@@ -101,7 +101,7 @@ do_pwrite(
ssize_t buffer_size)
{
if (!vectors)
- return pwrite64(fd, buffer, min(count, buffer_size), offset);
+ return pwrite(fd, buffer, min(count, buffer_size), offset);
return do_pwritev(fd, offset, count, buffer_size);
}
@@ -137,7 +137,7 @@ write_random(
if (bytes == 0)
break;
if (bytes < 0) {
- perror("pwrite64");
+ perror("pwrite");
return -1;
}
ops++;
@@ -175,7 +175,7 @@ write_backward(
if (bytes == 0)
return ops;
if (bytes < 0) {
- perror("pwrite64");
+ perror("pwrite");
return -1;
}
ops++;
@@ -193,7 +193,7 @@ write_backward(
if (bytes == 0)
break;
if (bytes < 0) {
- perror("pwrite64");
+ perror("pwrite");
return -1;
}
ops++;
@@ -228,7 +228,7 @@ write_buffer(
if (bytes == 0)
break;
if (bytes < 0) {
- perror("pwrite64");
+ perror("pwrite");
return -1;
}
ops++;
diff --git a/libxfs/rdwr.c b/libxfs/rdwr.c
index 36c39d9..8e9d86a 100644
--- a/libxfs/rdwr.c
+++ b/libxfs/rdwr.c
@@ -1083,16 +1083,16 @@ __write_buf(int fd, void *buf, int len, off64_t offset, int flags)
{
int sts;
- sts = pwrite64(fd, buf, len, offset);
+ sts = pwrite(fd, buf, len, offset);
if (sts < 0) {
int error = errno;
- fprintf(stderr, _("%s: pwrite64 failed: %s\n"),
+ fprintf(stderr, _("%s: pwrite failed: %s\n"),
progname, strerror(error));
if (flags & LIBXFS_B_EXIT)
exit(1);
return -error;
} else if (sts != len) {
- fprintf(stderr, _("%s: error - pwrite64 only %d of %d bytes\n"),
+ fprintf(stderr, _("%s: error - pwrite only %d of %d bytes\n"),
progname, sts, len);
if (flags & LIBXFS_B_EXIT)
exit(1);
diff --git a/mdrestore/xfs_mdrestore.c b/mdrestore/xfs_mdrestore.c
index 1540dcd..0d399f1 100644
--- a/mdrestore/xfs_mdrestore.c
+++ b/mdrestore/xfs_mdrestore.c
@@ -134,7 +134,7 @@ perform_restore(
off64_t off;
off = sb.sb_dblocks * sb.sb_blocksize - sizeof(lb);
- if (pwrite64(dst_fd, lb, sizeof(lb), off) < 0)
+ if (pwrite(dst_fd, lb, sizeof(lb), off) < 0)
fatal("failed to write last block, is target too "
"small? (error: %s)\n", strerror(errno));
}
@@ -146,7 +146,7 @@ perform_restore(
print_progress("%lld MB read", bytes_read >> 20);
for (cur_index = 0; cur_index < mb_count; cur_index++) {
- if (pwrite64(dst_fd, &block_buffer[cur_index <<
+ if (pwrite(dst_fd, &block_buffer[cur_index <<
tmb.mb_blocklog], block_size,
be64_to_cpu(block_index[cur_index]) <<
BBSHIFT) < 0)
diff --git a/mkfs/xfs_mkfs.c b/mkfs/xfs_mkfs.c
index 5d5fcb7..e038d48 100644
--- a/mkfs/xfs_mkfs.c
+++ b/mkfs/xfs_mkfs.c
@@ -1111,7 +1111,7 @@ zero_old_xfs_structures(
off = 0;
for (i = 1; i < sb.sb_agcount; i++) {
off += sb.sb_agblocks;
- if (pwrite64(xi->dfd, buf, new_sb->sb_sectsize,
+ if (pwrite(xi->dfd, buf, new_sb->sb_sectsize,
off << sb.sb_blocklog) == -1)
break;
}
diff --git a/po/de.po b/po/de.po
index ff1930e..fab2667 100644
--- a/po/de.po
+++ b/po/de.po
@@ -5893,8 +5893,8 @@ msgstr "%s: lesen fehlgeschlagen: %s\n"
#: .././libxfs/rdwr.c:502
#, c-format
-msgid "%s: pwrite64 failed: %s\n"
-msgstr "%s: pwrite64 fehlgeschlagen: %s\n"
+msgid "%s: pwrite failed: %s\n"
+msgstr "%s: pwrite fehlgeschlagen: %s\n"
#: .././libxfs/rdwr.c:509
#, c-format
diff --git a/po/pl.po b/po/pl.po
index 33a9d81..49209f3 100644
--- a/po/pl.po
+++ b/po/pl.po
@@ -5940,13 +5940,13 @@ msgstr "%s: bÅÄ
d - odczytano tylko %d z %d bajtów\n"
#: .././libxfs/rdwr.c:878
#, c-format
-msgid "%s: pwrite64 failed: %s\n"
-msgstr "%s: pwrite64 nie powiodÅo siÄ: %s\n"
+msgid "%s: pwrite failed: %s\n"
+msgstr "%s: pwrite nie powiodÅo siÄ: %s\n"
#: .././libxfs/rdwr.c:884
#, c-format
-msgid "%s: error - pwrite64 only %d of %d bytes\n"
-msgstr "%s: bÅÄ
d - wykonano pwrite64 tylko %d z %d bajtów\n"
+msgid "%s: error - pwrite only %d of %d bytes\n"
+msgstr "%s: bÅÄ
d - wykonano pwrite tylko %d z %d bajtów\n"
#: .././libxfs/rdwr.c:920
#, c-format
--
2.7.3
[-- Attachment #2: Type: text/plain, Size: 121 bytes --]
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply related [flat|nested] 37+ messages in thread
* [PATCH xfsprogs 12/14] replace off64_t by off_t outside of public headers
[not found] <cover.1470555003.git.felix.janda@posteo.de>
` (6 preceding siblings ...)
2016-08-06 10:45 ` [PATCH xfsprogs 09/14] replace pwrite64 by equivalent pwrite Felix Janda
@ 2016-08-06 10:52 ` Felix Janda
2016-08-09 7:40 ` Christoph Hellwig
2016-08-06 11:03 ` [PATCH xfsprogs 10/14] replace sendfile64 by equivalent sendfile Felix Janda
` (5 subsequent siblings)
13 siblings, 1 reply; 37+ messages in thread
From: Felix Janda @ 2016-08-06 10:52 UTC (permalink / raw)
To: xfs
Signed-off-by: Felix Janda <felix.janda@posteo.de>
---
copy/xfs_copy.c | 2 +-
fsr/xfs_fsr.c | 2 +-
io/bmap.c | 10 +++++-----
io/copy_file_range.c | 2 +-
io/fadvise.c | 2 +-
io/io.h | 10 +++++-----
io/madvise.c | 2 +-
io/mincore.c | 2 +-
io/mmap.c | 12 ++++++------
io/open.c | 2 +-
io/pread.c | 22 +++++++++++-----------
io/pwrite.c | 18 +++++++++---------
io/reflink.c | 4 ++--
io/seek.c | 6 +++---
io/sendfile.c | 6 +++---
io/sync_file_range.c | 2 +-
io/truncate.c | 2 +-
libxfs/rdwr.c | 8 ++++----
mdrestore/xfs_mdrestore.c | 2 +-
repair/prefetch.c | 2 +-
20 files changed, 59 insertions(+), 59 deletions(-)
diff --git a/copy/xfs_copy.c b/copy/xfs_copy.c
index 816ab29..a8a7b4e 100644
--- a/copy/xfs_copy.c
+++ b/copy/xfs_copy.c
@@ -854,7 +854,7 @@ main(int argc, char **argv)
}
} else {
char *lb[XFS_MAX_SECTORSIZE] = { NULL };
- off64_t off;
+ off_t off;
/* ensure device files are sufficiently large */
diff --git a/fsr/xfs_fsr.c b/fsr/xfs_fsr.c
index f3cc07e..ce89433 100644
--- a/fsr/xfs_fsr.c
+++ b/fsr/xfs_fsr.c
@@ -1214,7 +1214,7 @@ packfile(char *fname, char *tname, int fd,
struct dioattr dio;
static xfs_swapext_t sx;
struct xfs_flock64 space;
- off64_t cnt, pos;
+ off_t cnt, pos;
void *fbuf = NULL;
int ct, wc, wc_b4;
char ffname[SMBUFSZ];
diff --git a/io/bmap.c b/io/bmap.c
index 04d04c7..a7ad8ff 100644
--- a/io/bmap.c
+++ b/io/bmap.c
@@ -53,9 +53,9 @@ bmap_help(void)
static int
numlen(
- off64_t val)
+ off_t val)
{
- off64_t tmp;
+ off_t tmp;
int len;
for (len = 0, tmp = val; tmp > 0; tmp = tmp/10)
@@ -279,7 +279,7 @@ bmap_f(
#define FLG_BSW 000010 /* Not on begin of stripe width */
#define FLG_ESW 000001 /* Not on end of stripe width */
int agno;
- off64_t agoff, bbperag;
+ off_t agoff, bbperag;
int foff_w, boff_w, aoff_w, tot_w, agno_w;
char rbuf[32], bbuf[32], abuf[32];
int sunit, swidth;
@@ -289,8 +289,8 @@ bmap_f(
if (is_rt)
sunit = swidth = bbperag = 0;
else {
- bbperag = (off64_t)fsgeo.agblocks *
- (off64_t)fsgeo.blocksize / BBSIZE;
+ bbperag = (off_t)fsgeo.agblocks *
+ (off_t)fsgeo.blocksize / BBSIZE;
sunit = (fsgeo.sunit * fsgeo.blocksize) / BBSIZE;
swidth = (fsgeo.swidth * fsgeo.blocksize) / BBSIZE;
}
diff --git a/io/copy_file_range.c b/io/copy_file_range.c
index 88203e9..d1473bb 100644
--- a/io/copy_file_range.c
+++ b/io/copy_file_range.c
@@ -57,7 +57,7 @@ copy_file_range(int fd, loff_t *src, loff_t *dst, size_t len)
return 0;
}
-static off64_t
+static off_t
copy_src_filesize(int fd)
{
struct stat st;
diff --git a/io/fadvise.c b/io/fadvise.c
index d59d1ff..d8195a0 100644
--- a/io/fadvise.c
+++ b/io/fadvise.c
@@ -51,7 +51,7 @@ fadvise_f(
int argc,
char **argv)
{
- off64_t offset = 0, length = 0;
+ off_t offset = 0, length = 0;
int c, range = 0, advise = POSIX_FADV_NORMAL;
while ((c = getopt(argc, argv, "dnrsw")) != EOF) {
diff --git a/io/io.h b/io/io.h
index 2bc7ac4..1a38aca 100644
--- a/io/io.h
+++ b/io/io.h
@@ -60,7 +60,7 @@ extern int filelist_f(void);
typedef struct mmap_region {
void *addr; /* address of start of mapping */
size_t length; /* length of mapping */
- off64_t offset; /* start offset into backing file */
+ off_t offset; /* start offset into backing file */
int prot; /* protection mode of the mapping */
char *name; /* name of backing file */
} mmap_region_t;
@@ -69,13 +69,13 @@ extern mmap_region_t *maptable; /* mmap'd region array */
extern int mapcount; /* #entries in the mapping table */
extern mmap_region_t *mapping; /* active mapping table entry */
extern int maplist_f(void);
-extern void *check_mapping_range(mmap_region_t *, off64_t, size_t, int);
+extern void *check_mapping_range(mmap_region_t *, off_t, size_t, int);
/*
* Various xfs_io helper routines/globals
*/
-extern off64_t filesize(void);
+extern off_t filesize(void);
extern int openfile(char *, xfs_fsop_geom_t *, int, mode_t);
extern int addfile(char *, int , xfs_fsop_geom_t *, int);
extern void printxattr(uint, int, int, const char *, int, int);
@@ -88,9 +88,9 @@ extern size_t buffersize;
extern int vectors;
extern struct iovec *iov;
extern int alloc_buffer(size_t, int, unsigned int);
-extern int read_buffer(int, off64_t, long long, long long *,
+extern int read_buffer(int, off_t, long long, long long *,
int, int);
-extern void dump_buffer(off64_t, ssize_t);
+extern void dump_buffer(off_t, ssize_t);
extern void attr_init(void);
extern void bmap_init(void);
diff --git a/io/madvise.c b/io/madvise.c
index 1d8b53c..5aacbb5 100644
--- a/io/madvise.c
+++ b/io/madvise.c
@@ -51,7 +51,7 @@ madvise_f(
int argc,
char **argv)
{
- off64_t offset, llength;
+ off_t offset, llength;
size_t length;
void *start;
int advise = MADV_NORMAL, c;
diff --git a/io/mincore.c b/io/mincore.c
index 9e0d3a6..4a4781f 100644
--- a/io/mincore.c
+++ b/io/mincore.c
@@ -29,7 +29,7 @@ mincore_f(
int argc,
char **argv)
{
- off64_t offset, llength;
+ off_t offset, llength;
size_t length;
size_t blocksize, sectsize;
void *start;
diff --git a/io/mmap.c b/io/mmap.c
index dc188d0..a8d8197 100644
--- a/io/mmap.c
+++ b/io/mmap.c
@@ -68,11 +68,11 @@ print_mapping(
void *
check_mapping_range(
mmap_region_t *map,
- off64_t offset,
+ off_t offset,
size_t length,
int pagealign)
{
- off64_t relative;
+ off_t relative;
if (offset < mapping->offset) {
printf(_("offset (%lld) is before start of mapping (%lld)\n"),
@@ -156,7 +156,7 @@ mmap_f(
int argc,
char **argv)
{
- off64_t offset;
+ off_t offset;
ssize_t length = 0, length2 = 0;
void *address = NULL;
char *filename;
@@ -288,7 +288,7 @@ msync_f(
int argc,
char **argv)
{
- off64_t offset;
+ off_t offset;
ssize_t length;
void *start;
int c, flags = 0;
@@ -372,7 +372,7 @@ mread_f(
int argc,
char **argv)
{
- off64_t offset, tmp, dumpoffset, printoffset;
+ off_t offset, tmp, dumpoffset, printoffset;
ssize_t length;
size_t dumplen, cnt = 0;
char *bp;
@@ -529,7 +529,7 @@ mwrite_f(
int argc,
char **argv)
{
- off64_t offset, tmp;
+ off_t offset, tmp;
ssize_t length;
void *start;
char *sp;
diff --git a/io/open.c b/io/open.c
index d4ec13c..aded8a6 100644
--- a/io/open.c
+++ b/io/open.c
@@ -49,7 +49,7 @@ static cmdinfo_t inode_cmd;
static prid_t prid;
static long extsize;
-off64_t
+off_t
filesize(void)
{
struct stat st;
diff --git a/io/pread.c b/io/pread.c
index 3395503..da42b8f 100644
--- a/io/pread.c
+++ b/io/pread.c
@@ -125,7 +125,7 @@ alloc_buffer(
void
__dump_buffer(
void *buf,
- off64_t offset,
+ off_t offset,
ssize_t len)
{
int i, j;
@@ -150,7 +150,7 @@ __dump_buffer(
void
dump_buffer(
- off64_t offset,
+ off_t offset,
ssize_t len)
{
int i, l;
@@ -173,7 +173,7 @@ dump_buffer(
static int
do_preadv(
int fd,
- off64_t offset,
+ off_t offset,
ssize_t count,
ssize_t buffer_size)
{
@@ -209,7 +209,7 @@ do_preadv(
static int
do_pread(
int fd,
- off64_t offset,
+ off_t offset,
ssize_t count,
ssize_t buffer_size)
{
@@ -222,13 +222,13 @@ do_pread(
static int
read_random(
int fd,
- off64_t offset,
+ off_t offset,
long long count,
long long *total,
unsigned int seed,
int eof)
{
- off64_t end, off, range;
+ off_t end, off, range;
ssize_t bytes;
int ops = 0;
@@ -269,12 +269,12 @@ read_random(
static int
read_backward(
int fd,
- off64_t *offset,
+ off_t *offset,
long long *count,
long long *total,
int eof)
{
- off64_t end, off = *offset;
+ off_t end, off = *offset;
ssize_t bytes = 0, bytes_requested;
long long cnt = *count;
int ops = 0;
@@ -329,7 +329,7 @@ read_backward(
static int
read_forward(
int fd,
- off64_t offset,
+ off_t offset,
long long count,
long long *total,
int verbose,
@@ -363,7 +363,7 @@ read_forward(
int
read_buffer(
int fd,
- off64_t offset,
+ off_t offset,
long long count,
long long *total,
int verbose,
@@ -378,7 +378,7 @@ pread_f(
char **argv)
{
size_t bsize;
- off64_t offset;
+ off_t offset;
unsigned int zeed = 0;
long long count, total, tmp;
size_t fsblocksize, fssectsize;
diff --git a/io/pwrite.c b/io/pwrite.c
index 7c0bb7f..d2cbafb 100644
--- a/io/pwrite.c
+++ b/io/pwrite.c
@@ -60,7 +60,7 @@ pwrite_help(void)
static int
do_pwritev(
int fd,
- off64_t offset,
+ off_t offset,
ssize_t count,
ssize_t buffer_size)
{
@@ -96,7 +96,7 @@ do_pwritev(
static int
do_pwrite(
int fd,
- off64_t offset,
+ off_t offset,
ssize_t count,
ssize_t buffer_size)
{
@@ -108,12 +108,12 @@ do_pwrite(
static int
write_random(
- off64_t offset,
+ off_t offset,
long long count,
unsigned int seed,
long long *total)
{
- off64_t off, range;
+ off_t off, range;
ssize_t bytes;
int ops = 0;
@@ -151,11 +151,11 @@ write_random(
static int
write_backward(
- off64_t offset,
+ off_t offset,
long long *count,
long long *total)
{
- off64_t end, off = offset;
+ off_t end, off = offset;
ssize_t bytes = 0, bytes_requested;
long long cnt = *count;
int ops = 0;
@@ -207,11 +207,11 @@ write_backward(
static int
write_buffer(
- off64_t offset,
+ off_t offset,
long long count,
size_t bs,
int fd,
- off64_t skip,
+ off_t skip,
long long *total)
{
ssize_t bytes;
@@ -249,7 +249,7 @@ pwrite_f(
char **argv)
{
size_t bsize;
- off64_t offset, skip = 0;
+ off_t offset, skip = 0;
long long count, total, tmp;
unsigned int zeed = 0, seed = 0xcdcdcdcd;
size_t fsblocksize, fssectsize;
diff --git a/io/reflink.c b/io/reflink.c
index a09e82d..6becd12 100644
--- a/io/reflink.c
+++ b/io/reflink.c
@@ -109,7 +109,7 @@ dedupe_f(
int argc,
char **argv)
{
- off64_t soffset, doffset;
+ off_t soffset, doffset;
long long count, total;
char *infile;
int condensed, quiet_flag;
@@ -229,7 +229,7 @@ reflink_f(
int argc,
char **argv)
{
- off64_t soffset, doffset;
+ off_t soffset, doffset;
long long count = 0, total;
char *infile = NULL;
int condensed, quiet_flag;
diff --git a/io/seek.c b/io/seek.c
index d06375d..36403a3 100644
--- a/io/seek.c
+++ b/io/seek.c
@@ -75,8 +75,8 @@ void
seek_output(
int startflag,
char *type,
- off64_t start,
- off64_t offset)
+ off_t start,
+ off_t offset)
{
if (offset == -1) {
if (errno == ENXIO) {
@@ -104,7 +104,7 @@ seek_f(
int argc,
char **argv)
{
- off64_t offset, start;
+ off_t offset, start;
size_t fsblocksize, fssectsize;
int c;
int current; /* specify data or hole */
diff --git a/io/sendfile.c b/io/sendfile.c
index edd31c9..3463820 100644
--- a/io/sendfile.c
+++ b/io/sendfile.c
@@ -45,12 +45,12 @@ sendfile_help(void)
static int
send_buffer(
- off64_t offset,
+ off_t offset,
size_t count,
int fd,
long long *total)
{
- off64_t off = offset;
+ off_t off = offset;
ssize_t bytes, bytes_remaining = count;
int ops = 0;
@@ -77,7 +77,7 @@ sendfile_f(
int argc,
char **argv)
{
- off64_t offset = 0;
+ off_t offset = 0;
long long count, total;
size_t blocksize, sectsize;
struct timeval t1, t2;
diff --git a/io/sync_file_range.c b/io/sync_file_range.c
index 7e4f3e6..3b1f9c2 100644
--- a/io/sync_file_range.c
+++ b/io/sync_file_range.c
@@ -42,7 +42,7 @@ sync_range_f(
int argc,
char **argv)
{
- off64_t offset = 0, length = 0;
+ off_t offset = 0, length = 0;
int c, sync_mode = 0;
size_t blocksize, sectsize;
diff --git a/io/truncate.c b/io/truncate.c
index 20bada8..480574a 100644
--- a/io/truncate.c
+++ b/io/truncate.c
@@ -28,7 +28,7 @@ truncate_f(
int argc,
char **argv)
{
- off64_t offset;
+ off_t offset;
size_t blocksize, sectsize;
init_cvtnum(&blocksize, §size);
diff --git a/libxfs/rdwr.c b/libxfs/rdwr.c
index 8e9d86a..265f26a 100644
--- a/libxfs/rdwr.c
+++ b/libxfs/rdwr.c
@@ -911,7 +911,7 @@ libxfs_balloc(cache_key_t key)
static int
-__read_buf(int fd, void *buf, int len, off64_t offset, int flags)
+__read_buf(int fd, void *buf, int len, off_t offset, int flags)
{
int sts;
@@ -1024,7 +1024,7 @@ libxfs_readbufr_map(struct xfs_buftarg *btp, struct xfs_buf *bp, int flags)
fd = libxfs_device_to_fd(btp->dev);
buf = bp->b_addr;
for (i = 0; i < bp->b_nmaps; i++) {
- off64_t offset = LIBXFS_BBTOOFF64(bp->b_map[i].bm_bn);
+ off_t offset = LIBXFS_BBTOOFF64(bp->b_map[i].bm_bn);
int len = BBTOB(bp->b_map[i].bm_len);
error = __read_buf(fd, buf, len, offset, flags);
@@ -1079,7 +1079,7 @@ libxfs_readbuf_map(struct xfs_buftarg *btp, struct xfs_buf_map *map, int nmaps,
}
static int
-__write_buf(int fd, void *buf, int len, off64_t offset, int flags)
+__write_buf(int fd, void *buf, int len, off_t offset, int flags)
{
int sts;
@@ -1142,7 +1142,7 @@ libxfs_writebufr(xfs_buf_t *bp)
char *buf = bp->b_addr;
for (i = 0; i < bp->b_nmaps; i++) {
- off64_t offset = LIBXFS_BBTOOFF64(bp->b_map[i].bm_bn);
+ off_t offset = LIBXFS_BBTOOFF64(bp->b_map[i].bm_bn);
int len = BBTOB(bp->b_map[i].bm_len);
bp->b_error = __write_buf(fd, buf, len, offset,
diff --git a/mdrestore/xfs_mdrestore.c b/mdrestore/xfs_mdrestore.c
index 0d399f1..e1d8b6b 100644
--- a/mdrestore/xfs_mdrestore.c
+++ b/mdrestore/xfs_mdrestore.c
@@ -131,7 +131,7 @@ perform_restore(
/* ensure device is sufficiently large enough */
char *lb[XFS_MAX_SECTORSIZE] = { NULL };
- off64_t off;
+ off_t off;
off = sb.sb_dblocks * sb.sb_blocksize - sizeof(lb);
if (pwrite(dst_fd, lb, sizeof(lb), off) < 0)
diff --git a/repair/prefetch.c b/repair/prefetch.c
index 175594c..318cea1 100644
--- a/repair/prefetch.c
+++ b/repair/prefetch.c
@@ -465,7 +465,7 @@ pf_batch_read(
{
xfs_buf_t *bplist[MAX_BUFS];
unsigned int num;
- off64_t first_off, last_off, next_off;
+ off_t first_off, last_off, next_off;
int len, size;
int i;
int inode_bufs;
--
2.7.3
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply related [flat|nested] 37+ messages in thread
* [PATCH xfsprogs 10/14] replace sendfile64 by equivalent sendfile
[not found] <cover.1470555003.git.felix.janda@posteo.de>
` (7 preceding siblings ...)
2016-08-06 10:52 ` [PATCH xfsprogs 12/14] replace off64_t by off_t outside of public headers Felix Janda
@ 2016-08-06 11:03 ` Felix Janda
2016-08-09 7:39 ` Christoph Hellwig
2016-08-07 5:21 ` [PATCH xfsprogs 01/14] configure: use AC_SYS_LARGEFILE Felix Janda
` (4 subsequent siblings)
13 siblings, 1 reply; 37+ messages in thread
From: Felix Janda @ 2016-08-06 11:03 UTC (permalink / raw)
To: xfs
Signed-off-by: Felix Janda <felix.janda@posteo.de>
---
io/sendfile.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/io/sendfile.c b/io/sendfile.c
index c082acf..edd31c9 100644
--- a/io/sendfile.c
+++ b/io/sendfile.c
@@ -56,11 +56,11 @@ send_buffer(
*total = 0;
while (count > 0) {
- bytes = sendfile64(file->fd, fd, &off, bytes_remaining);
+ bytes = sendfile(file->fd, fd, &off, bytes_remaining);
if (bytes == 0)
break;
if (bytes < 0) {
- perror("sendfile64");
+ perror("sendfile");
return -1;
}
ops++;
--
2.7.3
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply related [flat|nested] 37+ messages in thread
* [PATCH xfsprogs 01/14] configure: use AC_SYS_LARGEFILE
[not found] <cover.1470555003.git.felix.janda@posteo.de>
` (8 preceding siblings ...)
2016-08-06 11:03 ` [PATCH xfsprogs 10/14] replace sendfile64 by equivalent sendfile Felix Janda
@ 2016-08-07 5:21 ` Felix Janda
2016-08-09 7:36 ` Christoph Hellwig
2016-08-07 5:28 ` [PATCH xfsprogs 02/14] remove unecessary definitions of _FILE_OFFSET_BITS Felix Janda
` (3 subsequent siblings)
13 siblings, 1 reply; 37+ messages in thread
From: Felix Janda @ 2016-08-07 5:21 UTC (permalink / raw)
To: xfs
The autoconf macro AC_SYS_LARGEFILE defines _FILE_OFFSET_BITS=64
where necessary to ensure that off_t and all interfaces using off_t
are 64bit, even on 32bit systems.
Signed-off-by: Felix Janda <felix.janda@posteo.de>
---
configure.ac | 2 ++
1 file changed, 2 insertions(+)
diff --git a/configure.ac b/configure.ac
index 1bb5fef..8fa96a5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -107,6 +107,8 @@ AC_PACKAGE_UTILITIES(xfsprogs)
AC_MULTILIB($enable_lib64)
AC_RT($enable_librt)
+AC_SYS_LARGEFILE
+
AC_PACKAGE_NEED_UUID_H
AC_PACKAGE_NEED_UUIDCOMPARE
--
2.7.3
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply related [flat|nested] 37+ messages in thread
* [PATCH xfsprogs 02/14] remove unecessary definitions of _FILE_OFFSET_BITS
[not found] <cover.1470555003.git.felix.janda@posteo.de>
` (9 preceding siblings ...)
2016-08-07 5:21 ` [PATCH xfsprogs 01/14] configure: use AC_SYS_LARGEFILE Felix Janda
@ 2016-08-07 5:28 ` Felix Janda
2016-08-09 7:36 ` Christoph Hellwig
2016-08-07 5:43 ` [PATCH xfsprogs 13/14] xfs.h: require transparent LFS Felix Janda
` (2 subsequent siblings)
13 siblings, 1 reply; 37+ messages in thread
From: Felix Janda @ 2016-08-07 5:28 UTC (permalink / raw)
To: xfs
now that we use AC_SYS_LARGEFILE, there is no need to explicitly
define _FILE_OFFSET_BITS.
Signed-off-by: Felix Janda <felix.janda@posteo.de>
---
include/builddefs.in | 2 +-
m4/package_libcdev.m4 | 9 ---------
2 files changed, 1 insertion(+), 10 deletions(-)
diff --git a/include/builddefs.in b/include/builddefs.in
index 7153d7a..d406615 100644
--- a/include/builddefs.in
+++ b/include/builddefs.in
@@ -114,7 +114,7 @@ GCCFLAGS = -funsigned-char -fno-strict-aliasing -Wall
# -Wbitwise -Wno-transparent-union -Wno-old-initializer -Wno-decl
ifeq ($(PKG_PLATFORM),linux)
-PCFLAGS = -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 $(GCCFLAGS)
+PCFLAGS = -D_GNU_SOURCE $(GCCFLAGS)
ifeq ($(HAVE_UMODE_T),yes)
PCFLAGS += -DHAVE_UMODE_T
endif
diff --git a/m4/package_libcdev.m4 b/m4/package_libcdev.m4
index 7a847e9..9ef6f80 100644
--- a/m4/package_libcdev.m4
+++ b/m4/package_libcdev.m4
@@ -5,7 +5,6 @@ AC_DEFUN([AC_HAVE_FADVISE],
[ AC_MSG_CHECKING([for fadvise ])
AC_TRY_COMPILE([
#define _GNU_SOURCE
-#define _FILE_OFFSET_BITS 64
#include <fcntl.h>
], [
posix_fadvise(0, 1, 0, POSIX_FADV_NORMAL);
@@ -22,7 +21,6 @@ AC_DEFUN([AC_HAVE_MADVISE],
[ AC_MSG_CHECKING([for madvise ])
AC_TRY_COMPILE([
#define _GNU_SOURCE
-#define _FILE_OFFSET_BITS 64
#include <sys/mman.h>
], [
posix_madvise(0, 0, MADV_NORMAL);
@@ -39,7 +37,6 @@ AC_DEFUN([AC_HAVE_MINCORE],
[ AC_MSG_CHECKING([for mincore ])
AC_TRY_COMPILE([
#define _GNU_SOURCE
-#define _FILE_OFFSET_BITS 64
#include <sys/mman.h>
], [
mincore(0, 0, 0);
@@ -56,7 +53,6 @@ AC_DEFUN([AC_HAVE_SENDFILE],
[ AC_MSG_CHECKING([for sendfile ])
AC_TRY_COMPILE([
#define _GNU_SOURCE
-#define _FILE_OFFSET_BITS 64
#include <sys/sendfile.h>
], [
sendfile(0, 0, 0, 0);
@@ -106,7 +102,6 @@ AC_DEFUN([AC_HAVE_FALLOCATE],
[ AC_MSG_CHECKING([for fallocate])
AC_TRY_LINK([
#define _GNU_SOURCE
-#define _FILE_OFFSET_BITS 64
#include <fcntl.h>
#include <linux/falloc.h>
], [
@@ -124,7 +119,6 @@ AC_DEFUN([AC_HAVE_FIEMAP],
[ AC_MSG_CHECKING([for fiemap])
AC_TRY_LINK([
#define _GNU_SOURCE
-#define _FILE_OFFSET_BITS 64
#include <linux/fs.h>
#include <linux/fiemap.h>
], [
@@ -142,7 +136,6 @@ AC_DEFUN([AC_HAVE_FIEMAP],
AC_DEFUN([AC_HAVE_PREADV],
[ AC_MSG_CHECKING([for preadv])
AC_TRY_LINK([
-#define _FILE_OFFSET_BITS 64
#define _BSD_SOURCE
#include <sys/uio.h>
], [
@@ -177,7 +170,6 @@ AC_DEFUN([AC_HAVE_SYNC_FILE_RANGE],
[ AC_MSG_CHECKING([for sync_file_range])
AC_TRY_LINK([
#define _GNU_SOURCE
-#define _FILE_OFFSET_BITS 64
#include <fcntl.h>
], [
sync_file_range(0, 0, 0, 0);
@@ -194,7 +186,6 @@ AC_DEFUN([AC_HAVE_SYNCFS],
[ AC_MSG_CHECKING([for syncfs])
AC_TRY_LINK([
#define _GNU_SOURCE
-#define _FILE_OFFSET_BITS 64
#include <unistd.h>
], [
syncfs(0);
--
2.7.3
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply related [flat|nested] 37+ messages in thread
* [PATCH xfsprogs 13/14] xfs.h: require transparent LFS
[not found] <cover.1470555003.git.felix.janda@posteo.de>
` (10 preceding siblings ...)
2016-08-07 5:28 ` [PATCH xfsprogs 02/14] remove unecessary definitions of _FILE_OFFSET_BITS Felix Janda
@ 2016-08-07 5:43 ` Felix Janda
2016-08-09 7:41 ` Christoph Hellwig
2016-08-07 5:52 ` [PATCH xfsprogs 14/14] platform: remove use of off64_t Felix Janda
2016-08-07 6:24 ` [PATCH xfsprogs 11/14] replace statvfs64 by equivalent statvfs Felix Janda
13 siblings, 1 reply; 37+ messages in thread
From: Felix Janda @ 2016-08-07 5:43 UTC (permalink / raw)
To: xfs
Since our interfaces depend on the consistent use of a 64bit offset
type, we force downstreams to use transparent LFS
(_FILE_OFFSET_BITS=64), so that it becomes impossible for them to use
32bit interfaces.
Signed-off-by: Felix Janda <felix.janda@posteo.de>
---
include/xfs.h | 2 ++
1 file changed, 2 insertions(+)
diff --git a/include/xfs.h b/include/xfs.h
index 7bed957..37c95fe 100644
--- a/include/xfs.h
+++ b/include/xfs.h
@@ -47,6 +47,8 @@
# error unknown platform... have fun porting!
#endif
+extern int xfs_assert_largefile[sizeof(off_t)-8];
+
/*
* sparse kernel source annotations
*/
--
2.7.3
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply related [flat|nested] 37+ messages in thread
* [PATCH xfsprogs 14/14] platform: remove use of off64_t
[not found] <cover.1470555003.git.felix.janda@posteo.de>
` (11 preceding siblings ...)
2016-08-07 5:43 ` [PATCH xfsprogs 13/14] xfs.h: require transparent LFS Felix Janda
@ 2016-08-07 5:52 ` Felix Janda
2016-08-09 7:41 ` Christoph Hellwig
2016-08-07 6:24 ` [PATCH xfsprogs 11/14] replace statvfs64 by equivalent statvfs Felix Janda
13 siblings, 1 reply; 37+ messages in thread
From: Felix Janda @ 2016-08-07 5:52 UTC (permalink / raw)
To: xfs
Since we force transparent LFS for downstreams, it can be replaced
by off_t.
Signed-off-by: Felix Janda <felix.janda@posteo.de>
---
include/darwin.h | 1 -
include/freebsd.h | 1 -
include/irix.h | 2 +-
include/linux.h | 2 +-
4 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/include/darwin.h b/include/darwin.h
index bd1a112..1f3f789 100644
--- a/include/darwin.h
+++ b/include/darwin.h
@@ -134,7 +134,6 @@ typedef signed long long int __s64;
#define __uint16_t u_int16_t
#define __uint32_t u_int32_t
#define __uint64_t u_int64_t
-#define off64_t off_t
typedef off_t xfs_off_t;
typedef u_int64_t xfs_ino_t;
diff --git a/include/freebsd.h b/include/freebsd.h
index df924ef..93a9204 100644
--- a/include/freebsd.h
+++ b/include/freebsd.h
@@ -41,7 +41,6 @@
#define EFSBADCRC 991 /* Bad CRC detected */
typedef off_t xfs_off_t;
-typedef off_t off64_t;
typedef __uint64_t xfs_ino_t;
typedef __uint32_t xfs_dev_t;
typedef __int64_t xfs_daddr_t;
diff --git a/include/irix.h b/include/irix.h
index b92e01b..a212505 100644
--- a/include/irix.h
+++ b/include/irix.h
@@ -43,7 +43,7 @@
#define __int16_t short
#define __uint8_t unsigned char
#define __uint16_t unsigned short
-typedef off64_t xfs_off_t;
+typedef off_t xfs_off_t;
typedef __int64_t xfs_ino_t;
typedef __int32_t xfs_dev_t;
typedef __int64_t xfs_daddr_t;
diff --git a/include/linux.h b/include/linux.h
index 5614719..ed388ea 100644
--- a/include/linux.h
+++ b/include/linux.h
@@ -137,7 +137,7 @@ platform_discard_blocks(int fd, uint64_t start, uint64_t len)
#define EFSCORRUPTED EUCLEAN /* Filesystem is corrupted */
#define EFSBADCRC EBADMSG /* Bad CRC detected */
-typedef off64_t xfs_off_t;
+typedef off_t xfs_off_t;
typedef __uint64_t xfs_ino_t;
typedef __uint32_t xfs_dev_t;
typedef __int64_t xfs_daddr_t;
--
2.7.3
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply related [flat|nested] 37+ messages in thread
* [PATCH xfsprogs 11/14] replace statvfs64 by equivalent statvfs
[not found] <cover.1470555003.git.felix.janda@posteo.de>
` (12 preceding siblings ...)
2016-08-07 5:52 ` [PATCH xfsprogs 14/14] platform: remove use of off64_t Felix Janda
@ 2016-08-07 6:24 ` Felix Janda
2016-08-09 7:40 ` Christoph Hellwig
13 siblings, 1 reply; 37+ messages in thread
From: Felix Janda @ 2016-08-07 6:24 UTC (permalink / raw)
To: xfs
For this it was necessary to change a workaround for missing
f_brsize on Mac OS X.
Signed-off-by: Felix Janda <felix.janda@posteo.de>
---
fsr/xfs_fsr.c | 16 ++++------------
include/darwin.h | 4 ++--
2 files changed, 6 insertions(+), 14 deletions(-)
diff --git a/fsr/xfs_fsr.c b/fsr/xfs_fsr.c
index 98390e7..f3cc07e 100644
--- a/fsr/xfs_fsr.c
+++ b/fsr/xfs_fsr.c
@@ -89,7 +89,7 @@ static void fsrallfs(char *mtab, int howlong, char *leftofffile);
static void fsrall_cleanup(int timeout);
static int getnextents(int);
int xfsrtextsize(int fd);
-int xfs_getrt(int fd, struct statvfs64 *sfbp);
+int xfs_getrt(int fd, struct statvfs *sfbp);
char * gettmpname(char *fname);
char * getparent(char *fname);
int fsrprintf(const char *fmt, ...);
@@ -888,7 +888,7 @@ fsrfile_common(
xfs_bstat_t *statp)
{
int error;
- struct statvfs64 vfss;
+ struct statvfs vfss;
struct fsxattr fsx;
unsigned long bsize;
@@ -940,16 +940,12 @@ fsrfile_common(
* Note that xfs_bstat.bs_blksize returns the filesystem blocksize,
* not the optimal I/O size as struct stat.
*/
- if (statvfs64(fsname ? fsname : fname, &vfss) < 0) {
+ if (statvfs(fsname ? fsname : fname, &vfss) < 0) {
fsrprintf(_("unable to get fs stat on %s: %s\n"),
fname, strerror(errno));
return -1;
}
-#ifndef statvfs64
bsize = vfss.f_frsize ? vfss.f_frsize : vfss.f_bsize;
-#else
- bsize = vfss.f_bsize;
-#endif
if (statp->bs_blksize * statp->bs_blocks >
vfss.f_bfree * bsize - minimumfree) {
fsrprintf(_("insufficient freespace for: %s: "
@@ -1704,7 +1700,7 @@ xfs_getgeom(int fd, xfs_fsop_geom_v1_t * fsgeom)
* Get xfs realtime space information
*/
int
-xfs_getrt(int fd, struct statvfs64 *sfbp)
+xfs_getrt(int fd, struct statvfs *sfbp)
{
unsigned long bsize;
unsigned long factor;
@@ -1717,11 +1713,7 @@ xfs_getrt(int fd, struct statvfs64 *sfbp)
close(fd);
return -1;
}
-#ifndef statvfs64
bsize = (sfbp->f_frsize ? sfbp->f_frsize : sfbp->f_bsize);
-#else
- bsize = sfbp->f_bsize;
-#endif
factor = fsgeom.blocksize / bsize; /* currently this is == 1 */
sfbp->f_bfree = (cnt.freertx * fsgeom.rtextsize) * factor;
return 0;
diff --git a/include/darwin.h b/include/darwin.h
index fb13915..bd1a112 100644
--- a/include/darwin.h
+++ b/include/darwin.h
@@ -216,8 +216,8 @@ static inline int timer_gettime (timer_t timerid, struct itimerspec *value)
# include <sys/param.h>
#include <sys/ucred.h>
#include <errno.h>
-#define statvfs64 statfs
-#define _PATH_MOUNTED "/etc/mtab"
+#define f_frsize f_bsize
+#define _PATH_MOUNTED "/etc/mtab"
struct mntent
{
--
2.7.3
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply related [flat|nested] 37+ messages in thread
* Re: [PATCH xfsprogs 01/14] configure: use AC_SYS_LARGEFILE
2016-08-07 5:21 ` [PATCH xfsprogs 01/14] configure: use AC_SYS_LARGEFILE Felix Janda
@ 2016-08-09 7:36 ` Christoph Hellwig
2016-08-09 17:41 ` Felix Janda
0 siblings, 1 reply; 37+ messages in thread
From: Christoph Hellwig @ 2016-08-09 7:36 UTC (permalink / raw)
To: Felix Janda; +Cc: xfs
Good plan:
Reviewed-by: Christoph Hellwig <hch@lst.de>
Does this also error out for libraries that don't support large
off_t at all? I think that would be helpful to add if not there yet.
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 37+ messages in thread
* Re: [PATCH xfsprogs 02/14] remove unecessary definitions of _FILE_OFFSET_BITS
2016-08-07 5:28 ` [PATCH xfsprogs 02/14] remove unecessary definitions of _FILE_OFFSET_BITS Felix Janda
@ 2016-08-09 7:36 ` Christoph Hellwig
0 siblings, 0 replies; 37+ messages in thread
From: Christoph Hellwig @ 2016-08-09 7:36 UTC (permalink / raw)
To: Felix Janda; +Cc: xfs
Looks fine,
Reviewed-by: Christoph Hellwig <hch@lst.de>
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 37+ messages in thread
* Re: [PATCH xfsprogs 03/14] replace fstat64 by equivalent fstat
2016-08-06 10:45 ` [PATCH xfsprogs 03/14] replace fstat64 by equivalent fstat Felix Janda
@ 2016-08-09 7:36 ` Christoph Hellwig
0 siblings, 0 replies; 37+ messages in thread
From: Christoph Hellwig @ 2016-08-09 7:36 UTC (permalink / raw)
To: Felix Janda; +Cc: xfs
Looks fine,
Reviewed-by: Christoph Hellwig <hch@lst.de>
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 37+ messages in thread
* Re: [PATCH xfsprogs 04/14] replace lstat64 by equivalent lstat
2016-08-06 10:45 ` [PATCH xfsprogs 04/14] replace lstat64 by equivalent lstat Felix Janda
@ 2016-08-09 7:37 ` Christoph Hellwig
0 siblings, 0 replies; 37+ messages in thread
From: Christoph Hellwig @ 2016-08-09 7:37 UTC (permalink / raw)
To: Felix Janda; +Cc: xfs
Looks fine,
Reviewed-by: Christoph Hellwig <hch@lst.de>
if for some reasons this has to be respun and reposted I'd do all
calls of a family (e.g. stat/lstat/fstat) in one patch, though.
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 37+ messages in thread
* Re: [PATCH xfsprogs 05/14] replace stat64 by equivalent stat
2016-08-06 10:45 ` [PATCH xfsprogs 05/14] replace stat64 by equivalent stat Felix Janda
@ 2016-08-09 7:37 ` Christoph Hellwig
0 siblings, 0 replies; 37+ messages in thread
From: Christoph Hellwig @ 2016-08-09 7:37 UTC (permalink / raw)
To: Felix Janda; +Cc: xfs
Looks fine,
Reviewed-by: Christoph Hellwig <hch@lst.de>
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 37+ messages in thread
* Re: [PATCH xfsprogs 06/14] replace ftruncate64 by equivalent ftruncate
2016-08-06 10:45 ` [PATCH xfsprogs 06/14] replace ftruncate64 by equivalent ftruncate Felix Janda
@ 2016-08-09 7:38 ` Christoph Hellwig
0 siblings, 0 replies; 37+ messages in thread
From: Christoph Hellwig @ 2016-08-09 7:38 UTC (permalink / raw)
To: Felix Janda; +Cc: xfs
Looks fine,
Reviewed-by: Christoph Hellwig <hch@lst.de>
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 37+ messages in thread
* Re: [PATCH xfsprogs 07/14] replace lseek64 by equivalent lseek
2016-08-06 10:45 ` [PATCH xfsprogs 07/14] replace lseek64 by equivalent lseek Felix Janda
@ 2016-08-09 7:38 ` Christoph Hellwig
0 siblings, 0 replies; 37+ messages in thread
From: Christoph Hellwig @ 2016-08-09 7:38 UTC (permalink / raw)
To: Felix Janda; +Cc: xfs
Looks fine,
Reviewed-by: Christoph Hellwig <hch@lst.de>
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 37+ messages in thread
* Re: [PATCH xfsprogs 08/14] replace pread64 by equivalent pread
2016-08-06 10:45 ` [PATCH xfsprogs 08/14] replace pread64 by equivalent pread Felix Janda
@ 2016-08-09 7:38 ` Christoph Hellwig
0 siblings, 0 replies; 37+ messages in thread
From: Christoph Hellwig @ 2016-08-09 7:38 UTC (permalink / raw)
To: Felix Janda; +Cc: xfs
Looks fine,
Reviewed-by: Christoph Hellwig <hch@lst.de>
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 37+ messages in thread
* Re: [PATCH xfsprogs 09/14] replace pwrite64 by equivalent pwrite
2016-08-06 10:45 ` [PATCH xfsprogs 09/14] replace pwrite64 by equivalent pwrite Felix Janda
@ 2016-08-09 7:39 ` Christoph Hellwig
0 siblings, 0 replies; 37+ messages in thread
From: Christoph Hellwig @ 2016-08-09 7:39 UTC (permalink / raw)
To: Felix Janda; +Cc: xfs
Looks fine,
Reviewed-by: Christoph Hellwig <hch@lst.de>
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 37+ messages in thread
* Re: [PATCH xfsprogs 10/14] replace sendfile64 by equivalent sendfile
2016-08-06 11:03 ` [PATCH xfsprogs 10/14] replace sendfile64 by equivalent sendfile Felix Janda
@ 2016-08-09 7:39 ` Christoph Hellwig
0 siblings, 0 replies; 37+ messages in thread
From: Christoph Hellwig @ 2016-08-09 7:39 UTC (permalink / raw)
To: Felix Janda; +Cc: xfs
Looks fine,
Reviewed-by: Christoph Hellwig <hch@lst.de>
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 37+ messages in thread
* Re: [PATCH xfsprogs 11/14] replace statvfs64 by equivalent statvfs
2016-08-07 6:24 ` [PATCH xfsprogs 11/14] replace statvfs64 by equivalent statvfs Felix Janda
@ 2016-08-09 7:40 ` Christoph Hellwig
2016-08-09 17:41 ` Felix Janda
0 siblings, 1 reply; 37+ messages in thread
From: Christoph Hellwig @ 2016-08-09 7:40 UTC (permalink / raw)
To: Felix Janda; +Cc: xfs
On Sun, Aug 07, 2016 at 08:24:40AM +0200, Felix Janda wrote:
> For this it was necessary to change a workaround for missing
> f_brsize on Mac OS X.
If we can get rid of that it'd be fine, but can you explain a bit
more why we can get rid of it?
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 37+ messages in thread
* Re: [PATCH xfsprogs 12/14] replace off64_t by off_t outside of public headers
2016-08-06 10:52 ` [PATCH xfsprogs 12/14] replace off64_t by off_t outside of public headers Felix Janda
@ 2016-08-09 7:40 ` Christoph Hellwig
0 siblings, 0 replies; 37+ messages in thread
From: Christoph Hellwig @ 2016-08-09 7:40 UTC (permalink / raw)
To: Felix Janda; +Cc: xfs
Looks fine,
Reviewed-by: Christoph Hellwig <hch@lst.de>
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 37+ messages in thread
* Re: [PATCH xfsprogs 13/14] xfs.h: require transparent LFS
2016-08-07 5:43 ` [PATCH xfsprogs 13/14] xfs.h: require transparent LFS Felix Janda
@ 2016-08-09 7:41 ` Christoph Hellwig
2016-08-09 18:03 ` [PATCHv2 " Felix Janda
0 siblings, 1 reply; 37+ messages in thread
From: Christoph Hellwig @ 2016-08-09 7:41 UTC (permalink / raw)
To: Felix Janda; +Cc: xfs
> +extern int xfs_assert_largefile[sizeof(off_t)-8];
Please add a comment on why we have this declaration, otherwise this
looks fine to me:
Reviewed-by: Christoph Hellwig <hch@lst.de>
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 37+ messages in thread
* Re: [PATCH xfsprogs 14/14] platform: remove use of off64_t
2016-08-07 5:52 ` [PATCH xfsprogs 14/14] platform: remove use of off64_t Felix Janda
@ 2016-08-09 7:41 ` Christoph Hellwig
0 siblings, 0 replies; 37+ messages in thread
From: Christoph Hellwig @ 2016-08-09 7:41 UTC (permalink / raw)
To: Felix Janda; +Cc: xfs
Looks fine,
Reviewed-by: Christoph Hellwig <hch@lst.de>
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 37+ messages in thread
* Re: [PATCH xfsprogs 01/14] configure: use AC_SYS_LARGEFILE
2016-08-09 7:36 ` Christoph Hellwig
@ 2016-08-09 17:41 ` Felix Janda
2016-08-12 2:57 ` Christoph Hellwig
0 siblings, 1 reply; 37+ messages in thread
From: Felix Janda @ 2016-08-09 17:41 UTC (permalink / raw)
To: Christoph Hellwig; +Cc: xfs
Thanks for reviewing the patch series!
> Does this also error out for libraries that don't support large
> off_t at all? I think that would be helpful to add if not there yet.
I do not quite understand. Do you refer to libraries using libxfs or
the external libraries used by xfsprogs?
For the latter, none of them exports interfaces using off_t. libblkid
has its own blkid_loff_t, which is defined as int64_t.
For the former, patch 13 forces any user of libxfs to enable
transparent LFS, by for example adding AC_SYS_LARGEFILE.
The approach of libblkid is the same as what I was suggesting in a
previous patch, but maybe it is good to break applications using
libxfs and not transparent LFS. For example this seems to be the case
for ceph. It has not enabled transparent LFS but mixes off_t and
off64_t. So it is likely that it has some LFS related runtime bugs on
32bit systems. If the xfs header included the off_t size check,
building ceph on 32bit systems would lead to a less subtle compile
failure.
Felix
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 37+ messages in thread
* Re: [PATCH xfsprogs 11/14] replace statvfs64 by equivalent statvfs
2016-08-09 7:40 ` Christoph Hellwig
@ 2016-08-09 17:41 ` Felix Janda
2016-08-12 2:57 ` Christoph Hellwig
0 siblings, 1 reply; 37+ messages in thread
From: Felix Janda @ 2016-08-09 17:41 UTC (permalink / raw)
To: Christoph Hellwig; +Cc: xfs
Christoph Hellwig wrote:
> On Sun, Aug 07, 2016 at 08:24:40AM +0200, Felix Janda wrote:
> > For this it was necessary to change a workaround for missing
> > f_brsize on Mac OS X.
>
> If we can get rid of that it'd be fine, but can you explain a bit
> more why we can get rid of it?
Since we are using transparent LFS, statvfs64 is the same as statvfs,
if statvfs64 is defined at all. In commit b35b4eb8f91d13a326213f989e
it was noticed that OS X is missing statvfs64, and a define was added
to darwin.h. The same commit also fixes the absense of the f_brsize
field in struct statfs on OS X by adding code conditional on the
statvfs64 define. (Notice that this condition might have false
positives. Indeed, on linux with musl libc, statvfs64 is also a
define.)
This patch removes the usage of statvfs64 and thus one of the problems
for Mac OS X. The other problem is solved by giving a suitable
definition of f_brsize. Note that this might collide with other uses
of f_brsize (if they exist). It might be cleaner to just check for Mac
OS X in xfs_fsr.c.
Felix
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 37+ messages in thread
* Re: [PATCHv2 xfsprogs 13/14] xfs.h: require transparent LFS
2016-08-09 7:41 ` Christoph Hellwig
@ 2016-08-09 18:03 ` Felix Janda
2016-08-12 2:56 ` Christoph Hellwig
0 siblings, 1 reply; 37+ messages in thread
From: Felix Janda @ 2016-08-09 18:03 UTC (permalink / raw)
To: Christoph Hellwig; +Cc: xfs
Since our interfaces depend on the consistent use of a 64bit offset
type, force downstreams to use transparent LFS (_FILE_OFFSET_BITS=64),
so that it becomes impossible for them to use 32bit interfaces.
Signed-off-by: Felix Janda <felix.janda@posteo.de>
---
Christoph Hellwig wrote:
> > +extern int xfs_assert_largefile[sizeof(off_t)-8];
>
> Please add a comment on why we have this declaration, otherwise this
> looks fine to me:
>
> Reviewed-by: Christoph Hellwig <hch@lst.de>
A simple comment is added.
---
include/xfs.h | 5 ++
1 file changed, 5 insertions(+)
diff --git a/include/xfs.h b/include/xfs.h
index 7bed957..37c95fe 100644
--- a/include/xfs.h
+++ b/include/xfs.h
@@ -47,6 +47,11 @@
# error unknown platform... have fun porting!
#endif
+/*
+ * make sure that any user of the xfs headers has a 64bit off_t type
+ */
+extern int xfs_assert_largefile[sizeof(off_t)-8];
+
/*
* sparse kernel source annotations
*/
--
2.7.3
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply related [flat|nested] 37+ messages in thread
* Re: [PATCHv2 xfsprogs 13/14] xfs.h: require transparent LFS
2016-08-09 18:03 ` [PATCHv2 " Felix Janda
@ 2016-08-12 2:56 ` Christoph Hellwig
0 siblings, 0 replies; 37+ messages in thread
From: Christoph Hellwig @ 2016-08-12 2:56 UTC (permalink / raw)
To: Felix Janda; +Cc: Christoph Hellwig, xfs
Looks fine,
Reviewed-by: Christoph Hellwig <hch@lst.de>
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 37+ messages in thread
* Re: [PATCH xfsprogs 11/14] replace statvfs64 by equivalent statvfs
2016-08-09 17:41 ` Felix Janda
@ 2016-08-12 2:57 ` Christoph Hellwig
2016-08-12 17:03 ` Felix Janda
0 siblings, 1 reply; 37+ messages in thread
From: Christoph Hellwig @ 2016-08-12 2:57 UTC (permalink / raw)
To: Felix Janda; +Cc: Christoph Hellwig, xfs
On Tue, Aug 09, 2016 at 07:41:58PM +0200, Felix Janda wrote:
> This patch removes the usage of statvfs64 and thus one of the problems
> for Mac OS X. The other problem is solved by giving a suitable
> definition of f_brsize. Note that this might collide with other uses
> of f_brsize (if they exist). It might be cleaner to just check for Mac
> OS X in xfs_fsr.c.
Yes, that's probably better. Or simply not build fsr on MacOS given
that there is no kernel XFS support anyway..
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 37+ messages in thread
* Re: [PATCH xfsprogs 01/14] configure: use AC_SYS_LARGEFILE
2016-08-09 17:41 ` Felix Janda
@ 2016-08-12 2:57 ` Christoph Hellwig
2016-08-12 16:54 ` Felix Janda
0 siblings, 1 reply; 37+ messages in thread
From: Christoph Hellwig @ 2016-08-12 2:57 UTC (permalink / raw)
To: Felix Janda; +Cc: Christoph Hellwig, xfs
On Tue, Aug 09, 2016 at 07:41:05PM +0200, Felix Janda wrote:
> Thanks for reviewing the patch series!
>
> > Does this also error out for libraries that don't support large
> > off_t at all? I think that would be helpful to add if not there yet.
>
> I do not quite understand. Do you refer to libraries using libxfs or
> the external libraries used by xfsprogs?
I meant C libraries, sorry. E.g. uclibc used to not support LFS
many years ago, although they probably fixed it up by now.
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 37+ messages in thread
* Re: [PATCH xfsprogs 01/14] configure: use AC_SYS_LARGEFILE
2016-08-12 2:57 ` Christoph Hellwig
@ 2016-08-12 16:54 ` Felix Janda
2016-08-12 20:23 ` Christoph Hellwig
0 siblings, 1 reply; 37+ messages in thread
From: Felix Janda @ 2016-08-12 16:54 UTC (permalink / raw)
To: Christoph Hellwig; +Cc: xfs
Christoph Hellwig wrote:
> On Tue, Aug 09, 2016 at 07:41:05PM +0200, Felix Janda wrote:
> > Thanks for reviewing the patch series!
> >
> > > Does this also error out for libraries that don't support large
> > > off_t at all? I think that would be helpful to add if not there yet.
> >
> > I do not quite understand. Do you refer to libraries using libxfs or
> > the external libraries used by xfsprogs?
>
> I meant C libraries, sorry. E.g. uclibc used to not support LFS
> many years ago, although they probably fixed it up by now.
Thaks for clarifying.
If a libc does not support LFS, with this patch series the build will
fail soon, because of the off_t size check in xfs.h.
The support of transparent LFS in different c libraries on linux seems
to be the following:
glibc: since version 2.2 (2000)
uClibc: since version 0.9.11 (2002)
dietlibc: since version 0.8 (2001)
klibc: AFAICS since beginning only transparent LFS
musl: since beginning only transparent LFS
bionic: In 2015 _FILE_OFFSET_BITS was implemented "mostly"...
newlib: (except on cygwin) does not seem to have support for transparent LFS
Note that LFS can be configured out of uClibc. However its headers
error out when it is configured out and an application sets
_FILE_OFFSET_BITS. (So in the case of xfsprogs it would have errored
out in this situation already earlier.)
So it seems that this patch series breaks newlib support...
Felix
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 37+ messages in thread
* Re: [PATCH xfsprogs 11/14] replace statvfs64 by equivalent statvfs
2016-08-12 2:57 ` Christoph Hellwig
@ 2016-08-12 17:03 ` Felix Janda
0 siblings, 0 replies; 37+ messages in thread
From: Felix Janda @ 2016-08-12 17:03 UTC (permalink / raw)
To: Christoph Hellwig; +Cc: xfs
Christoph Hellwig wrote:
> On Tue, Aug 09, 2016 at 07:41:58PM +0200, Felix Janda wrote:
> > This patch removes the usage of statvfs64 and thus one of the problems
> > for Mac OS X. The other problem is solved by giving a suitable
> > definition of f_brsize. Note that this might collide with other uses
> > of f_brsize (if they exist). It might be cleaner to just check for Mac
> > OS X in xfs_fsr.c.
>
> Yes, that's probably better. Or simply not build fsr on MacOS given
> that there is no kernel XFS support anyway..
That second option sounds interesting. If fsr was not built on Mac OS X,
then commit 7141fc5b04905e (add *mntent abstraction) can basically be
reverted, simplifying the platform headers a bit.
Felix
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 37+ messages in thread
* Re: [PATCH xfsprogs 01/14] configure: use AC_SYS_LARGEFILE
2016-08-12 16:54 ` Felix Janda
@ 2016-08-12 20:23 ` Christoph Hellwig
0 siblings, 0 replies; 37+ messages in thread
From: Christoph Hellwig @ 2016-08-12 20:23 UTC (permalink / raw)
To: Felix Janda; +Cc: Christoph Hellwig, xfs
On Fri, Aug 12, 2016 at 06:54:40PM +0200, Felix Janda wrote:
> glibc: since version 2.2 (2000)
> uClibc: since version 0.9.11 (2002)
> dietlibc: since version 0.8 (2001)
> klibc: AFAICS since beginning only transparent LFS
> musl: since beginning only transparent LFS
> bionic: In 2015 _FILE_OFFSET_BITS was implemented "mostly"...
> newlib: (except on cygwin) does not seem to have support for transparent LFS
>
> Note that LFS can be configured out of uClibc. However its headers
> error out when it is configured out and an application sets
> _FILE_OFFSET_BITS. (So in the case of xfsprogs it would have errored
> out in this situation already earlier.)
>
>
> So it seems that this patch series breaks newlib support...
I think that's fine, newlib hasn't every really been a supported
config. The point I tried to make is that we should aim to error
out during ./configure for this case.
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 37+ messages in thread
end of thread, other threads:[~2016-08-12 20:23 UTC | newest]
Thread overview: 37+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <cover.1470555003.git.felix.janda@posteo.de>
2016-08-06 10:45 ` [PATCH xfsprogs 03/14] replace fstat64 by equivalent fstat Felix Janda
2016-08-09 7:36 ` Christoph Hellwig
2016-08-06 10:45 ` [PATCH xfsprogs 04/14] replace lstat64 by equivalent lstat Felix Janda
2016-08-09 7:37 ` Christoph Hellwig
2016-08-06 10:45 ` [PATCH xfsprogs 05/14] replace stat64 by equivalent stat Felix Janda
2016-08-09 7:37 ` Christoph Hellwig
2016-08-06 10:45 ` [PATCH xfsprogs 06/14] replace ftruncate64 by equivalent ftruncate Felix Janda
2016-08-09 7:38 ` Christoph Hellwig
2016-08-06 10:45 ` [PATCH xfsprogs 07/14] replace lseek64 by equivalent lseek Felix Janda
2016-08-09 7:38 ` Christoph Hellwig
2016-08-06 10:45 ` [PATCH xfsprogs 08/14] replace pread64 by equivalent pread Felix Janda
2016-08-09 7:38 ` Christoph Hellwig
2016-08-06 10:45 ` [PATCH xfsprogs 09/14] replace pwrite64 by equivalent pwrite Felix Janda
2016-08-09 7:39 ` Christoph Hellwig
2016-08-06 10:52 ` [PATCH xfsprogs 12/14] replace off64_t by off_t outside of public headers Felix Janda
2016-08-09 7:40 ` Christoph Hellwig
2016-08-06 11:03 ` [PATCH xfsprogs 10/14] replace sendfile64 by equivalent sendfile Felix Janda
2016-08-09 7:39 ` Christoph Hellwig
2016-08-07 5:21 ` [PATCH xfsprogs 01/14] configure: use AC_SYS_LARGEFILE Felix Janda
2016-08-09 7:36 ` Christoph Hellwig
2016-08-09 17:41 ` Felix Janda
2016-08-12 2:57 ` Christoph Hellwig
2016-08-12 16:54 ` Felix Janda
2016-08-12 20:23 ` Christoph Hellwig
2016-08-07 5:28 ` [PATCH xfsprogs 02/14] remove unecessary definitions of _FILE_OFFSET_BITS Felix Janda
2016-08-09 7:36 ` Christoph Hellwig
2016-08-07 5:43 ` [PATCH xfsprogs 13/14] xfs.h: require transparent LFS Felix Janda
2016-08-09 7:41 ` Christoph Hellwig
2016-08-09 18:03 ` [PATCHv2 " Felix Janda
2016-08-12 2:56 ` Christoph Hellwig
2016-08-07 5:52 ` [PATCH xfsprogs 14/14] platform: remove use of off64_t Felix Janda
2016-08-09 7:41 ` Christoph Hellwig
2016-08-07 6:24 ` [PATCH xfsprogs 11/14] replace statvfs64 by equivalent statvfs Felix Janda
2016-08-09 7:40 ` Christoph Hellwig
2016-08-09 17:41 ` Felix Janda
2016-08-12 2:57 ` Christoph Hellwig
2016-08-12 17:03 ` Felix Janda
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.