All of lore.kernel.org
 help / color / mirror / Atom feed
From: Felix Janda <felix.janda@posteo.de>
To: xfs@oss.sgi.com
Subject: [PATCH xfsprogs 11/14] replace statvfs64 by equivalent statvfs
Date: Sun, 7 Aug 2016 08:24:40 +0200	[thread overview]
Message-ID: <f4fc0b97ae8cdb30f1e0b0d55521f136877b33f5.1470555003.git.felix.janda@posteo.de> (raw)
In-Reply-To: <cover.1470555003.git.felix.janda@posteo.de>

For this it was necessary to change a workaround for missing
f_brsize on Mac OS X.

Signed-off-by: Felix Janda <felix.janda@posteo.de>
---
 fsr/xfs_fsr.c    | 16 ++++------------
 include/darwin.h |  4 ++--
 2 files changed, 6 insertions(+), 14 deletions(-)

diff --git a/fsr/xfs_fsr.c b/fsr/xfs_fsr.c
index 98390e7..f3cc07e 100644
--- a/fsr/xfs_fsr.c
+++ b/fsr/xfs_fsr.c
@@ -89,7 +89,7 @@ static void fsrallfs(char *mtab, int howlong, char *leftofffile);
 static void fsrall_cleanup(int timeout);
 static int  getnextents(int);
 int xfsrtextsize(int fd);
-int xfs_getrt(int fd, struct statvfs64 *sfbp);
+int xfs_getrt(int fd, struct statvfs *sfbp);
 char * gettmpname(char *fname);
 char * getparent(char *fname);
 int fsrprintf(const char *fmt, ...);
