]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
platform: Add statvfs64 for OS X
authorJan Tulak <jtulak@redhat.com>
Tue, 13 Oct 2015 23:58:24 +0000 (10:58 +1100)
committerDave Chinner <david@fromorbit.com>
Tue, 13 Oct 2015 23:58:24 +0000 (10:58 +1100)
Simply rename statvfs64 to statfs with a #define.
OSX version of statvfs is missing some members, so if the renaming
is in effect (stavfs64 is defined), don't try to use them and go
directly for the other member value.

Signed-off-by: Jan Tulak <jtulak@redhat.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
fsr/xfs_fsr.c
include/builddefs.in
include/darwin.h

index e1b7bd6c0330823ec4c1a793ff93df570ae4e8a3..c8ef18fca3e9c6cebd1616ef36f9c676044c0dcc 100644 (file)
@@ -948,7 +948,11 @@ 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: "
@@ -1728,7 +1732,11 @@ 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;
index 25b8816ba75041544bac971c73cadc21b46a3362..31e21baba58385b776107942cd16041c17ccf53b 100644 (file)
@@ -123,7 +123,7 @@ PCFLAGS = -D_GNU_SOURCE $(GCCFLAGS)
 endif
 ifeq ($(PKG_PLATFORM),darwin)
 PCFLAGS = $(GCCFLAGS)
-DEPENDFLAGS = -D__APPLE__
+DEPENDFLAGS = -D__APPLE__ -D_DARWIN_FEATURE_64_BIT_INODE
 endif
 ifeq ($(PKG_PLATFORM),irix)
 PLDLIBS = -ldisk -lgen
index 0d2f17582ba431661b77d14ac9265f5093f07a67..288ad1fb8e48ee277237af45dc550c15e1c3d662 100644 (file)
@@ -216,4 +216,9 @@ static inline int timer_gettime (timer_t timerid, struct itimerspec *value)
        return getitimer(ITIMER_REAL, value);
 }
 
+/* FSR */
+
+#define statvfs64 statfs
+#define                _PATH_MOUNTED   "/etc/mtab"
+
 #endif /* __XFS_DARWIN_H__ */