]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/blobdiff - estimate/xfs_estimate.c
xfs_estimate: change nftw64 to nftw
[thirdparty/xfsprogs-dev.git] / estimate / xfs_estimate.c
index ddc6f62f1f74443d9804ae61ff51fd22b0904e92..323137cf62990650c513a0d672316c597acfd002 100644 (file)
 
 /*
  * Estimate space of an XFS filesystem
+ *
+ * XXX: assumes dirv1 format.
  */
-#include <xfs/libxfs.h>
+#include "libxfs.h"
 #include <sys/stat.h>
 #include <ftw.h>
 
@@ -43,12 +45,12 @@ cvtnum(char *s)
        return 0LL;
 }
 
-int ffn(const char *, const struct stat64 *, int, struct FTW *);
+int ffn(const char *, const struct stat *, int, struct FTW *);
 
 #define BLOCKSIZE      4096
 #define INODESIZE      256
 #define PERDIRENTRY    \
-       (sizeof(xfs_dir_leaf_entry_t) + sizeof(xfs_dir_leaf_name_t))
+       (sizeof(xfs_dir2_leaf_entry_t) + sizeof(xfs_dir2_data_entry_t))
 #define LOGSIZE                1000
 
 #define FBLOCKS(n)     ((n)/blocksize)
@@ -166,7 +168,7 @@ main(int argc, char **argv)
                ndirs=0LL;              /* number of directories */
                nspecial=0LL;           /* number of special files */
 
-               nftw64(argv[optind], ffn, 40, FTW_PHYS | FTW_MOUNT);
+               nftw(argv[optind], ffn, 40, FTW_PHYS | FTW_MOUNT);
 
                if (__debug) {
                        printf(_("dirsize=%llu\n"), dirsize);
@@ -212,7 +214,7 @@ main(int argc, char **argv)
 }
 
 int
-ffn(const char *path, const struct stat64 *stb, int flags, struct FTW *f)
+ffn(const char *path, const struct stat *stb, int flags, struct FTW *f)
 {
        /* cases are in most-encountered to least-encountered order */
        dirsize+=PERDIRENTRY+strlen(path);