@@ -888,7 +888,7 @@ fsrfile_common(
 	xfs_bstat_t	*statp)
 {
 	int		error;
-	struct statvfs64 vfss;
+	struct statvfs vfss;
 	struct fsxattr	fsx;
 	unsigned long	bsize;
 
@@ -940,16 +940,12 @@ fsrfile_common(
 	 * Note that xfs_bstat.bs_blksize returns the filesystem blocksize,
 	 * not the optimal I/O size as struct stat.
 	 */
-	if (statvfs64(fsname ? fsname : fname, &vfss) < 0) {
+	if (statvfs(fsname ? fsname : fname, &vfss) < 0) {
 		fsrprintf(_("unable to get fs stat on %s: %s\n"),
 			fname, strerror(errno));
 		return -1;
 	}
-#ifndef statvfs64
 	bsize = vfss.f_frsize ? vfss.f_frsize : vfss.f_bsize;
-#else
-	bsize = vfss.f_bsize;
-#endif
 	if (statp->bs_blksize * statp->bs_blocks >
 	    vfss.f_bfree * bsize - minimumfree) {
 		fsrprintf(_("insufficient freespace for: %s: "
@@ -1704,7 +1700,7 @@ xfs_getgeom(int fd, xfs_fsop_geom_v1_t * fsgeom)
  * Get xfs realtime space information
  */
 int
-xfs_getrt(int fd, struct statvfs64 *sfbp)
+xfs_getrt(int fd, struct statvfs *sfbp)
 {
 	unsigned long	bsize;
 	unsigned long	factor;
@@ -1717,11 +1713,7 @@ xfs_getrt(int fd, struct statvfs64 *sfbp)
 		close(fd);
 		return -1;
 	}
-#ifndef statvfs64
 	bsize = (sfbp->f_frsize ? sfbp->f_frsize : sfbp->f_bsize);
-#else
-	bsize = sfbp->f_bsize;
-#endif
 	factor = fsgeom.blocksize / bsize;         /* currently this is == 1 */
 	sfbp->f_bfree = (cnt.freertx * fsgeom.rtextsize) * factor;
 	return 0;
diff --git a/include/darwin.h b/include/darwin.h
index fb13915..bd1a112 100644
--- a/include/darwin.h
+++ b/include/darwin.h
@@ -216,8 +216,8 @@ static inline int timer_gettime (timer_t timerid, struct itimerspec *value)
 #  include <sys/param.h>
 #include <sys/ucred.h>
 #include <errno.h>
-#define statvfs64	statfs
-#define		_PATH_MOUNTED   "/etc/mtab"
+#define f_frsize	f_bsize
+#define _PATH_MOUNTED	"/etc/mtab"
 
 struct mntent
 {
-- 
2.7.3

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

  parent reply	other threads:[~2016-08-07  7:35 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <cover.1470555003.git.felix.janda@posteo.de>
2016-08-06 10:45 ` [PATCH xfsprogs 03/14] replace fstat64 by equivalent fstat Felix Janda
2016-08-09  7:36   ` Christoph Hellwig
2016-08-06 10:45 ` [PATCH xfsprogs 04/14] replace lstat64 by equivalent lstat Felix Janda
2016-08-09  7:37   ` Christoph Hellwig
2016-08-06 10:45 ` [PATCH xfsprogs 05/14] replace stat64 by equivalent stat Felix Janda
2016-08-09  7:37   ` Christoph Hellwig
2016-08-06 10:45 ` [PATCH xfsprogs 06/14] replace ftruncate64 by equivalent ftruncate Felix Janda
2016-08-09  7:38   ` Christoph Hellwig
2016-08-06 10:45 ` [PATCH xfsprogs 07/14] replace lseek64 by equivalent lseek Felix Janda
2016-08-09  7:38   ` Christoph Hellwig
2016-08-06 10:45 ` [PATCH xfsprogs 08/14] replace pread64 by equivalent pread Felix Janda
2016-08-09  7:38   ` Christoph Hellwig
2016-08-06 10:45 ` [PATCH xfsprogs 09/14] replace pwrite64 by equivalent pwrite Felix Janda
2016-08-09  7:39   ` Christoph Hellwig
2016-08-06 10:52 ` [PATCH xfsprogs 12/14] replace off64_t by off_t outside of public headers Felix Janda
2016-08-09  7:40   ` Christoph Hellwig
2016-08-06 11:03 ` [PATCH xfsprogs 10/14] replace sendfile64 by equivalent sendfile Felix Janda
2016-08-09  7:39   ` Christoph Hellwig
2016-08-07  5:21 ` [PATCH xfsprogs 01/14] configure: use AC_SYS_LARGEFILE Felix Janda
2016-08-09  7:36   ` Christoph Hellwig
2016-08-09 17:41     ` Felix Janda
2016-08-12  2:57       ` Christoph Hellwig
2016-08-12 16:54         ` Felix Janda
2016-08-12 20:23           ` Christoph Hellwig
2016-08-07  5:28 ` [PATCH xfsprogs 02/14] remove unecessary definitions of _FILE_OFFSET_BITS Felix Janda
2016-08-09  7:36   ` Christoph Hellwig
2016-08-07  5:43 ` [PATCH xfsprogs 13/14] xfs.h: require transparent LFS Felix Janda
2016-08-09  7:41   ` Christoph Hellwig
2016-08-09 18:03     ` [PATCHv2 " Felix Janda
2016-08-12  2:56       ` Christoph Hellwig
2016-08-07  5:52 ` [PATCH xfsprogs 14/14] platform: remove use of off64_t Felix Janda
2016-08-09  7:41   ` Christoph Hellwig
2016-08-07  6:24 ` Felix Janda [this message]
2016-08-09  7:40   ` [PATCH xfsprogs 11/14] replace statvfs64 by equivalent statvfs Christoph Hellwig
2016-08-09 17:41     ` Felix Janda
2016-08-12  2:57       ` Christoph Hellwig
2016-08-12 17:03         ` Felix Janda

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f4fc0b97ae8cdb30f1e0b0d55521f136877b33f5.1470555003.git.felix.janda@posteo.de \
    --to=felix.janda@posteo.de \
    --cc=xfs@oss.sgi.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.