@@ -60,6 +60,11 @@ struct squashfs_page_actor *squashfs_page_actor_init(void **buffer,
6060}
6161
6262/* Implementation of page_actor for decompressing directly into page cache. */
63+ static loff_t page_next_index (struct squashfs_page_actor * actor )
64+ {
65+ return page_folio (actor -> page [actor -> next_page ])-> index ;
66+ }
67+
6368static void * handle_next_page (struct squashfs_page_actor * actor )
6469{
6570 int max_pages = (actor -> length + PAGE_SIZE - 1 ) >> PAGE_SHIFT ;
@@ -68,7 +73,7 @@ static void *handle_next_page(struct squashfs_page_actor *actor)
6873 return NULL ;
6974
7075 if ((actor -> next_page == actor -> pages ) ||
71- (actor -> next_index != actor -> page [ actor -> next_page ] -> index )) {
76+ (actor -> next_index != page_next_index ( actor ) )) {
7277 actor -> next_index ++ ;
7378 actor -> returned_pages ++ ;
7479 actor -> last_page = NULL ;
@@ -103,7 +108,7 @@ static void direct_finish_page(struct squashfs_page_actor *actor)
103108}
104109
105110struct squashfs_page_actor * squashfs_page_actor_init_special (struct squashfs_sb_info * msblk ,
106- struct page * * page , int pages , int length )
111+ struct page * * page , int pages , int length , loff_t start_index )
107112{
108113 struct squashfs_page_actor * actor = kmalloc (sizeof (* actor ), GFP_KERNEL );
109114
@@ -125,7 +130,7 @@ struct squashfs_page_actor *squashfs_page_actor_init_special(struct squashfs_sb_
125130 actor -> pages = pages ;
126131 actor -> next_page = 0 ;
127132 actor -> returned_pages = 0 ;
128- actor -> next_index = page [ 0 ] -> index & ~(( 1 << ( msblk -> block_log - PAGE_SHIFT )) - 1 ) ;
133+ actor -> next_index = start_index >> PAGE_SHIFT ;
129134 actor -> pageaddr = NULL ;
130135 actor -> last_page = NULL ;
131136 actor -> alloc_buffer = msblk -> decompressor -> alloc_buffer ;
0 commit comments