Skip to content

Commit

Permalink
cifs: Do not take a reference to the page in cifs_readpage_worker()
Browse files Browse the repository at this point in the history
We do not need to take a reference to the pagecache in
cifs_readpage_worker() since the calling function will have already
taken one before passing the pointer to the page as an argument to the
function.

Signed-off-by: Sachin Prabhu <sprabhu@redhat.com>
Reviewed-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Steve French <smfrench@gmail.com>
  • Loading branch information
Sachin Prabhu authored and Steve French committed Sep 13, 2013
1 parent bdbdfde commit a9e9b7b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions fs/cifs/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -3379,6 +3379,9 @@ static int cifs_readpages(struct file *file, struct address_space *mapping,
return rc;
}

/*
* cifs_readpage_worker must be called with the page pinned
*/
static int cifs_readpage_worker(struct file *file, struct page *page,
loff_t *poffset)
{
Expand All @@ -3390,7 +3393,6 @@ static int cifs_readpage_worker(struct file *file, struct page *page,
if (rc == 0)
goto read_complete;

page_cache_get(page);
read_data = kmap(page);
/* for reads over a certain size could initiate async read ahead */

Expand All @@ -3417,7 +3419,6 @@ static int cifs_readpage_worker(struct file *file, struct page *page,

io_error:
kunmap(page);
page_cache_release(page);

read_complete:
return rc;
Expand Down

0 comments on commit a9e9b7b

Please sign in to comment.