kernels/linux-2.4.0/mm/filemap.c
/*
 * Get a lock on the page, assuming we need to sleep
 * to get it..
 */
Get a lock on the page, assuming we need to sleep
to get it
Get a lock on the page assuming we need to sleep to get it
static void __lock_page(struct page *page)
{
	struct task_struct *tsk = current;
	DECLARE_WAITQUEUE(wait, tsk);
	add_wait_queue_exclusive(&page->wait, &wait);
	for (;;) {
		sync_page(page);
		set_task_state(tsk, TASK_UNINTERRUPTIBLE);
		if (PageLocked(page)) {
			run_task_queue(&tq_disk);
			schedule();
			continue;
		}
		if (!TryLockPage(page))
			break;
	}
	tsk->state = TASK_RUNNING;
	remove_wait_queue(&page->wait, &wait);
}
static void __lock_page ( struct page * page ) { struct task_struct * tsk = current ; DECLARE_WAITQUEUE ( wait , tsk ) ; add_wait_queue_exclusive ( & page -> wait , & wait ) ; for ( ; ; ) { sync_page ( page ) ; set_task_state ( tsk , TASK_UNINTERRUPTIBLE ) ; if ( PageLocked ( page ) ) { run_task_queue ( & tq_disk ) ; schedule ( ) ; continue ; } if ( ! TryLockPage ( page ) ) break ; } tsk -> state = TASK_RUNNING ; remove_wait_queue ( & page -> wait , & wait ) ; }
Get a lock on the page, assuming we need to sleep
 to get it..
Get a lock on the page assuming we need to sleep to get it ..