aboutsummaryrefslogtreecommitdiffstats
path: root/fs/cifs/file.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/cifs/file.c')
-rw-r--r--fs/cifs/file.c13
1 files changed, 3 insertions, 10 deletions
diff --git a/fs/cifs/file.c b/fs/cifs/file.c
index 9b11a8f56f3a..1361d67f68f3 100644
--- a/fs/cifs/file.c
+++ b/fs/cifs/file.c
@@ -1931,8 +1931,7 @@ int cifs_file_mmap(struct file *file, struct vm_area_struct *vma)
1931 1931
1932 1932
1933static void cifs_copy_cache_pages(struct address_space *mapping, 1933static void cifs_copy_cache_pages(struct address_space *mapping,
1934 struct list_head *pages, int bytes_read, char *data, 1934 struct list_head *pages, int bytes_read, char *data)
1935 struct pagevec *plru_pvec)
1936{ 1935{
1937 struct page *page; 1936 struct page *page;
1938 char *target; 1937 char *target;
@@ -1944,7 +1943,7 @@ static void cifs_copy_cache_pages(struct address_space *mapping,
1944 page = list_entry(pages->prev, struct page, lru); 1943 page = list_entry(pages->prev, struct page, lru);
1945 list_del(&page->lru); 1944 list_del(&page->lru);
1946 1945
1947 if (add_to_page_cache(page, mapping, page->index, 1946 if (add_to_page_cache_lru(page, mapping, page->index,
1948 GFP_KERNEL)) { 1947 GFP_KERNEL)) {
1949 page_cache_release(page); 1948 page_cache_release(page);
1950 cFYI(1, ("Add page cache failed")); 1949 cFYI(1, ("Add page cache failed"));
@@ -1970,8 +1969,6 @@ static void cifs_copy_cache_pages(struct address_space *mapping,
1970 flush_dcache_page(page); 1969 flush_dcache_page(page);
1971 SetPageUptodate(page); 1970 SetPageUptodate(page);
1972 unlock_page(page); 1971 unlock_page(page);
1973 if (!pagevec_add(plru_pvec, page))
1974 __pagevec_lru_add_file(plru_pvec);
1975 data += PAGE_CACHE_SIZE; 1972 data += PAGE_CACHE_SIZE;
1976 } 1973 }
1977 return; 1974 return;
@@ -1990,7 +1987,6 @@ static int cifs_readpages(struct file *file, struct address_space *mapping,
1990 unsigned int read_size, i; 1987 unsigned int read_size, i;
1991 char *smb_read_data = NULL; 1988 char *smb_read_data = NULL;
1992 struct smb_com_read_rsp *pSMBr; 1989 struct smb_com_read_rsp *pSMBr;
1993 struct pagevec lru_pvec;
1994 struct cifsFileInfo *open_file; 1990 struct cifsFileInfo *open_file;
1995 int buf_type = CIFS_NO_BUFFER; 1991 int buf_type = CIFS_NO_BUFFER;
1996 1992
@@ -2004,7 +2000,6 @@ static int cifs_readpages(struct file *file, struct address_space *mapping,
2004 cifs_sb = CIFS_SB(file->f_path.dentry->d_sb); 2000 cifs_sb = CIFS_SB(file->f_path.dentry->d_sb);
2005 pTcon = cifs_sb->tcon; 2001 pTcon = cifs_sb->tcon;
2006 2002
2007 pagevec_init(&lru_pvec, 0);
2008 cFYI(DBG2, ("rpages: num pages %d", num_pages)); 2003 cFYI(DBG2, ("rpages: num pages %d", num_pages));
2009 for (i = 0; i < num_pages; ) { 2004 for (i = 0; i < num_pages; ) {
2010 unsigned contig_pages; 2005 unsigned contig_pages;
@@ -2073,7 +2068,7 @@ static int cifs_readpages(struct file *file, struct address_space *mapping,
2073 pSMBr = (struct smb_com_read_rsp *)smb_read_data; 2068 pSMBr = (struct smb_com_read_rsp *)smb_read_data;
2074 cifs_copy_cache_pages(mapping, page_list, bytes_read, 2069 cifs_copy_cache_pages(mapping, page_list, bytes_read,
2075 smb_read_data + 4 /* RFC1001 hdr */ + 2070 smb_read_data + 4 /* RFC1001 hdr */ +
2076 le16_to_cpu(pSMBr->DataOffset), &lru_pvec); 2071 le16_to_cpu(pSMBr->DataOffset));
2077 2072
2078 i += bytes_read >> PAGE_CACHE_SHIFT; 2073 i += bytes_read >> PAGE_CACHE_SHIFT;
2079 cifs_stats_bytes_read(pTcon, bytes_read); 2074 cifs_stats_bytes_read(pTcon, bytes_read);
@@ -2106,8 +2101,6 @@ static int cifs_readpages(struct file *file, struct address_space *mapping,
2106 bytes_read = 0; 2101 bytes_read = 0;
2107 } 2102 }
2108 2103
2109 pagevec_lru_add_file(&lru_pvec);
2110
2111/* need to free smb_read_data buf before exit */ 2104/* need to free smb_read_data buf before exit */
2112 if (smb_read_data) { 2105 if (smb_read_data) {
2113 if (buf_type == CIFS_SMALL_BUFFER) 2106 if (buf_type == CIFS_SMALL_BUFFER)