aboutsummaryrefslogtreecommitdiffstats
path: root/fs/squashfs/file_direct.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/squashfs/file_direct.c')
-rw-r--r--fs/squashfs/file_direct.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/fs/squashfs/file_direct.c b/fs/squashfs/file_direct.c
index 43e7a7eddac0..cb485d8e0e91 100644
--- a/fs/squashfs/file_direct.c
+++ b/fs/squashfs/file_direct.c
@@ -30,8 +30,8 @@ int squashfs_readpage_block(struct page *target_page, u64 block, int bsize)
30 struct inode *inode = target_page->mapping->host; 30 struct inode *inode = target_page->mapping->host;
31 struct squashfs_sb_info *msblk = inode->i_sb->s_fs_info; 31 struct squashfs_sb_info *msblk = inode->i_sb->s_fs_info;
32 32
33 int file_end = (i_size_read(inode) - 1) >> PAGE_CACHE_SHIFT; 33 int file_end = (i_size_read(inode) - 1) >> PAGE_SHIFT;
34 int mask = (1 << (msblk->block_log - PAGE_CACHE_SHIFT)) - 1; 34 int mask = (1 << (msblk->block_log - PAGE_SHIFT)) - 1;
35 int start_index = target_page->index & ~mask; 35 int start_index = target_page->index & ~mask;
36 int end_index = start_index | mask; 36 int end_index = start_index | mask;
37 int i, n, pages, missing_pages, bytes, res = -ENOMEM; 37 int i, n, pages, missing_pages, bytes, res = -ENOMEM;
@@ -68,7 +68,7 @@ int squashfs_readpage_block(struct page *target_page, u64 block, int bsize)
68 68
69 if (PageUptodate(page[i])) { 69 if (PageUptodate(page[i])) {
70 unlock_page(page[i]); 70 unlock_page(page[i]);
71 page_cache_release(page[i]); 71 put_page(page[i]);
72 page[i] = NULL; 72 page[i] = NULL;
73 missing_pages++; 73 missing_pages++;
74 } 74 }
@@ -96,10 +96,10 @@ int squashfs_readpage_block(struct page *target_page, u64 block, int bsize)
96 goto mark_errored; 96 goto mark_errored;
97 97
98 /* Last page may have trailing bytes not filled */ 98 /* Last page may have trailing bytes not filled */
99 bytes = res % PAGE_CACHE_SIZE; 99 bytes = res % PAGE_SIZE;
100 if (bytes) { 100 if (bytes) {
101 pageaddr = kmap_atomic(page[pages - 1]); 101 pageaddr = kmap_atomic(page[pages - 1]);
102 memset(pageaddr + bytes, 0, PAGE_CACHE_SIZE - bytes); 102 memset(pageaddr + bytes, 0, PAGE_SIZE - bytes);
103 kunmap_atomic(pageaddr); 103 kunmap_atomic(pageaddr);
104 } 104 }
105 105
@@ -109,7 +109,7 @@ int squashfs_readpage_block(struct page *target_page, u64 block, int bsize)
109 SetPageUptodate(page[i]); 109 SetPageUptodate(page[i]);
110 unlock_page(page[i]); 110 unlock_page(page[i]);
111 if (page[i] != target_page) 111 if (page[i] != target_page)
112 page_cache_release(page[i]); 112 put_page(page[i]);
113 } 113 }
114 114
115 kfree(actor); 115 kfree(actor);
@@ -127,7 +127,7 @@ mark_errored:
127 flush_dcache_page(page[i]); 127 flush_dcache_page(page[i]);
128 SetPageError(page[i]); 128 SetPageError(page[i]);
129 unlock_page(page[i]); 129 unlock_page(page[i]);
130 page_cache_release(page[i]); 130 put_page(page[i]);
131 } 131 }
132 132
133out: 133out:
@@ -153,21 +153,21 @@ static int squashfs_read_cache(struct page *target_page, u64 block, int bsize,
153 } 153 }
154 154
155 for (n = 0; n < pages && bytes > 0; n++, 155 for (n = 0; n < pages && bytes > 0; n++,
156 bytes -= PAGE_CACHE_SIZE, offset += PAGE_CACHE_SIZE) { 156 bytes -= PAGE_SIZE, offset += PAGE_SIZE) {
157 int avail = min_t(int, bytes, PAGE_CACHE_SIZE); 157 int avail = min_t(int, bytes, PAGE_SIZE);
158 158
159 if (page[n] == NULL) 159 if (page[n] == NULL)
160 continue; 160 continue;
161 161
162 pageaddr = kmap_atomic(page[n]); 162 pageaddr = kmap_atomic(page[n]);
163 squashfs_copy_data(pageaddr, buffer, offset, avail); 163 squashfs_copy_data(pageaddr, buffer, offset, avail);
164 memset(pageaddr + avail, 0, PAGE_CACHE_SIZE - avail); 164 memset(pageaddr + avail, 0, PAGE_SIZE - avail);
165 kunmap_atomic(pageaddr); 165 kunmap_atomic(pageaddr);
166 flush_dcache_page(page[n]); 166 flush_dcache_page(page[n]);
167 SetPageUptodate(page[n]); 167 SetPageUptodate(page[n]);
168 unlock_page(page[n]); 168 unlock_page(page[n]);
169 if (page[n] != target_page) 169 if (page[n] != target_page)
170 page_cache_release(page[n]); 170 put_page(page[n]);
171 } 171 }
172 172
173out: 173out: