struct iconv_functions *ntfs_iconv = NULL;
static int ntfs_root (struct mount *, struct vnode **);
-static int ntfs_statfs (struct mount *, struct statfs *, struct ucred *cred);
+static int ntfs_statfs (struct mount *, struct statfs *,
+ struct ucred *cred);
+static int ntfs_statvfs (struct mount *, struct statvfs *,
+ struct ucred *);
static int ntfs_unmount (struct mount *, int);
static int ntfs_vget (struct mount *mp, struct vnode *dvp,
ino_t ino, struct vnode **vpp);
return (0);
}
+static int
+ntfs_statvfs(struct mount *mp, struct statvfs *sbp, struct ucred *cred)
+{
+ struct ntfsmount *ntmp = VFSTONTFS(mp);
+ u_int64_t mftsize,mftallocated;
+
+ dprintf(("ntfs_statvfs():\n"));
+
+ mftsize = VTOF(ntmp->ntm_sysvn[NTFS_MFTINO])->f_size;
+ mftallocated = VTOF(ntmp->ntm_sysvn[NTFS_MFTINO])->f_allocated;
+
+ sbp->f_type = mp->mnt_vfc->vfc_typenum;
+ sbp->f_bsize = ntmp->ntm_bps;
+ sbp->f_blocks = ntmp->ntm_bootfile.bf_spv;
+ sbp->f_bfree = sbp->f_bavail = ntmp->ntm_cfree * ntmp->ntm_spc;
+ sbp->f_ffree = sbp->f_bfree / ntmp->ntm_bpmftrec;
+ sbp->f_files = mftallocated / (ntmp->ntm_bpmftrec * ntmp->ntm_bps) +
+ sbp->f_ffree;
+
+ return (0);
+}
+
#if !defined(__DragonFly__)
static int
ntfs_sync(struct mount *mp, int waitfor, struct ucred *cred, struct thread *td)
.vfs_unmount = ntfs_unmount,
.vfs_root = ntfs_root,
.vfs_statfs = ntfs_statfs,
+ .vfs_statvfs = ntfs_statvfs,
.vfs_sync = vfs_stdsync,
.vfs_vget = ntfs_vget,
.vfs_fhtovp = ntfs_fhtovp,