Merge branch 'task_killable' of git://git.kernel.org/pub/scm/linux/kernel/git/willy/misc

* 'task_killable' of git://git.kernel.org/pub/scm/linux/kernel/git/willy/misc: (22 commits)
  Remove commented-out code copied from NFS
  NFS: Switch from intr mount option to TASK_KILLABLE
  Add wait_for_completion_killable
  Add wait_event_killable
  Add schedule_timeout_killable
  Use mutex_lock_killable in vfs_readdir
  Add mutex_lock_killable
  Use lock_page_killable
  Add lock_page_killable
  Add fatal_signal_pending
  Add TASK_WAKEKILL
  exit: Use task_is_*
  signal: Use task_is_*
  sched: Use task_contributes_to_load, TASK_ALL and TASK_NORMAL
  ptrace: Use task_is_*
  power: Use task_is_*
  wait: Use TASK_NORMAL
  proc/base.c: Use task_is_*
  proc/array.c: Use TASK_REPORT
  perfmon: Use task_is_*
  ...

Fixed up conflicts in NFS/sunrpc manually..
This commit is contained in:
Linus Torvalds
2008-02-01 11:45:47 +11:00
38 changed files with 282 additions and 252 deletions

View File

@ -185,6 +185,12 @@ static int sync_page(void *word)
return 0;
}
static int sync_page_killable(void *word)
{
sync_page(word);
return fatal_signal_pending(current) ? -EINTR : 0;
}
/**
* __filemap_fdatawrite_range - start writeback on mapping dirty pages in range
* @mapping: address space structure to write
@ -589,6 +595,14 @@ void fastcall __lock_page(struct page *page)
}
EXPORT_SYMBOL(__lock_page);
int fastcall __lock_page_killable(struct page *page)
{
DEFINE_WAIT_BIT(wait, &page->flags, PG_locked);
return __wait_on_bit_lock(page_waitqueue(page), &wait,
sync_page_killable, TASK_KILLABLE);
}
/*
* Variant of lock_page that does not require the caller to hold a reference
* on the page's mapping.
@ -980,7 +994,8 @@ page_ok:
page_not_up_to_date:
/* Get exclusive access to the page ... */
lock_page(page);
if (lock_page_killable(page))
goto readpage_eio;
/* Did it get truncated before we got the lock? */
if (!page->mapping) {
@ -1008,7 +1023,8 @@ readpage:
}
if (!PageUptodate(page)) {
lock_page(page);
if (lock_page_killable(page))
goto readpage_eio;
if (!PageUptodate(page)) {
if (page->mapping == NULL) {
/*
@ -1019,15 +1035,16 @@ readpage:
goto find_page;
}
unlock_page(page);
error = -EIO;
shrink_readahead_size_eio(filp, ra);
goto readpage_error;
goto readpage_eio;
}
unlock_page(page);
}
goto page_ok;
readpage_eio:
error = -EIO;
readpage_error:
/* UHHUH! A synchronous read error occurred. Report it */
desc->error = error;