/*
* Estimate space of an XFS filesystem
+ *
+ * XXX: assumes dirv1 format.
*/
-#include <xfs/libxfs.h>
+#include "libxfs.h"
#include <sys/stat.h>
#include <ftw.h>
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)
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);
}
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);