| 1889 | } |
| 1890 | |
| 1891 | static void |
| 1892 | crunusebatch(struct ucred *cr, int users, int ref) |
| 1893 | { |
| 1894 | |
| 1895 | KASSERT(users > 0, ("%s: passed users %d not > 0 ; cred %p", |
| 1896 | __func__, users, cr)); |
| 1897 | mtx_lock(&cr->cr_mtx); |
| 1898 | KASSERT(cr->cr_users >= users, ("%s: users %d not > %d on cred %p", |
| 1899 | __func__, cr->cr_users, users, cr)); |
| 1900 | cr->cr_users -= users; |
| 1901 | cr->cr_ref += ref; |
| 1902 | cr->cr_ref -= users; |
| 1903 | if (cr->cr_users > 0) { |
| 1904 | mtx_unlock(&cr->cr_mtx); |
| 1905 | return; |
| 1906 | } |
| 1907 | KASSERT(cr->cr_ref >= 0, ("%s: ref %d not >= 0 on cred %p", |
| 1908 | __func__, cr->cr_ref, cr)); |
| 1909 | if (cr->cr_ref > 0) { |
| 1910 | mtx_unlock(&cr->cr_mtx); |
| 1911 | return; |
| 1912 | } |
| 1913 | crfree_final(cr); |
| 1914 | } |
| 1915 | |
| 1916 | void |
| 1917 | crcowfree(struct thread *td) |
no test coverage detected