From patchwork Sun Aug 7 06:24:40 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felix Janda X-Patchwork-Id: 9266245 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 4953360754 for ; Sun, 7 Aug 2016 07:37:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3DEE727D4D for ; Sun, 7 Aug 2016 07:37:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 32BC127FA4; Sun, 7 Aug 2016 07:37:24 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from oss.sgi.com (oss.sgi.com [192.48.182.195]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id B073A27D4D for ; Sun, 7 Aug 2016 07:37:23 +0000 (UTC) Received: from oss.sgi.com (localhost [IPv6:::1]) by oss.sgi.com (Postfix) with ESMTP id EE7827D20; Sun, 7 Aug 2016 02:36:04 -0500 (CDT) X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id 9DE607CE1 for ; Sun, 7 Aug 2016 02:35:51 -0500 (CDT) Received: from cuda.sgi.com (cuda1.sgi.com [192.48.157.11]) by relay2.corp.sgi.com (Postfix) with ESMTP id 42E7A304048 for ; Sun, 7 Aug 2016 00:35:51 -0700 (PDT) X-ASG-Debug-ID: 1470555348-0bf8157e6d536020001-NocioJ Received: from mout02.posteo.de (mout02.posteo.de [185.67.36.66]) by cuda.sgi.com with ESMTP id P7lOYlh7p99psCMZ (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Sun, 07 Aug 2016 00:35:49 -0700 (PDT) X-Barracuda-Envelope-From: felix.janda@posteo.de X-Barracuda-Effective-Source-IP: mout02.posteo.de[185.67.36.66] X-Barracuda-Apparent-Source-IP: 185.67.36.66 Received: from submission (posteo.de [89.146.220.130]) by mout02.posteo.de (Postfix) with ESMTPS id 5522D20A85 for ; Sun, 7 Aug 2016 09:35:48 +0200 (CEST) Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 3s6XQW6LB0z104K for ; Sun, 7 Aug 2016 09:35:47 +0200 (CEST) X-Mailbox-Line: From f4fc0b97ae8cdb30f1e0b0d55521f136877b33f5 Mon Sep 17 00:00:00 2001 Message-Id: In-Reply-To: References: From: Felix Janda Date: Sun, 7 Aug 2016 08:24:40 +0200 Subject: [PATCH xfsprogs 11/14] replace statvfs64 by equivalent statvfs To: xfs@oss.sgi.com X-ASG-Orig-Subj: [PATCH xfsprogs 11/14] replace statvfs64 by equivalent statvfs X-Barracuda-Connect: mout02.posteo.de[185.67.36.66] X-Barracuda-Start-Time: 1470555349 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.157.11:443/cgi-mod/mark.cgi X-Barracuda-Scan-Msg-Size: 2697 X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.7 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.31809 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-BeenThere: xfs@oss.sgi.com X-Mailman-Version: 2.1.14 Precedence: list List-Id: XFS Filesystem from SGI List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: xfs-bounces@oss.sgi.com Sender: xfs-bounces@oss.sgi.com X-Virus-Scanned: ClamAV using ClamSMTP For this it was necessary to change a workaround for missing f_brsize on Mac OS X. Signed-off-by: Felix Janda --- 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 #include #include -#define statvfs64 statfs -#define _PATH_MOUNTED "/etc/mtab" +#define f_frsize f_bsize +#define _PATH_MOUNTED "/etc/mtab" struct mntent {