OSDN Git Service

crypto: talitos - HMAC SNOOP NO AFEU mode requires SW icv checking.
[android-x86/kernel.git] / mm / truncate.c
index a01cce4..befdc6f 100644 (file)
@@ -283,7 +283,7 @@ void truncate_inode_pages_range(struct address_space *mapping,
 
                        if (!trylock_page(page))
                                continue;
-                       WARN_ON(page_to_pgoff(page) != index);
+                       WARN_ON(page_to_index(page) != index);
                        if (PageWriteback(page)) {
                                unlock_page(page);
                                continue;
@@ -371,7 +371,7 @@ void truncate_inode_pages_range(struct address_space *mapping,
                        }
 
                        lock_page(page);
-                       WARN_ON(page_to_pgoff(page) != index);
+                       WARN_ON(page_to_index(page) != index);
                        wait_on_page_writeback(page);
                        truncate_inode_page(mapping, page);
                        unlock_page(page);
@@ -443,9 +443,13 @@ void truncate_inode_pages_final(struct address_space *mapping)
                 */
                spin_lock_irq(&mapping->tree_lock);
                spin_unlock_irq(&mapping->tree_lock);
-
-               truncate_inode_pages(mapping, 0);
        }
+
+       /*
+        * Cleancache needs notification even if there are no pages or shadow
+        * entries.
+        */
+       truncate_inode_pages(mapping, 0);
 }
 EXPORT_SYMBOL(truncate_inode_pages_final);
 
@@ -492,7 +496,7 @@ unsigned long invalidate_mapping_pages(struct address_space *mapping,
                        if (!trylock_page(page))
                                continue;
 
-                       WARN_ON(page_to_pgoff(page) != index);
+                       WARN_ON(page_to_index(page) != index);
 
                        /* Middle of THP: skip */
                        if (PageTransTail(page)) {
@@ -612,7 +616,7 @@ int invalidate_inode_pages2_range(struct address_space *mapping,
                        }
 
                        lock_page(page);
-                       WARN_ON(page_to_pgoff(page) != index);
+                       WARN_ON(page_to_index(page) != index);
                        if (page->mapping != mapping) {
                                unlock_page(page);
                                continue;
@@ -753,7 +757,7 @@ EXPORT_SYMBOL(truncate_setsize);
  */
 void pagecache_isize_extended(struct inode *inode, loff_t from, loff_t to)
 {
-       int bsize = 1 << inode->i_blkbits;
+       int bsize = i_blocksize(inode);
        loff_t rounded_from;
        struct page *page;
        pgoff_t index;