Convert from off64_t to off_t
v2 cover Convert from off64_t to off_t
This patch series does several things related to large file support.
Patches 1-3 enable transparent LFS in the build system and make it mandatory.
Patches 4-9 and 12 replace *64 function and structure aliases.
Patches 10 and 11 disable fsr on Mac OS X and do cleanup to enable Patch 12. Further cleanup of the portability code is possible later.
Patch 13 makes tranparent LFS also mandatory for all users of libxfs.
Patch 14 finally replaces off64_t by off_t.
In comparison to v1:
Patches 1, 3 and 14 are identical to previous patches. Patches 4-8 are identical to previous patches, except that some of them are merged. Patch 9 was previously send separately from the patch series. Patch 13 is identical to a previous patch except for the commit message. The other patches are new, grown out of review by Christoph Hellwig.
Felix Janda (14):
configure: use AC_SYS_LARGEFILE
configure: error out when LFS does not work
remove unecessary definitions of _FILE_OFFSET_BITS replace [fl]stat64 by equivalent [fl]stat
replace ftruncate64 by equivalent ftruncate
replace lseek64 by equivalent lseek
replace pread64/pwrite64 by equivalent pread/pwrite replace sendfile64 by equivalent sendfile
fadvise.c: replace posix_fadvise64 by equivalent posix_fadvise
Makefile: disable fsr for Mac OS X
fsr: remove workaround for statvfs on Mac OS X replace statvfs64 by equivalent statvfs
xfs.h: require transparent LFS for all users
platform: remove use of off64_t
Makefile | 6 ++++- configure.ac | 3 +++ copy/xfs_copy.c | 22 ++++++++--------- fsr/xfs_fsr.c | 62 +++++++++++++++++++++-------------------------- include/builddefs.in | 2 +- include/darwin.h | 9 ------- include/freebsd.h | 7 ------ include/irix.h | 2 +- include/linux.h | 2 +- include/xfs.h | 5 ++++ io/copy_file_range.c | 10 ++++---- io/fadvise.c | 2 +- io/open.c | 18 +++++++------- io/pread.c | 16 ++++++------ io/pwrite.c | 10 ++++---- io/seek.c | 6 ++--- io/sendfile.c | 10 ++++---- io/truncate.c | 2 +- libxcmd/paths.c | 4 +-- libxfs/darwin.c | 8 +++--- libxfs/freebsd.c | 8 +++--- libxfs/init.c | 12 ++++----- libxfs/init.h | 6 ++--- libxfs/irix.c | 8 +++--- libxfs/linux.c | 20 +++++++-------- libxfs/rdwr.c | 10 ++++---- logprint/log_misc.c | 4 +-- logprint/logprint.c | 2 +- m4/package_libcdev.m4 | 25 ++++++++++++------- mdrestore/xfs_mdrestore.c | 12 ++++----- mkfs/proto.c | 4 +-- mkfs/xfs_mkfs.c | 8 +++--- po/de.po | 28 ++++++++++----------- po/pl.po | 32 ++++++++++++------------ repair/prefetch.c | 2 +- repair/sb.c | 6 ++--- repair/xfs_repair.c | 4 +-- rtcp/xfs_rtcp.c | 18 +++++++------- 38 files changed, 205 insertions(+), 210 deletions(-)
Signature · 6 lines
2.7.3 _______________________________________________ xfs mailing list [email protected] http://oss.sgi.com/mailman/listinfo/xfs
PATCH v2 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
PATCH v2 3/14 remove unecessary definitions of _FILE_OFFSET_BITS
In reply to Felix Jandanow 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
PATCH v2 4/14 replace [fl]stat64 by equivalent [fl]stat
In reply to Felix Janda--- copy/xfs_copy.c | 8 ++++---- fsr/xfs_fsr.c | 34 +++++++++++++++++----------------- include/darwin.h | 5 +---- include/freebsd.h | 2 -- io/copy_file_range.c | 6 +++--- io/open.c | 18 +++++++++--------- io/sendfile.c | 6 +++--- libxcmd/paths.c | 4 ++-- libxfs/darwin.c | 8 ++++---- libxfs/freebsd.c | 8 ++++---- libxfs/init.c | 12 ++++++------ libxfs/init.h | 6 +++--- libxfs/irix.c | 8 ++++---- libxfs/linux.c | 20 ++++++++++---------- mdrestore/xfs_mdrestore.c | 6 +++--- mkfs/proto.c | 4 ++-- mkfs/xfs_mkfs.c | 4 ++-- po/de.po | 8 ++++---- po/pl.po | 8 ++++---- repair/xfs_repair.c | 4 ++-- rtcp/xfs_rtcp.c | 18 +++++++++--------- 21 files changed, 96 insertions(+), 101 deletions(-)
copy/xfs_copy.c +4 -4
@@ -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 ]);
@@ -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 ();
@@ -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 +17 -17
@@ -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;
@@ -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));
@@ -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);
@@ -510,11 +510,11 @@ 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); } -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)
@@ -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 ;
@@ -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 +1 -4
@@ -141,8 +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 fstat64 fstat#define lseek64 lseek#define pread64 pread#define pwrite64 pwrite
@@ -222,8 +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 lstat64 lstat +#define statvfs64 statfs#define _PATH_MOUNTED "/etc/mtab"struct mntent
include/freebsd.h +0 -2
@@ -34,10 +34,8 @@#define __LITTLE_ENDIAN LITTLE_ENDIAN/* FreeBSD file API is 64-bit aware */ -#define fstat64 fstat#define ftruncate64 ftruncate#define lseek64 lseek -#define stat64 stat#define pwrite64 pwrite#define pread64 pread#define fdatasync fsync
io/copy_file_range.c +3 -3
@@ -60,10 +60,10 @@ 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 (fstat64 (fd, &st) <0 ) { -perror ("fstat64" ); +if (fstat (fd, &st) <0 ) { +perror ("fstat" );return -1 ; };return st.st_size;
io/open.c +9 -9
@@ -52,10 +52,10 @@ static long extsize;off64_t filesize (void ) { -struct stat64 st; +struct stat st; -if (fstat64 (file->fd, &st) <0 ) { -perror ("fstat64" ); +if (fstat (file->fd, &st) <0 ) { +perror ("fstat" );return -1 ; }return st.st_size;
@@ -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);
@@ -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));
@@ -574,10 +574,10 @@ static int set_extsize(const char *path, int fd, long extsz) { struct fsxattr fsx; -struct stat64 stat; +struct stat 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 +3 -3
@@ -133,10 +133,10 @@ sendfile_f( goto done; } }else { -struct stat64 stat; +struct stat stat; -if (fstat64 (fd, &stat) <0 ) { -perror ("fstat64" ); +if (fstat (fd, &stat) <0 ) { +perror ("fstat" ); goto done; } count = stat.st_size;
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 +4 -4
@@ -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,9 +69,9 @@ void platform_findsizes(char *path, int fd, long long *sz, int *bsz) {__uint64_t size; -struct stat64 st; +struct stat 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/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 +6 -6
@@ -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;
@@ -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 );
@@ -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 +4 -4
@@ -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,9 +51,9 @@ 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 (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 +10 -10
@@ -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,11 +125,11 @@ 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 ; -if (fstat64 (fd, &st) <0 ) +if (fstat (fd, &st) <0 )return ;if (S_ISREG (st.st_mode))
@@ -141,11 +141,11 @@ 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; -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));
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 +2 -2
@@ -782,9 +782,9 @@ static longfilesize ( int fd) { -struct stat64 stb; +struct stat stb; -if (fstat64 (fd, &stb) <0 ) +if (fstat (fd, &stb) <0 )return -1 ;return (long )stb.st_size; }
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 +2 -2
@@ -668,9 +668,9 @@ 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 (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))
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
PATCH v2 5/14 replace ftruncate64 by equivalent ftruncate
In reply to Felix Janda--- 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
PATCH v2 6/14 replace lseek64 by equivalent lseek
In reply to Felix Janda--- 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
PATCH v2 7/14 replace pread64/pwrite64 by equivalent pread/pwrite
In reply to Felix Janda--- copy/xfs_copy.c | 2 +- include/darwin.h | 2 -- include/freebsd.h | 2 -- io/pread.c | 10 +++++----- io/pwrite.c | 10 +++++----- libxfs/rdwr.c | 8 ++++---- mdrestore/xfs_mdrestore.c | 4 ++-- mkfs/xfs_mkfs.c | 2 +- po/de.po | 4 ++-- po/pl.po | 8 ++++---- repair/prefetch.c | 2 +- 11 files changed, 25 insertions(+), 29 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 -2
@@ -141,8 +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 -2
@@ -34,8 +34,6 @@#define __LITTLE_ENDIAN LITTLE_ENDIAN/* 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++;
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 +4 -4
@@ -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"),
@@ -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
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 · 1 line
2.7.3
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
PATCH v2 8/14 replace sendfile64 by equivalent sendfile
In reply to Felix Janda--- 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
PATCH v2 9/14 fadvise.c: replace posix_fadvise64 by equivalent posix_fadvise
In reply to Felix Jandaalso fixes a compile failure on FreeBSD
--- io/fadvise.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
io/fadvise.c +1 -1
@@ -103,7 +103,7 @@ fadvise_f(return command_usage (&fadvise_cmd); } -if (posix_fadvise64 (file->fd, offset, length, advise) <0 ) { +if (posix_fadvise (file->fd, offset, length, advise) <0 ) {perror ("fadvise" );return 0 ; }
Signature · 6 lines
2.7.3 _______________________________________________ xfs mailing list [email protected] http://oss.sgi.com/mailman/listinfo/xfs
PATCH v2 10/14 Makefile: disable fsr for Mac OS X
In reply to Felix JandaSince its kernel does not support XFS anyway this utility is not useful, and with its removal the portability framework can be simplified.
--- Makefile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
Makefile +5 -1
@@ -45,9 +45,13 @@ HDR_SUBDIRS = include libxfs DLIB_SUBDIRS = libxlog libxcmd libhandle LIB_SUBDIRS = libxfs $(DLIB_SUBDIRS) -TOOL_SUBDIRS = copy db estimate fsck fsr growfs io logprint mkfs quota \ +TOOL_SUBDIRS = copy db estimate fsck growfs io logprint mkfs quota \ mdrestore repair rtcp m4 man doc debian +ifneq ("$(PKG_PLATFORM)","darwin") +TOOL_SUBDIRS += fsr +endif + ifneq ("$(XGETTEXT)","") TOOL_SUBDIRS += po endif
Signature · 6 lines
2.7.3 _______________________________________________ xfs mailing list [email protected] http://oss.sgi.com/mailman/listinfo/xfs
PATCH v2 11/14 fsr: remove workaround for statvfs on Mac OS X
In reply to Felix JandaIt can be removed since fsr is no longer built on Mac OS X.
--- fsr/xfs_fsr.c | 8 -------- 1 file changed, 8 deletions(-)
fsr/xfs_fsr.c +0 -8
@@ -945,11 +945,7 @@ fsrfile_common( 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: "
@@ -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 ;
Signature · 6 lines
2.7.3 _______________________________________________ xfs mailing list [email protected] http://oss.sgi.com/mailman/listinfo/xfs
PATCH v2 12/14 replace statvfs64 by equivalent statvfs
In reply to Felix Janda--- fsr/xfs_fsr.c | 8 ++++---- include/darwin.h | 1 - 2 files changed, 4 insertions(+), 5 deletions(-)
fsr/xfs_fsr.c +4 -4
@@ -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,7 +940,7 @@ 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 ;
@@ -1700,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;
include/darwin.h +0 -1
@@ -216,7 +216,6 @@ 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"struct mntent
Signature · 6 lines
2.7.3 _______________________________________________ xfs mailing list [email protected] http://oss.sgi.com/mailman/listinfo/xfs
PATCH v2 13/14 xfs.h: require transparent LFS for all users
In reply to Felix JandaSince 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.
--- include/xfs.h | 5 +++++ 1 file changed, 5 insertions(+)
include/xfs.h +5 -0
@@ -48,6 +48,11 @@#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 */ #ifndef __user
Signature · 6 lines
2.7.3 _______________________________________________ xfs mailing list [email protected] http://oss.sgi.com/mailman/listinfo/xfs
PATCH v2 14/14 platform: remove use of off64_t
In reply to Felix JandaSince we force transparent LFS 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
PATCH v2 2/14 configure: error out when LFS does not work
In reply to Felix Janda--- configure.ac | 1 + m4/package_libcdev.m4 | 16 ++++++++++++++++ 2 files changed, 17 insertions(+)
configure.ac +1 -0
@@ -108,6 +108,7 @@ AC_MULTILIB($enable_lib64) AC_RT($enable_librt) AC_SYS_LARGEFILE +AC_NEED_LFS AC_PACKAGE_NEED_UUID_H AC_PACKAGE_NEED_UUIDCOMPARE
m4/package_libcdev.m4 +16 -0
@@ -265,3 +265,19 @@ AC_DEFUN([AC_HAVE_MREMAP], ) AC_SUBST(have_mremap) ]) + +# +# Check if transparent LFS is enabled +# +AC_DEFUN([AC_NEED_LFS], + [ AC_MSG_CHECKING([whether large file support works]) + AC_TRY_COMPILE([ +#include <unistd.h> + ], [ + int i[sizeof(off_t)-8]; + ], AC_MSG_RESULT(yes), + [AC_MSG_RESULT(no) + echo + echo 'FATAL ERROR: C library does not support transparent LFS.' + exit 1]) + ])
Signature · 6 lines
2.7.3 _______________________________________________ xfs mailing list [email protected] http://oss.sgi.com/mailman/listinfo/xfs
Re: [PATCHv2 xfsprogs 01/14] configure: use AC_SYS_LARGEFILE
In reply to Felix JandaQuoted 5 lines · Felix Janda
The autoconf macro
AC_SYS_LARGEFILEdefines _FILE_OFFSET_BITS=64 where necessary to ensure thatoff_tand all interfaces usingoff_tare 64bit, even on 32bit systems.Signed-off-by Felix Janda <[email protected]>
Thanks, this looks good:
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
Re: [PATCHv2 xfsprogs 02/14] configure: error out when LFS does not work
In reply to Felix JandaQuoted 1 line · Felix Janda
Signed-off-by Felix Janda <[email protected]>
Looks good,
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
Re: [PATCHv2 xfsprogs 03/14] remove unecessary definitions of _FILE_OFFSET_BITS
In reply to Felix JandaQuoted 2 lines · Felix Janda
now that we use
AC_SYS_LARGEFILE, there is no need to explicitly define_FILE_OFFSET_BITS.
Looks good,
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
Re: [PATCHv2 xfsprogs 04/14] replace [fl]stat64 by equivalent [fl]stat
In reply to Felix JandaLooks good,
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
Re: [PATCHv2 xfsprogs 05/14] replace ftruncate64 by equivalent ftruncate
In reply to Felix JandaLooks good,
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
Re: [PATCHv2 xfsprogs 06/14] replace lseek64 by equivalent lseek
In reply to Felix JandaLooks good,
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
Re: [PATCHv2 xfsprogs 07/14] replace pread64/pwrite64 by equivalent pread/pwrite
In reply to Felix JandaLooks good,
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
Re: [PATCHv2 xfsprogs 08/14] replace sendfile64 by equivalent sendfile
In reply to Felix JandaLooks good,
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
Re: [PATCHv2 xfsprogs 09/14] fadvise.c: replace posix_fadvise64 by equivalent posix_fadvise
In reply to Felix JandaQuoted 3 lines · Felix Janda
also fixes a compile failure on FreeBSD
Signed-off-by Felix Janda <[email protected]>
Looks fine,
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
Re: [PATCHv2 xfsprogs 10/14] Makefile: disable fsr for Mac OS X
In reply to Felix JandaQuoted 5 lines · Felix Janda
Since its kernel does not support XFS anyway this utility is not useful, and with its removal the portability framework can be simplified.
Signed-off-by Felix Janda <[email protected]>
Looks fine,
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
Re: [PATCHv2 xfsprogs 11/14] fsr: remove workaround for statvfs on Mac OS X
In reply to Felix JandaQuoted 3 lines · Felix Janda
It can be removed since fsr is no longer built on Mac OS X.
Signed-off-by Felix Janda <[email protected]>
Looks fine,
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
Re: [PATCHv2 xfsprogs 12/14] replace statvfs64 by equivalent statvfs
In reply to Felix JandaLooks fine,
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
Re: [PATCHv2 xfsprogs 13/14] xfs.h: require transparent LFS for all users
In reply to Felix JandaQuoted 5 lines · Felix Janda
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 <[email protected]>
Looks fine,
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
Re: [PATCHv2 xfsprogs 14/14] platform: remove use of off64_t
In reply to Felix JandaLooks fine,
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
Quoted 5 lines · Felix Janda
This patch series does several things related to large file support.
Patches 1-3 enable transparent LFS in the build system and make it mandatory.
Quoted 8 lines
Patches 4-9 and 12 replace *64 function and structure aliases.
Patches 10 and 11 disable fsr on Mac OS X and do cleanup to enable Patch 12. Further cleanup of the portability code is possible later.
Patch 13 makes tranparent LFS also mandatory for all users of libxfs.
Patch 14 finally replaces
off64_tbyoff_t.
Felix, can you check how you are sending these patches? The last two sets of patches you've sent have not threaded in the correct order (they thread in a random order) which means I have to manually reorder the patch set to get it to apply in the correct order via git am....
Cheers,
Dave.
Signature · 7 lines
Dave Chinner [email protected] _______________________________________________ xfs mailing list [email protected] http://oss.sgi.com/mailman/listinfo/xfs
Quoted 13 lines · Dave Chinner
Quoted 12 lines · Felix Janda
This patch series does several things related to large file support.
Patches 1-3 enable transparent LFS in the build system and make it mandatory.
Patches 4-9 and 12 replace *64 function and structure aliases.
Patches 10 and 11 disable fsr on Mac OS X and do cleanup to enable Patch 12. Further cleanup of the portability code is possible later.
Patch 13 makes tranparent LFS also mandatory for all users of libxfs.
Quoted 7 lines
Quoted 1 line
Patch 14 finally replaces
off64_tbyoff_t.Felix, can you check how you are sending these patches? The last two sets of patches you've sent have not threaded in the correct order (they thread in a random order) which means I have to manually reorder the patch set to get it to apply in the correct order via git am....
I am sorry for that. Should I resend the patch series?
Cheers,
Felix
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
Quoted 16 lines · Felix Janda
Quoted 15 lines · Dave Chinner
Quoted 13 lines · Felix Janda
This patch series does several things related to large file support.
Patches 1-3 enable transparent LFS in the build system and make it mandatory.
Patches 4-9 and 12 replace *64 function and structure aliases.
Patches 10 and 11 disable fsr on Mac OS X and do cleanup to enable Patch 12. Further cleanup of the portability code is possible later.
Patch 13 makes tranparent LFS also mandatory for all users of libxfs.
Patch 14 finally replaces
off64_tbyoff_t.
Quoted 7 lines
Quoted 5 lines
Felix, can you check how you are sending these patches? The last two sets of patches you've sent have not threaded in the correct order (they thread in a random order) which means I have to manually reorder the patch set to get it to apply in the correct order via git am....
I am sorry for that. Should I resend the patch series?
No, I've re-ordered it appropriately.
Cheers,
Dave.
Signature · 7 lines
Dave Chinner [email protected] _______________________________________________ xfs mailing list [email protected] http://oss.sgi.com/mailman/listinfo/xfs
Quoted 11 lines · Dave Chinner
Quoted 8 lines · Felix Janda
Quoted 5 lines · Dave Chinner
Felix, can you check how you are sending these patches? The last two sets of patches you've sent have not threaded in the correct order (they thread in a random order) which means I have to manually reorder the patch set to get it to apply in the correct order via git am....
I am sorry for that. Should I resend the patch series?
No, I've re-ordered it appropriately.
Ok. Anyway thanks for drawing my attention to the ordering issues. (I was not quite aware that git am does not take the patch numbers in the subject into account.)
Felix
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
Quoted 23 lines · Felix Janda
This patch series does several things related to large file support.
Patches 1-3 enable transparent LFS in the build system and make it mandatory.
Patches 4-9 and 12 replace *64 function and structure aliases.
Patches 10 and 11 disable fsr on Mac OS X and do cleanup to enable Patch 12. Further cleanup of the portability code is possible later.
Patch 13 makes tranparent LFS also mandatory for all users of libxfs.
Patch 14 finally replaces
off64_tbyoff_t.In comparison to v1:
Patches 1, 3 and 14 are identical to previous patches. Patches 4-8 are identical to previous patches, except that some of them are merged. Patch 9 was previously send separately from the patch series. Patch 13 is identical to a previous patch except for the commit message. The other patches are new, grown out of review by Christoph Hellwig.
Quoted 15 lines
Felix Janda (14):
configure: useAC_SYS_LARGEFILE
configure: error out when LFS does not work
remove unecessary definitions of_FILE_OFFSET_BITSreplace [fl]stat64 by equivalent [fl]stat
replace ftruncate64 by equivalent ftruncate
replace lseek64 by equivalent lseek
replace pread64/pwrite64 by equivalent pread/pwrite replace sendfile64 by equivalent sendfile
fadvise.c: replaceposix_fadvise64by equivalentposix_fadvise
Makefile: disable fsr for Mac OS X
fsr: remove workaround for statvfs on Mac OS X replace statvfs64 by equivalent statvfs
xfs.h: require transparent LFS for all users
platform: remove use ofoff64_t
So, the patches are fine, and everything works. Problem is, it screws up xfstests because it changes all the error messages that are output to stderr and captured by the test harness. There are quite a few tests that this causes failures for, and because it's stderr, it's not as simple as just adding a new filter to do 'sed -e "s/^\(.*\)64\(: .*$\)/\1\2/"' on stderr.
Further, errors returned change, which further screws up xfstests. e.g. old code gives EFBIG when we try to use offsets beyond the supported range, this patchset returns EINVAL. That further complicates any sort of error filtering we'll need to do.
I don't have the time or patience to fix up xfstests for every change that people want to make and this series is a non-critical cleanup, so I'm dropping this until the fixups for xfstests are worked out. I'm not going to get to this for weeks at the current rate patches are being thrown at me for inclusion, so I'm not breaking xfstests for everyone while I'm bottlenecked on other, higher priority changes.
Cheers,
Dave.
Signature · 7 lines
Dave Chinner [email protected] _______________________________________________ xfs mailing list [email protected] http://oss.sgi.com/mailman/listinfo/xfs
Quoted 40 lines · Dave Chinner
Quoted 23 lines · Felix Janda
This patch series does several things related to large file support.
Patches 1-3 enable transparent LFS in the build system and make it mandatory.
Patches 4-9 and 12 replace *64 function and structure aliases.
Patches 10 and 11 disable fsr on Mac OS X and do cleanup to enable Patch 12. Further cleanup of the portability code is possible later.
Patch 13 makes tranparent LFS also mandatory for all users of libxfs.
Patch 14 finally replaces
off64_tbyoff_t.In comparison to v1:
Patches 1, 3 and 14 are identical to previous patches. Patches 4-8 are identical to previous patches, except that some of them are merged. Patch 9 was previously send separately from the patch series. Patch 13 is identical to a previous patch except for the commit message. The other patches are new, grown out of review by Christoph Hellwig.
Quoted 15 lines
Felix Janda (14):
configure: useAC_SYS_LARGEFILE
configure: error out when LFS does not work
remove unecessary definitions of_FILE_OFFSET_BITSreplace [fl]stat64 by equivalent [fl]stat
replace ftruncate64 by equivalent ftruncate
replace lseek64 by equivalent lseek
replace pread64/pwrite64 by equivalent pread/pwrite replace sendfile64 by equivalent sendfile
fadvise.c: replaceposix_fadvise64by equivalentposix_fadvise
Makefile: disable fsr for Mac OS X
fsr: remove workaround for statvfs on Mac OS X replace statvfs64 by equivalent statvfs
xfs.h: require transparent LFS for all users
platform: remove use ofoff64_t
Quoted 6 lines
So, the patches are fine, and everything works. Problem is, it screws up xfstests because it changes all the error messages that are output to stderr and captured by the test harness. There are quite a few tests that this causes failures for, and because it's stderr, it's not as simple as just adding a new filter to do 'sed -e "s/^\(.*\)64\(: .*$\)/\1\2/"' on stderr.
Thanks for testing!
I can rework the patches to leave stderr unchanged. I guess that this is preferable as opposed to updating the output expected by xfstests since xfstests should be usable with both old and new xfsprogs.
Quoted 4 lines
Further, errors returned change, which further screws up xfstests. e.g. old code gives EFBIG when we try to use offsets beyond the supported range, this patchset returns EINVAL. That further complicates any sort of error filtering we'll need to do.
I am very surprised that something apart from the error messages has changed. I would be interested to know on what architecture and for which test(s) (where) this happened, if you still remember.
Quoted 7 lines
I don't have the time or patience to fix up xfstests for every change that people want to make and this series is a non-critical cleanup, so I'm dropping this until the fixups for xfstests are worked out. I'm not going to get to this for weeks at the current rate patches are being thrown at me for inclusion, so I'm not breaking xfstests for everyone while I'm bottlenecked on other, higher priority changes.
That make sense.
--Felix
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
Quoted 11 lines · Felix Janda
Quoted 5 lines
screws up xfstests because it changes all the error messages that are output to stderr and captured by the test harness. There are quite a few tests that this causes failures for, and because it's stderr, it's not as simple as just adding a new filter to do 'sed -e "s/^\(.*\)64\(: .*$\)/\1\2/"' on stderr.
Thanks for testing!
I can rework the patches to leave stderr unchanged. I guess that this is preferable as opposed to updating the output expected by xfstests since xfstests should be usable with both old and new xfsprogs.
I would prefer to change the output if we can find a good way to filter it. I suspect the issues are things like perror lines which would look odd if we leave the 64 back in.
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
Quoted 8 lines · Felix Janda
Quoted 6 lines · Dave Chinner
So, the patches are fine, and everything works. Problem is, it screws up xfstests because it changes all the error messages that are output to stderr and captured by the test harness. There are quite a few tests that this causes failures for, and because it's stderr, it's not as simple as just adding a new filter to do 'sed -e "s/^\(.*\)64\(: .*$\)/\1\2/"' on stderr.
Quoted 5 lines
Thanks for testing!
I can rework the patches to leave stderr unchanged. I guess that this is preferable as opposed to updating the output expected by xfstests since xfstests should be usable with both old and new xfsprogs.
Well, normally the thing that needs to change is xfstests. We have to handle all sorts of issues like this (core-utils people seem to change error messge format at least once a year). it just more complex for xfs_io because we've got to filter both stdout and stderr separately and not cross the streams.
Quoted 8 lines
Quoted 4 lines
Further, errors returned change, which further screws up xfstests. e.g. old code gives EFBIG when we try to use offsets beyond the supported range, this patchset returns EINVAL. That further complicates any sort of error filtering we'll need to do.
I am very surprised that something apart from the error messages has changed. I would be interested to know on what architecture and for which test(s) (where) this happened, if you still remember.
Turns out this was a false detection - the test captures EINVAL error message and turns it into a EFBIG error message, probably because at one stage it was EFBIG. So the errno didn't change, just the error filter didn't match and convert....
Quoted 9 lines · Christoph Hellwig
Quoted 8 lines · Felix Janda
Quoted 5 lines
screws up xfstests because it changes all the error messages that are output to stderr and captured by the test harness. There are quite a few tests that this causes failures for, and because it's stderr, it's not as simple as just adding a new filter to do 'sed -e "s/^\(.*\)64\(: .*$\)/\1\2/"' on stderr.
Thanks for testing!
Quoted 7 lines
Quoted 3 lines
I can rework the patches to leave stderr unchanged. I guess that this is preferable as opposed to updating the output expected by xfstests since xfstests should be usable with both old and new xfsprogs.
I would prefer to change the output if we can find a good way to filter it. I suspect the issues are things like perror lines which would look odd if we leave the 64 back in.
right, it's pwrite64 -> pwrite that is the main issue. And yes, I would prefer to filter it, too.
Cheers,
Dave.
Signature · 7 lines
Dave Chinner [email protected] _______________________________________________ xfs mailing list [email protected] http://oss.sgi.com/mailman/listinfo/xfs