fuse: remove unused arg in fuse_write_file_get()
[linux-2.6-microblaze.git] / mm / z3fold.c
index 1b790d0..b3c0577 100644 (file)
@@ -144,6 +144,8 @@ struct z3fold_header {
  * @c_handle:  cache for z3fold_buddy_slots allocation
  * @ops:       pointer to a structure of user defined operations specified at
  *             pool creation time.
+ * @zpool:     zpool driver
+ * @zpool_ops: zpool operations structure with an evict callback
  * @compact_wq:        workqueue for page layout background optimization
  * @release_wq:        workqueue for safe page release
  * @work:      work_struct for safe page release
@@ -253,9 +255,8 @@ static inline void z3fold_page_unlock(struct z3fold_header *zhdr)
        spin_unlock(&zhdr->page_lock);
 }
 
-
-static inline struct z3fold_header *__get_z3fold_header(unsigned long handle,
-                                                       bool lock)
+/* return locked z3fold page if it's not headless */
+static inline struct z3fold_header *get_z3fold_header(unsigned long handle)
 {
        struct z3fold_buddy_slots *slots;
        struct z3fold_header *zhdr;
@@ -269,13 +270,12 @@ static inline struct z3fold_header *__get_z3fold_header(unsigned long handle,
                        read_lock(&slots->lock);
                        addr = *(unsigned long *)handle;
                        zhdr = (struct z3fold_header *)(addr & PAGE_MASK);
-                       if (lock)
-                               locked = z3fold_page_trylock(zhdr);
+                       locked = z3fold_page_trylock(zhdr);
                        read_unlock(&slots->lock);
                        if (locked)
                                break;
                        cpu_relax();
-               } while (lock);
+               } while (true);
        } else {
                zhdr = (struct z3fold_header *)(handle & PAGE_MASK);
        }
@@ -283,18 +283,6 @@ static inline struct z3fold_header *__get_z3fold_header(unsigned long handle,
        return zhdr;
 }
 
-/* Returns the z3fold page where a given handle is stored */
-static inline struct z3fold_header *handle_to_z3fold_header(unsigned long h)
-{
-       return __get_z3fold_header(h, false);
-}
-
-/* return locked z3fold page if it's not headless */
-static inline struct z3fold_header *get_z3fold_header(unsigned long h)
-{
-       return __get_z3fold_header(h, true);
-}
-
 static inline void put_z3fold_header(struct z3fold_header *zhdr)
 {
        struct page *page = virt_to_page(zhdr);
@@ -1060,6 +1048,7 @@ static void z3fold_destroy_pool(struct z3fold_pool *pool)
        destroy_workqueue(pool->compact_wq);
        destroy_workqueue(pool->release_wq);
        z3fold_unregister_migration(pool);
+       free_percpu(pool->unbuddied);
        kfree(pool);
 }
 
@@ -1383,7 +1372,7 @@ static int z3fold_reclaim_page(struct z3fold_pool *pool, unsigned int retries)
                        if (zhdr->foreign_handles ||
                            test_and_set_bit(PAGE_CLAIMED, &page->private)) {
                                if (kref_put(&zhdr->refcount,
-                                               release_z3fold_page))
+                                               release_z3fold_page_locked))
                                        atomic64_dec(&pool->pages_nr);
                                else
                                        z3fold_page_unlock(zhdr);