* Disable currently in-progress accounting by closing the vnode, dropping * our reference to the credential, and clearing the vnode's flags. */
| 321 | * our reference to the credential, and clearing the vnode's flags. |
| 322 | */ |
| 323 | static int |
| 324 | acct_disable(struct thread *td, int logging) |
| 325 | { |
| 326 | int error; |
| 327 | |
| 328 | sx_assert(&acct_sx, SX_XLOCKED); |
| 329 | error = vn_close(acct_vp, acct_flags, acct_cred, td); |
| 330 | crfree(acct_cred); |
| 331 | lim_free(acct_limit); |
| 332 | acct_configured = 0; |
| 333 | acct_vp = NULL; |
| 334 | acct_cred = NULL; |
| 335 | acct_flags = 0; |
| 336 | if (logging) |
| 337 | log(LOG_NOTICE, "Accounting disabled\n"); |
| 338 | return (error); |
| 339 | } |
| 340 | |
| 341 | /* |
| 342 | * Write out process accounting information, on process exit. |