replace fstat64 by equivalent fstat
A message that is not in the archive (sent off-list or not yet received): [email protected]
PATCH 1/14 configure: use AC_SYS_LARGEFILE
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.
--- configure.ac | 2 ++ 1 file changed, 2 insertions(+)
configure.ac +2 -0
@@ -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
Signature · 6 lines
2.7.3 _______________________________________________ xfs mailing list [email protected] http://oss.sgi.com/mailman/listinfo/xfs
Re: [PATCH xfsprogs 01/14] configure: use AC_SYS_LARGEFILE
Good plan:
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
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
Re: [PATCH xfsprogs 01/14] configure: use AC_SYS_LARGEFILE
Thanks for reviewing the patch series!
Quoted 2 lines
Does this also error out for libraries that don't support large
off_tat 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
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
Re: [PATCH xfsprogs 01/14] configure: use AC_SYS_LARGEFILE
Quoted 7 lines · Felix Janda
Thanks for reviewing the patch series!
Quoted 2 lines
Does this also error out for libraries that don't support large
off_tat 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
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
Re: [PATCH xfsprogs 01/14] configure: use AC_SYS_LARGEFILE
Quoted 11 lines · Christoph Hellwig
Quoted 7 lines · Felix Janda
Thanks for reviewing the patch series!
Quoted 2 lines
Does this also error out for libraries that don't support large
off_tat 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
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
Re: [PATCH xfsprogs 01/14] configure: use AC_SYS_LARGEFILE
Quoted 8 lines · Felix Janda
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_BITSwas implemented "mostly"...
newlib: (except on cygwin) does not seem to have support for transparent LFS
Quoted 7 lines
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
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
PATCH 2/14 remove unecessary definitions of _FILE_OFFSET_BITS
In reply to a message not in the archivenow that we use AC_SYS_LARGEFILE, there is no need to explicitly define _FILE_OFFSET_BITS.
--- include/builddefs.in | 2 +- m4/package_libcdev.m4 | 9 --------- 2 files changed, 1 insertion(+), 10 deletions(-)
include/builddefs.in +1 -1
@@ -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
m4/package_libcdev.m4 +0 -9
@@ -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);
Signature · 6 lines
2.7.3 _______________________________________________ xfs mailing list [email protected] http://oss.sgi.com/mailman/listinfo/xfs
Re: [PATCH xfsprogs 02/14] remove unecessary definitions of _FILE_OFFSET_BITS
Looks fine,
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
PATCH 3/14 replace fstat64 by equivalent fstat
In reply to a message not in the archive--- 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(-)
copy/xfs_copy.c +1 -1
@@ -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 ();
fsr/xfs_fsr.c +2 -2
@@ -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 ;
include/darwin.h +0 -1
@@ -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
include/freebsd.h +0 -1
@@ -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
io/copy_file_range.c +2 -2
@@ -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;
io/open.c +6 -6
@@ -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 ) {
io/sendfile.c +2 -2
@@ -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;
libxfs/darwin.c +1 -1
@@ -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));
libxfs/init.c +1 -1
@@ -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 );
libxfs/irix.c +1 -1
@@ -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));
libxfs/linux.c +2 -2
@@ -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));
mkfs/proto.c +1 -1
@@ -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; }
repair/xfs_repair.c +1 -1
@@ -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))
Signature · 6 lines
2.7.3 _______________________________________________ xfs mailing list [email protected] http://oss.sgi.com/mailman/listinfo/xfs
Looks fine,
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
PATCH 4/14 replace lstat64 by equivalent lstat
In reply to a message not in the archive--- fsr/xfs_fsr.c | 4 ++-- include/darwin.h | 1 - 2 files changed, 2 insertions(+), 3 deletions(-)
fsr/xfs_fsr.c +2 -2
@@ -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); }
include/darwin.h +0 -1
@@ -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
Signature · 6 lines
2.7.3 _______________________________________________ xfs mailing list [email protected] http://oss.sgi.com/mailman/listinfo/xfs
Re: [PATCH xfsprogs 04/14] replace lstat64 by equivalent lstat
Looks fine,
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
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
PATCH 5/14 replace stat64 by equivalent stat
In reply to a message not in the archive--- 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(-)
copy/xfs_copy.c +3 -3
@@ -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);
fsr/xfs_fsr.c +13 -13
@@ -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 ;
include/darwin.h +1 -2
@@ -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
include/freebsd.h +0 -1
@@ -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
io/copy_file_range.c +1 -1
@@ -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" );
io/open.c +3 -3
@@ -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" );
io/sendfile.c +1 -1
@@ -133,7 +133,7 @@ sendfile_f( goto done; } }else { -struct stat64 stat; +struct stat stat;if (fstat (fd, &stat) <0 ) {perror ("fstat" );
libxcmd/paths.c +2 -2
@@ -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
libxfs/darwin.c +3 -3
@@ -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,
libxfs/freebsd.c +4 -4
@@ -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;
libxfs/init.c +5 -5
@@ -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 ; }
libxfs/init.h +3 -3
@@ -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);
libxfs/irix.c +3 -3
@@ -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,
libxfs/linux.c +8 -8
@@ -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 fatavoid 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;
mdrestore/xfs_mdrestore.c +3 -3
@@ -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 ;
mkfs/proto.c +1 -1
@@ -782,7 +782,7 @@ static longfilesize ( int fd) { -struct stat64 stb; +struct stat stb;if (fstat (fd, &stb) <0 )return -1 ;
mkfs/xfs_mkfs.c +2 -2
@@ -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 ;
po/de.po +4 -4
@@ -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
po/pl.po +4 -4
@@ -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
repair/xfs_repair.c +1 -1
@@ -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"),
rtcp/xfs_rtcp.c +9 -9
@@ -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 */
Signature · 1 line
2.7.3
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
Re: [PATCH xfsprogs 05/14] replace stat64 by equivalent stat
Looks fine,
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
PATCH 6/14 replace ftruncate64 by equivalent ftruncate
In reply to a message not in the archive--- 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(-)
copy/xfs_copy.c +1 -1
@@ -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);
fsr/xfs_fsr.c +1 -1
@@ -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;
include/darwin.h +0 -1
@@ -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)
include/freebsd.h +0 -1
@@ -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
io/copy_file_range.c +2 -2
@@ -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; }
io/truncate.c +1 -1
@@ -38,7 +38,7 @@ truncate_f(return 0 ; } -if (ftruncate64 (file->fd, offset) <0 ) { +if (ftruncate (file->fd, offset) <0 ) {perror ("ftruncate" );return 0 ; }
mdrestore/xfs_mdrestore.c +1 -1
@@ -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 {
mkfs/xfs_mkfs.c +1 -1
@@ -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);
Signature · 6 lines
2.7.3 _______________________________________________ xfs mailing list [email protected] http://oss.sgi.com/mailman/listinfo/xfs
Re: [PATCH xfsprogs 06/14] replace ftruncate64 by equivalent ftruncate
Looks fine,
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
PATCH 7/14 replace lseek64 by equivalent lseek
In reply to a message not in the archive--- 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(-)
copy/xfs_copy.c +5 -5
@@ -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 (); }
fsr/xfs_fsr.c +5 -5
@@ -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;
include/darwin.h +0 -1
@@ -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
include/freebsd.h +0 -1
@@ -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
io/pread.c +3 -3
@@ -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 ;
io/seek.c +3 -3
@@ -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 ; }
libxfs/rdwr.c +1 -1
@@ -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));
logprint/log_misc.c +2 -2
@@ -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 ); }
logprint/logprint.c +1 -1
@@ -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 );
po/de.po +8 -8
@@ -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
po/pl.po +8 -8
@@ -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
repair/sb.c +3 -3
@@ -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);
Signature · 1 line
2.7.3
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
Re: [PATCH xfsprogs 07/14] replace lseek64 by equivalent lseek
Looks fine,
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
PATCH 8/14 replace pread64 by equivalent pread
In reply to a message not in the archive--- 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(-)
include/darwin.h +0 -1
@@ -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)
include/freebsd.h +0 -1
@@ -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)
io/pread.c +5 -5
@@ -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++;
libxfs/rdwr.c +1 -1
@@ -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"),
repair/prefetch.c +1 -1
@@ -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
Signature · 6 lines
2.7.3 _______________________________________________ xfs mailing list [email protected] http://oss.sgi.com/mailman/listinfo/xfs
Re: [PATCH xfsprogs 08/14] replace pread64 by equivalent pread
Looks fine,
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
PATCH 9/14 replace pwrite64 by equivalent pwrite
In reply to a message not in the archive--- 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(-)
copy/xfs_copy.c +1 -1
@@ -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"),
include/darwin.h +0 -1
@@ -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)
include/freebsd.h +0 -1
@@ -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)
io/pwrite.c +5 -5
@@ -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++;
libxfs/rdwr.c +3 -3
@@ -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 );
mdrestore/xfs_mdrestore.c +2 -2
@@ -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 )
mkfs/xfs_mkfs.c +1 -1
@@ -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 ; }
po/de.po +2 -2
@@ -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
po/pl.po +4 -4
@@ -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
Signature · 1 line
2.7.3
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
Re: [PATCH xfsprogs 09/14] replace pwrite64 by equivalent pwrite
Looks fine,
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
PATCH 10/14 replace sendfile64 by equivalent sendfile
In reply to a message not in the archive--- io/sendfile.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
io/sendfile.c +2 -2
@@ -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++;
Signature · 6 lines
2.7.3 _______________________________________________ xfs mailing list [email protected] http://oss.sgi.com/mailman/listinfo/xfs
Re: [PATCH xfsprogs 10/14] replace sendfile64 by equivalent sendfile
Looks fine,
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
PATCH 11/14 replace statvfs64 by equivalent statvfs
In reply to a message not in the archiveFor this it was necessary to change a workaround for missing f_brsize on Mac OS X.
--- fsr/xfs_fsr.c | 16 ++++------------ include/darwin.h | 4 ++-- 2 files changed, 6 insertions(+), 14 deletions(-)
fsr/xfs_fsr.c +4 -12
@@ -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 ;
include/darwin.h +2 -2
@@ -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 {
Signature · 6 lines
2.7.3 _______________________________________________ xfs mailing list [email protected] http://oss.sgi.com/mailman/listinfo/xfs
Re: [PATCH xfsprogs 11/14] replace statvfs64 by equivalent statvfs
Quoted 2 lines · Felix Janda
For this it was necessary to change a workaround for missing
f_brsizeon 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
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
Re: [PATCH xfsprogs 11/14] replace statvfs64 by equivalent statvfs
Quoted 6 lines · Christoph Hellwig
Quoted 2 lines · Felix Janda
For this it was necessary to change a workaround for missing
f_brsizeon 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
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
Re: [PATCH xfsprogs 11/14] replace statvfs64 by equivalent statvfs
Quoted 5 lines · Felix Janda
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 off_brsize(if they exist). It might be cleaner to just check for Mac OS X inxfs_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
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
Re: [PATCH xfsprogs 11/14] replace statvfs64 by equivalent statvfs
Quoted 9 lines · Christoph Hellwig
Quoted 5 lines · Felix Janda
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 off_brsize(if they exist). It might be cleaner to just check for Mac OS X inxfs_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
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
PATCH 12/14 replace off64_t by off_t outside of public headers
In reply to a message not in the archive--- 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(-)
copy/xfs_copy.c +1 -1
@@ -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 */
fsr/xfs_fsr.c +1 -1
@@ -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 ];
io/bmap.c +5 -5
@@ -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 ; }
io/copy_file_range.c +1 -1
@@ -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;
io/fadvise.c +1 -1
@@ -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 ) {
io/io.h +5 -5
@@ -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 );
io/madvise.c +1 -1
@@ -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;
io/mincore.c +1 -1
@@ -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;
io/mmap.c +6 -6
@@ -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;
io/open.c +1 -1
@@ -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;
io/pread.c +11 -11
@@ -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;
io/pwrite.c +9 -9
@@ -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;
io/reflink.c +2 -2
@@ -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;
io/seek.c +3 -3
@@ -75,8 +75,8 @@ voidseek_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 */
io/sendfile.c +3 -3
@@ -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;
io/sync_file_range.c +1 -1
@@ -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;
io/truncate.c +1 -1
@@ -28,7 +28,7 @@ truncate_f(int argc, char **argv) { - off64_t offset; + off_t offset;size_t blocksize, sectsize;init_cvtnum (&blocksize, §size);
libxfs/rdwr.c +4 -4
@@ -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,
mdrestore/xfs_mdrestore.c +1 -1
@@ -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 )
repair/prefetch.c +1 -1
@@ -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;
Signature · 6 lines
2.7.3 _______________________________________________ xfs mailing list [email protected] http://oss.sgi.com/mailman/listinfo/xfs
Re: [PATCH xfsprogs 12/14] replace off64_t by off_t outside of public headers
Looks fine,
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
PATCH 13/14 xfs.h: require transparent LFS
In reply to a message not in the archiveSince 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.
--- include/xfs.h | 2 ++ 1 file changed, 2 insertions(+)
include/xfs.h +2 -0
@@ -47,6 +47,8 @@# error unknown platform... have fun porting!#endif +extern int xfs_assert_largefile[sizeof (off_t)-8 ]; +/* * sparse kernel source annotations */
Signature · 6 lines
2.7.3 _______________________________________________ xfs mailing list [email protected] http://oss.sgi.com/mailman/listinfo/xfs
Re: [PATCH xfsprogs 13/14] xfs.h: require transparent LFS
Quoted 1 line
+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:
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
Re: [PATCHv2 xfsprogs 13/14] xfs.h: require transparent LFS
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.
---
Quoted 6 lines · Christoph Hellwig
Quoted 1 line
+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 <[email protected]>
A simple comment is added.
--- include/xfs.h | 5 ++ 1 file changed, 5 insertions(+)
include/xfs.h +5 -0
@@ -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 */
Signature · 6 lines
2.7.3 _______________________________________________ xfs mailing list [email protected] http://oss.sgi.com/mailman/listinfo/xfs
Christoph Hellwig
Reviewed-byRe: [PATCHv2 xfsprogs 13/14] xfs.h: require transparent LFS
Looks fine,
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
PATCH 14/14 platform: remove use of off64_t
In reply to a message not in the archiveSince we force transparent LFS for downstreams, it can be replaced by off_t.
--- include/darwin.h | 1 - include/freebsd.h | 1 - include/irix.h | 2 +- include/linux.h | 2 +- 4 files changed, 2 insertions(+), 4 deletions(-)
include/darwin.h +0 -1
@@ -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_ttypedef off_t xfs_off_t ;typedef u_int64_t xfs_ino_t ;
include/freebsd.h +0 -1
@@ -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 ;
include/irix.h +1 -1
@@ -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 ;
include/linux.h +1 -1
@@ -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 ;
Signature · 6 lines
2.7.3 _______________________________________________ xfs mailing list [email protected] http://oss.sgi.com/mailman/listinfo/xfs
Re: [PATCH xfsprogs 14/14] platform: remove use of off64_t
Looks fine,
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs