Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 33357
b: refs/heads/master
c: 1d7ea73
h: refs/heads/master
i:
  33355: 44699cf
v: v3
  • Loading branch information
Alexander Zarochentsev authored and Greg Kroah-Hartman committed Aug 14, 2006
1 parent a459631 commit b8369dd
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 3 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: 9b41ea7289a589993d3daabc61f999b4147872c4
refs/heads/master: 1d7ea7324ae7a59f8e17e4ba76a2707c1e6f24d2
10 changes: 8 additions & 2 deletions trunk/fs/fuse/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -395,14 +395,16 @@ static int fuse_readpages(struct file *file, struct address_space *mapping,
struct fuse_readpages_data data;
int err;

err = -EIO;
if (is_bad_inode(inode))
return -EIO;
goto clean_pages_up;

data.file = file;
data.inode = inode;
data.req = fuse_get_req(fc);
err = PTR_ERR(data.req);
if (IS_ERR(data.req))
return PTR_ERR(data.req);
goto clean_pages_up;

err = read_cache_pages(mapping, pages, fuse_readpages_fill, &data);
if (!err) {
Expand All @@ -412,6 +414,10 @@ static int fuse_readpages(struct file *file, struct address_space *mapping,
fuse_put_request(fc, data.req);
}
return err;

clean_pages_up:
put_pages_list(pages);
return err;
}

static size_t fuse_send_write(struct fuse_req *req, struct file *file,
Expand Down
1 change: 1 addition & 0 deletions trunk/include/linux/mm.h
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,7 @@ static inline void init_page_count(struct page *page)
}

void put_page(struct page *page);
void put_pages_list(struct list_head *pages);

void split_page(struct page *page, unsigned int order);

Expand Down
20 changes: 20 additions & 0 deletions trunk/mm/swap.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,26 @@ void put_page(struct page *page)
}
EXPORT_SYMBOL(put_page);

/**
* put_pages_list(): release a list of pages
*
* Release a list of pages which are strung together on page.lru. Currently
* used by read_cache_pages() and related error recovery code.
*
* @pages: list of pages threaded on page->lru
*/
void put_pages_list(struct list_head *pages)
{
while (!list_empty(pages)) {
struct page *victim;

victim = list_entry(pages->prev, struct page, lru);
list_del(&victim->lru);
page_cache_release(victim);
}
}
EXPORT_SYMBOL(put_pages_list);

/*
* Writeback is about to end against a page which has been marked for immediate
* reclaim. If it still appears to be reclaimable, move it to the tail of the
Expand Down

0 comments on commit b8369dd

Please sign in to comment.