- struct statfs sb;
-
- if (savacctp != NULLVP) {
- if (savacctp->v_type == VBAD) {
- (void) vn_close(savacctp, FWRITE, NOCRED, NULL);
- savacctp = NULLVP;
+ struct vfs_context context;
+ struct vfs_attr va;
+
+ VFSATTR_INIT(&va);
+ VFSATTR_WANTED(&va, f_blocks);
+ VFSATTR_WANTED(&va, f_bavail);
+ context.vc_proc = current_proc();
+ context.vc_ucred = kauth_cred_get();
+
+ if (suspend_acctp != NULLVP) {
+ /*
+ * Resuming accounting when accounting is suspended, and the
+ * filesystem containing the suspended accounting file goes
+ * below a low watermark
+ */
+ if (suspend_acctp->v_type == VBAD) {
+ (void) vn_close(suspend_acctp, FWRITE, NOCRED, NULL);
+ suspend_acctp = NULLVP;