| 1924 | } |
| 1925 | |
| 1926 | struct ucred * |
| 1927 | crcowsync(void) |
| 1928 | { |
| 1929 | struct thread *td; |
| 1930 | struct proc *p; |
| 1931 | struct ucred *crnew, *crold; |
| 1932 | |
| 1933 | td = curthread; |
| 1934 | p = td->td_proc; |
| 1935 | PROC_LOCK_ASSERT(p, MA_OWNED); |
| 1936 | |
| 1937 | MPASS(td->td_realucred == td->td_ucred); |
| 1938 | if (td->td_realucred == p->p_ucred) |
| 1939 | return (NULL); |
| 1940 | |
| 1941 | crnew = crcowget(p->p_ucred); |
| 1942 | crold = crunuse(td); |
| 1943 | td->td_realucred = crnew; |
| 1944 | td->td_ucred = td->td_realucred; |
| 1945 | return (crold); |
| 1946 | } |
| 1947 | |
| 1948 | /* |
| 1949 | * Batching. |
no test coverage detected