unlock_page — unlock a locked page
void unlock_page ( | struct page * page) ; |
Unlocks the page and wakes up sleepers in ___wait_on_page_locked
.
Also wakes sleepers in wait_on_page_writeback
because the wakeup
mechanism between PageLocked pages and PageWriteback pages is shared.
But that's OK - sleepers in wait_on_page_writeback
just go back to sleep.
Note that this depends on PG_waiters being the sign bit in the byte
that contains PG_locked - thus the BUILD_BUG_ON
. That allows us to
clear the PG_locked bit and test PG_waiters at the same time fairly
portably (architectures that do LL/SC can test any bit, while x86 can
test the sign bit).