- struct statfs sb;
-
- if (savacctp != NULLVP) {
- if (savacctp->v_type == VBAD) {
- (void) vn_close(savacctp, FWRITE, NOCRED, NULL);
- savacctp = NULLVP;
+ vfs_context_t ctx = vfs_context_current();
+ struct vfs_attr va;
+
+ VFSATTR_INIT(&va);
+ VFSATTR_WANTED(&va, f_blocks);
+ VFSATTR_WANTED(&va, f_bavail);
+
+ ACCT_SUBSYS_LOCK();
+ 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, vfs_context_kernel());
+ suspend_acctp = NULLVP;
+ ACCT_SUBSYS_UNLOCK();