Revert "ecryptfs: replace BUG_ON with error handling code"
[linux-2.6-microblaze.git] / fs / hugetlbfs / inode.c
index c262566..a2a4233 100644 (file)
@@ -463,14 +463,11 @@ static void remove_inode_hugepages(struct inode *inode, loff_t lstart,
        struct address_space *mapping = &inode->i_data;
        const pgoff_t start = lstart >> huge_page_shift(h);
        const pgoff_t end = lend >> huge_page_shift(h);
-       struct vm_area_struct pseudo_vma;
        struct pagevec pvec;
        pgoff_t next, index;
        int i, freed = 0;
        bool truncate_op = (lend == LLONG_MAX);
 
-       vma_init(&pseudo_vma, current->mm);
-       pseudo_vma.vm_flags = (VM_HUGETLB | VM_MAYSHARE | VM_SHARED);
        pagevec_init(&pvec);
        next = start;
        while (next < end) {
@@ -482,10 +479,9 @@ static void remove_inode_hugepages(struct inode *inode, loff_t lstart,
 
                for (i = 0; i < pagevec_count(&pvec); ++i) {
                        struct page *page = pvec.pages[i];
-                       u32 hash;
+                       u32 hash = 0;
 
                        index = page->index;
-                       hash = hugetlb_fault_mutex_hash(mapping, index);
                        if (!truncate_op) {
                                /*
                                 * Only need to hold the fault mutex in the
@@ -493,6 +489,7 @@ static void remove_inode_hugepages(struct inode *inode, loff_t lstart,
                                 * page faults.  Races are not possible in the
                                 * case of truncation.
                                 */
+                               hash = hugetlb_fault_mutex_hash(mapping, index);
                                mutex_lock(&hugetlb_fault_mutex_table[hash]);
                        }