Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ericvh...
[pandora-kernel.git] / drivers / staging / ramzswap / ramzswap_drv.h
index c7e0e76..63c3042 100644 (file)
@@ -31,8 +31,7 @@ static const unsigned max_num_devices = 32;
  * Stored at beginning of each compressed object.
  *
  * It stores back-reference to table entry which points to this
- * object. This is required to support memory defragmentation or
- * migrating compressed pages to backing swap disk.
+ * object. This is required to support memory defragmentation.
  */
 struct zobj_header {
 #if 0
@@ -44,27 +43,17 @@ struct zobj_header {
 
 /* Default ramzswap disk size: 25% of total RAM */
 static const unsigned default_disksize_perc_ram = 25;
-static const unsigned default_memlimit_perc_ram = 15;
 
 /*
- * Max compressed page size when backing device is provided.
- * Pages that compress to size greater than this are sent to
- * physical swap disk.
- */
-static const unsigned max_zpage_size_bdev = PAGE_SIZE / 2;
-
-/*
- * Max compressed page size when there is no backing dev.
  * Pages that compress to size greater than this are stored
  * uncompressed in memory.
  */
-static const unsigned max_zpage_size_nobdev = PAGE_SIZE / 4 * 3;
+static const unsigned max_zpage_size = PAGE_SIZE / 4 * 3;
 
 /*
- * NOTE: max_zpage_size_{bdev,nobdev} sizes must be
- * less than or equal to:
+ * NOTE: max_zpage_size must be less than or equal to:
  *   XV_MAX_ALLOC_SIZE - sizeof(struct zobj_header)
- * since otherwise xv_malloc would always return failure.
+ * otherwise, xv_malloc() would always return failure.
  */
 
 /*-- End of configurable params */
@@ -98,15 +87,6 @@ struct table {
        u8 flags;
 } __attribute__((aligned(4)));
 
-/*
- * Swap extent information in case backing swap is a regular
- * file. These extent entries must fit exactly in a page.
- */
-struct ramzswap_backing_extent {
-       pgoff_t phy_pagenum;
-       pgoff_t num_pages;
-} __attribute__((aligned(4)));
-
 struct ramzswap_stats {
        /* basic stats */
        size_t compr_size;      /* compressed size of pages stored -
@@ -123,8 +103,6 @@ struct ramzswap_stats {
        u32 pages_stored;       /* no. of pages currently stored */
        u32 good_compress;      /* % of pages with compression ratio<=50% */
        u32 pages_expand;       /* % of incompressible pages */
-       u64 bdev_num_reads;     /* no. of reads on backing dev */
-       u64 bdev_num_writes;    /* no. of writes on backing dev */
 #endif
 };
 
@@ -138,11 +116,6 @@ struct ramzswap {
        struct request_queue *queue;
        struct gendisk *disk;
        int init_done;
-       /*
-        * This is limit on compressed data size (stats.compr_size)
-        * Its applicable only when backing swap device is present.
-        */
-       size_t memlimit;        /* bytes */
        /*
         * This is limit on amount of *uncompressed* worth of data
         * we can hold. When backing swap device is provided, it is
@@ -151,14 +124,6 @@ struct ramzswap {
        size_t disksize;        /* bytes */
 
        struct ramzswap_stats stats;
-
-       /* backing swap device info */
-       struct ramzswap_backing_extent *curr_extent;
-       struct list_head backing_swap_extent_list;
-       unsigned long num_extents;
-       char backing_swap_name[MAX_SWAP_NAME_LEN];
-       struct block_device *backing_swap;
-       struct file *swap_file;
 };
 
 /*-- */
@@ -182,13 +147,6 @@ static void rzs_stat64_inc(struct ramzswap *rzs, u64 *v)
        spin_unlock(&rzs->stat64_lock);
 }
 
-static void rzs_stat64_dec(struct ramzswap *rzs, u64 *v)
-{
-       spin_lock(&rzs->stat64_lock);
-       *v = *v - 1;
-       spin_unlock(&rzs->stat64_lock);
-}
-
 static u64 rzs_stat64_read(struct ramzswap *rzs, u64 *v)
 {
        u64 val;
@@ -203,7 +161,6 @@ static u64 rzs_stat64_read(struct ramzswap *rzs, u64 *v)
 #define rzs_stat_inc(v)
 #define rzs_stat_dec(v)
 #define rzs_stat64_inc(r, v)
-#define rzs_stat64_dec(r, v)
 #define rzs_stat64_read(r, v)
 #endif /* CONFIG_RAMZSWAP_STATS */