Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 24849
b: refs/heads/master
c: 93fac70
h: refs/heads/master
i:
  24847: 7e124a7
v: v3
  • Loading branch information
Nick Piggin authored and Linus Torvalds committed Mar 31, 2006
1 parent e814d0f commit bb89a0f
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 9bf9e89c3d147ca8cf9622d2d053684fba77a464
refs/heads/master: 93fac7041f082297b93655a0e49f659cd7520e40
12 changes: 12 additions & 0 deletions trunk/Documentation/feature-removal-schedule.txt
Original file line number Diff line number Diff line change
Expand Up @@ -241,3 +241,15 @@ Why: The USB subsystem has changed a lot over time, and it has been
Who: Greg Kroah-Hartman <gregkh@suse.de>

---------------------------

What: find_trylock_page
When: January 2007
Why: The interface no longer has any callers left in the kernel. It
is an odd interface (compared with other find_*_page functions), in
that it does not take a refcount to the page, only the page lock.
It should be replaced with find_get_page or find_lock_page if possible.
This feature removal can be reevaluated if users of the interface
cannot cleanly use something else.
Who: Nick Piggin <npiggin@suse.de>

---------------------------
4 changes: 2 additions & 2 deletions trunk/include/linux/pagemap.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ extern struct page * find_get_page(struct address_space *mapping,
unsigned long index);
extern struct page * find_lock_page(struct address_space *mapping,
unsigned long index);
extern struct page * find_trylock_page(struct address_space *mapping,
unsigned long index);
extern __deprecated_for_modules struct page * find_trylock_page(
struct address_space *mapping, unsigned long index);
extern struct page * find_or_create_page(struct address_space *mapping,
unsigned long index, gfp_t gfp_mask);
unsigned find_get_pages(struct address_space *mapping, pgoff_t start,
Expand Down
14 changes: 10 additions & 4 deletions trunk/mm/swapfile.c
Original file line number Diff line number Diff line change
Expand Up @@ -397,18 +397,24 @@ void free_swap_and_cache(swp_entry_t entry)

p = swap_info_get(entry);
if (p) {
if (swap_entry_free(p, swp_offset(entry)) == 1)
page = find_trylock_page(&swapper_space, entry.val);
if (swap_entry_free(p, swp_offset(entry)) == 1) {
page = find_get_page(&swapper_space, entry.val);
if (page && unlikely(TestSetPageLocked(page))) {
page_cache_release(page);
page = NULL;
}
}
spin_unlock(&swap_lock);
}
if (page) {
int one_user;

BUG_ON(PagePrivate(page));
page_cache_get(page);
one_user = (page_count(page) == 2);
/* Only cache user (+us), or swap space full? Free it! */
if (!PageWriteback(page) && (one_user || vm_swap_full())) {
/* Also recheck PageSwapCache after page is locked (above) */
if (PageSwapCache(page) && !PageWriteback(page) &&
(one_user || vm_swap_full())) {
delete_from_swap_cache(page);
SetPageDirty(page);
}
Expand Down

0 comments on commit bb89a0f

Please sign in to comment.