Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 250871
b: refs/heads/master
c: f62e00c
h: refs/heads/master
i:
  250869: 7b6d1f5
  250867: 8c2e73b
  250863: 42ff1ce
v: v3
  • Loading branch information
KOSAKI Motohiro authored and Linus Torvalds committed May 25, 2011
1 parent 25faca2 commit c2d659b
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: fa25c503dfa203b921199ea42c0046c89f2ed49f
refs/heads/master: f62e00cc3a00bfbd394a79fc22b334c31f91bd5f
9 changes: 9 additions & 0 deletions trunk/include/linux/pagemap.h
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,15 @@ static inline int lock_page_or_retry(struct page *page, struct mm_struct *mm,
*/
extern void wait_on_page_bit(struct page *page, int bit_nr);

extern int wait_on_page_bit_killable(struct page *page, int bit_nr);

static inline int wait_on_page_locked_killable(struct page *page)
{
if (PageLocked(page))
return wait_on_page_bit_killable(page, PG_locked);
return 0;
}

/*
* Wait for a page to be unlocked.
*
Expand Down
11 changes: 11 additions & 0 deletions trunk/mm/filemap.c
Original file line number Diff line number Diff line change
Expand Up @@ -562,6 +562,17 @@ void wait_on_page_bit(struct page *page, int bit_nr)
}
EXPORT_SYMBOL(wait_on_page_bit);

int wait_on_page_bit_killable(struct page *page, int bit_nr)
{
DEFINE_WAIT_BIT(wait, &page->flags, bit_nr);

if (!test_bit(bit_nr, &page->flags))
return 0;

return __wait_on_bit(page_waitqueue(page), &wait,
sleep_on_page_killable, TASK_KILLABLE);
}

/**
* add_page_wait_queue - Add an arbitrary waiter to a page's wait queue
* @page: Page defining the wait queue of interest
Expand Down

0 comments on commit c2d659b

Please sign in to comment.