From: "Kamal Dasu" <kdasu.kdev@gmail.com>
To: xfs@oss.sgi.com
Cc: Kamal Dasu <kdasu.kdev@gmail.com>
Subject: [PATCH 1/2] xfsprogs: replace deprecated ustat call with statfs in libxfs/linux.c
Date: Thu, 1 Mar 2012 16:11:24 -0500 [thread overview]
Message-ID: <de74feb44ebd887269fe85d9a5879765afccf4c2.1330635228.git.kdasu.kdev@gmail.com> (raw)
In-Reply-To: <1330636285-11200-1-git-send-email-kdasu.kdev@gmail.com>
>From the ustat man page
NOTES
ustat() is deprecated and has only been provided for compatibility.
All new programs should use statfs(2) instead.
Signed-off-by: Kamal Dasu <kdasu.kdev@gmail.com>
---
libxfs/linux.c | 8 +++++---
1 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/libxfs/linux.c b/libxfs/linux.c
index 2e07d54..b8cc028 100644
--- a/libxfs/linux.c
+++ b/libxfs/linux.c
@@ -21,7 +21,9 @@
#include <mntent.h>
#include <sys/stat.h>
#undef ustat
-#include <sys/ustat.h>
+#include <sys/statfs.h>
+#include <sys/types.h>
+
#include <sys/mount.h>
#include <sys/ioctl.h>
#include <sys/sysinfo.h>
@@ -50,7 +52,7 @@ int
platform_check_ismounted(char *name, char *block, struct stat64 *s, int verbose)
{
/* Pad ust; pre-2.6.28 linux copies out too much in 32bit compat mode */
- struct ustat ust[2];
+ struct statfs fst;
struct stat64 st;
if (!s) {
@@ -61,7 +63,7 @@ platform_check_ismounted(char *name, char *block, struct stat64 *s, int verbose)
s = &st;
}
- if (ustat(s->st_rdev, ust) >= 0) {
+ if (statfs(block, &fst) >= 0) {
if (verbose)
fprintf(stderr,
_("%s: %s contains a mounted filesystem\n"),
--
1.7.5.4
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
next prev parent reply other threads:[~2012-03-01 21:14 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-01 21:11 [PATCH 0/2] xfsprogs: Replace deprecated ustat and sig(relse/hold) glibc APIs Kamal Dasu
2012-03-01 21:11 ` Kamal Dasu [this message]
2012-03-01 21:11 ` [PATCH 2/2] xfsprogs: Use Posix signal API signprocmask instead of sigrelse/sighold in xfs_copy.c Kamal Dasu
2012-03-02 7:45 ` [PATCH 1/2] xfsprogs: replace deprecated ustat call with statfs in libxfs/linux.c Christoph Hellwig
2012-03-05 16:16 ` Kamal Dasu
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=de74feb44ebd887269fe85d9a5879765afccf4c2.1330635228.git.kdasu.kdev@gmail.com \
--to=kdasu.kdev@gmail.com \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox