| 836 | } |
| 837 | |
| 838 | static int |
| 839 | cache_trylock_vnodes(struct mtx *vlp1, struct mtx *vlp2) |
| 840 | { |
| 841 | |
| 842 | cache_sort_vnodes(&vlp1, &vlp2); |
| 843 | |
| 844 | if (vlp1 != NULL) { |
| 845 | if (!mtx_trylock(vlp1)) |
| 846 | return (EAGAIN); |
| 847 | } |
| 848 | if (!mtx_trylock(vlp2)) { |
| 849 | if (vlp1 != NULL) |
| 850 | mtx_unlock(vlp1); |
| 851 | return (EAGAIN); |
| 852 | } |
| 853 | |
| 854 | return (0); |
| 855 | } |
| 856 | |
| 857 | static void |
| 858 | cache_lock_vnodes(struct mtx *vlp1, struct mtx *vlp2) |
no test coverage detected