@@ -565,17 +565,13 @@ static void z_erofs_bind_cache(struct z_erofs_decompress_frontend *fe)
565
565
566
566
for (i = 0 ; i < pclusterpages ; ++ i ) {
567
567
struct page * page , * newpage ;
568
- void * t ; /* mark pages just found for debugging */
569
568
570
569
/* Inaccurate check w/o locking to avoid unneeded lookups */
571
570
if (READ_ONCE (pcl -> compressed_bvecs [i ].page ))
572
571
continue ;
573
572
574
573
page = find_get_page (mc , pcl -> obj .index + i );
575
- if (page ) {
576
- t = (void * )((unsigned long )page | 1 );
577
- newpage = NULL ;
578
- } else {
574
+ if (!page ) {
579
575
/* I/O is needed, no possible to decompress directly */
580
576
standalone = false;
581
577
if (!shouldalloc )
@@ -589,11 +585,10 @@ static void z_erofs_bind_cache(struct z_erofs_decompress_frontend *fe)
589
585
if (!newpage )
590
586
continue ;
591
587
set_page_private (newpage , Z_EROFS_PREALLOCATED_PAGE );
592
- t = (void * )((unsigned long )newpage | 1 );
593
588
}
594
589
spin_lock (& pcl -> obj .lockref .lock );
595
590
if (!pcl -> compressed_bvecs [i ].page ) {
596
- pcl -> compressed_bvecs [i ].page = t ;
591
+ pcl -> compressed_bvecs [i ].page = page ? page : newpage ;
597
592
spin_unlock (& pcl -> obj .lockref .lock );
598
593
continue ;
599
594
}
@@ -1423,7 +1418,7 @@ static void z_erofs_fill_bio_vec(struct bio_vec *bvec,
1423
1418
struct z_erofs_bvec zbv ;
1424
1419
struct address_space * mapping ;
1425
1420
struct page * page ;
1426
- int justfound , bs = i_blocksize (f -> inode );
1421
+ int bs = i_blocksize (f -> inode );
1427
1422
1428
1423
/* Except for inplace pages, the entire page can be used for I/Os */
1429
1424
bvec -> bv_offset = 0 ;
@@ -1432,9 +1427,6 @@ static void z_erofs_fill_bio_vec(struct bio_vec *bvec,
1432
1427
spin_lock (& pcl -> obj .lockref .lock );
1433
1428
zbv = pcl -> compressed_bvecs [nr ];
1434
1429
page = zbv .page ;
1435
- justfound = (unsigned long )page & 1UL ;
1436
- page = (struct page * )((unsigned long )page & ~1UL );
1437
- pcl -> compressed_bvecs [nr ].page = page ;
1438
1430
spin_unlock (& pcl -> obj .lockref .lock );
1439
1431
if (!page )
1440
1432
goto out_allocpage ;
@@ -1465,17 +1457,13 @@ static void z_erofs_fill_bio_vec(struct bio_vec *bvec,
1465
1457
}
1466
1458
1467
1459
lock_page (page );
1468
- /* only true if page reclaim goes wrong, should never happen */
1469
- DBG_BUGON (justfound && PagePrivate (page ));
1470
-
1471
1460
/* the cached page is still in managed cache */
1472
1461
if (page -> mapping == mc ) {
1473
1462
/*
1474
1463
* The cached page is still available but without a valid
1475
1464
* `->private` pcluster hint. Let's reconnect them.
1476
1465
*/
1477
1466
if (!PagePrivate (page )) {
1478
- DBG_BUGON (!justfound );
1479
1467
/* compressed_bvecs[] already takes a ref */
1480
1468
attach_page_private (page , pcl );
1481
1469
put_page (page );
@@ -1494,8 +1482,6 @@ static void z_erofs_fill_bio_vec(struct bio_vec *bvec,
1494
1482
* allocate a new page for compressed data.
1495
1483
*/
1496
1484
DBG_BUGON (page -> mapping );
1497
- DBG_BUGON (!justfound );
1498
-
1499
1485
tocache = true;
1500
1486
unlock_page (page );
1501
1487
put_page (page );
0 commit comments