]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/blobdiff - rtcp/xfs_rtcp.c
libfrog: refactor online geometry queries
[thirdparty/xfsprogs-dev.git] / rtcp / xfs_rtcp.c
index 1027c913f2edbc64101fce6648f00f6d2b71bb39..f6ef0e6c6f2424a541a6354a8800e8b5243962a5 100644 (file)
@@ -5,6 +5,7 @@
  */
 
 #include "libxfs.h"
+#include "fsgeom.h"
 
 int rtcp(char *, char *, int);
 int xfsrtextsize(char *path);
@@ -368,8 +369,8 @@ rtcp( char *source, char *target, int fextsize)
 int
 xfsrtextsize( char *path)
 {
-       int fd, rval, rtextsize;
-       struct xfs_fsop_geom_v1 geo;
+       struct xfs_fsop_geom    geo;
+       int                     fd, rval, rtextsize;
 
        fd = open( path, O_RDONLY );
        if ( fd < 0 ) {
@@ -377,9 +378,9 @@ xfsrtextsize( char *path)
                        progname, path, strerror(errno));
                return -1;
        }
-       rval = xfsctl( path, fd, XFS_IOC_FSGEOMETRY_V1, &geo );
+       rval = xfrog_geometry(fd, &geo);
        close(fd);
-       if ( rval < 0 )
+       if (rval)
                return -1;
 
        rtextsize = geo.rtextsize * geo.blocksize;