packages: kernel/kernel-tuxonice.patch, kernel/kernel.spec - update tuxonic...

arekm arekm at pld-linux.org
Sun Oct 17 12:51:08 CEST 2010


Author: arekm                        Date: Sun Oct 17 10:51:08 2010 GMT
Module: packages                      Tag: HEAD
---- Log message:
- update tuxonice patch for real 2.6.35 version (previous one was random snap)

---- Files affected:
packages/kernel:
   kernel-tuxonice.patch (1.16 -> 1.17) , kernel.spec (1.834 -> 1.835) 

---- Diffs:

================================================================
Index: packages/kernel/kernel-tuxonice.patch
diff -u packages/kernel/kernel-tuxonice.patch:1.16 packages/kernel/kernel-tuxonice.patch:1.17
--- packages/kernel/kernel-tuxonice.patch:1.16	Sat Aug 21 02:17:04 2010
+++ packages/kernel/kernel-tuxonice.patch	Sun Oct 17 12:51:02 2010
@@ -1,8 +1,8 @@
 diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
-index 1808f11..8e8d3b7 100644
+index 2b2407d..50fc7fb 100644
 --- a/Documentation/kernel-parameters.txt
 +++ b/Documentation/kernel-parameters.txt
-@@ -2773,6 +2773,9 @@ and is between 256 and 4096 characters. It is defined in the file
+@@ -2775,6 +2775,9 @@ and is between 256 and 4096 characters. It is defined in the file
  					HIGHMEM regardless of setting
  					of CONFIG_HIGHPTE.
  
@@ -1450,10 +1450,10 @@
 +   testing. His efforts have contributed as much to TuxOnIce as any of the
 +   names above.
 diff --git a/MAINTAINERS b/MAINTAINERS
-index 6d119c9..a2f6ce6 100644
+index 02f75fc..bd6a84f 100644
 --- a/MAINTAINERS
 +++ b/MAINTAINERS
-@@ -5679,6 +5679,13 @@ S:	Maintained
+@@ -5700,6 +5700,13 @@ S:	Maintained
  F:	drivers/tc/
  F:	include/linux/tc.h
  
@@ -1468,10 +1468,10 @@
  M:	Dario Ballabio <ballabio_dario at emc.com>
  L:	linux-scsi at vger.kernel.org
 diff --git a/arch/powerpc/mm/pgtable_32.c b/arch/powerpc/mm/pgtable_32.c
-index 9fc02dc..a99d7e7 100644
+index a87ead0..b8ac86e 100644
 --- a/arch/powerpc/mm/pgtable_32.c
 +++ b/arch/powerpc/mm/pgtable_32.c
-@@ -427,6 +427,7 @@ void kernel_map_pages(struct page *page, int numpages, int enable)
+@@ -423,6 +423,7 @@ void kernel_map_pages(struct page *page, int numpages, int enable)
  
  	change_page_attr(page, numpages, enable ? PAGE_KERNEL : __pgprot(0));
  }
@@ -1480,10 +1480,10 @@
  
  static int fixmaps;
 diff --git a/arch/x86/kernel/reboot.c b/arch/x86/kernel/reboot.c
-index 8e1aac8..84568af 100644
+index e3af342..482be9c 100644
 --- a/arch/x86/kernel/reboot.c
 +++ b/arch/x86/kernel/reboot.c
-@@ -718,6 +718,7 @@ void machine_restart(char *cmd)
+@@ -726,6 +726,7 @@ void machine_restart(char *cmd)
  {
  	machine_ops.restart(cmd);
  }
@@ -1586,7 +1586,7 @@
  obj-$(CONFIG_BLK_DEV_BSG)	+= bsg.o
  obj-$(CONFIG_BLK_CGROUP)	+= blk-cgroup.o
 diff --git a/block/blk-core.c b/block/blk-core.c
-index f84cce4..6c28098 100644
+index f0640d7..b485de4 100644
 --- a/block/blk-core.c
 +++ b/block/blk-core.c
 @@ -37,6 +37,9 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(block_remap);
@@ -1599,7 +1599,7 @@
  static int __make_request(struct request_queue *q, struct bio *bio);
  
  /*
-@@ -1582,6 +1585,9 @@ void submit_bio(int rw, struct bio *bio)
+@@ -1579,6 +1582,9 @@ void submit_bio(int rw, struct bio *bio)
  
  	bio->bi_rw |= rw;
  
@@ -1709,7 +1709,7 @@
 +EXPORT_SYMBOL_GPL(next_bdev_of_type);
 diff --git a/block/uuid.c b/block/uuid.c
 new file mode 100644
-index 0000000..37fd8e4
+index 0000000..d5dea70
 --- /dev/null
 +++ b/block/uuid.c
 @@ -0,0 +1,492 @@
@@ -1765,7 +1765,7 @@
 + { "vfat", "vfat", 0, 0, 1, "\353", 0x0, 0, 0 },
 + { "vfat", "vfat", 0, 0, 1, "\351", 0x0, 0, 0 },
 + { "vfat", "vfat", 0, 0x1fe, 2, "\125\252", 0x0, 0, 0 },
-+ { "xfs", "xfs", 0, 0, 4, "XFSB", 0x14, 0, 0 },
++ { "xfs", "xfs", 0, 0, 4, "XFSB", 0x20, 0, 0 },
 + { "romfs", "romfs", 0, 0, 8, "-rom1fs-", 0x0, 0, 0 },
 + { "bfs", "bfs", 0, 0, 4, "\316\372\173\033", 0, 0, 0 },
 + { "cramfs", "cramfs", 0, 0, 4, "E=\315\050", 0x0, 0, 0 },
@@ -2206,10 +2206,10 @@
 +
 +__setup("uuid_debug", uuid_debug_setup);
 diff --git a/crypto/Kconfig b/crypto/Kconfig
-index 9d9434f..b5911be 100644
+index df332c1..b0101c1 100644
 --- a/crypto/Kconfig
 +++ b/crypto/Kconfig
-@@ -816,6 +816,13 @@ config CRYPTO_LZO
+@@ -824,6 +824,13 @@ config CRYPTO_LZO
  	help
  	  This is the LZO algorithm.
  
@@ -2567,26 +2567,6 @@
 +MODULE_LICENSE("GPL");
 +MODULE_DESCRIPTION("LZF Compression Algorithm");
 +MODULE_AUTHOR("Marc Alexander Lehmann & Nigel Cunningham");
-diff --git a/drivers/base/power/main.c b/drivers/base/power/main.c
-index 941fcb8..1a2a2e7 100644
---- a/drivers/base/power/main.c
-+++ b/drivers/base/power/main.c
-@@ -69,6 +69,7 @@ void device_pm_lock(void)
- {
- 	mutex_lock(&dpm_list_mtx);
- }
-+EXPORT_SYMBOL_GPL(device_pm_lock);
- 
- /**
-  * device_pm_unlock - Unlock the list of active devices used by the PM core.
-@@ -77,6 +78,7 @@ void device_pm_unlock(void)
- {
- 	mutex_unlock(&dpm_list_mtx);
- }
-+EXPORT_SYMBOL_GPL(device_pm_unlock);
- 
- /**
-  * device_pm_add - Add a device to the PM core's list of active devices.
 diff --git a/drivers/char/vt.c b/drivers/char/vt.c
 index 7cdb6ee..f114914 100644
 --- a/drivers/char/vt.c
@@ -2614,10 +2594,10 @@
  		return -ENOMEM;
  
 diff --git a/drivers/md/md.c b/drivers/md/md.c
-index 46b3a04..883513f 100644
+index 7476d95..7a53775 100644
 --- a/drivers/md/md.c
 +++ b/drivers/md/md.c
-@@ -6602,6 +6602,9 @@ void md_do_sync(mddev_t *mddev)
+@@ -6634,6 +6634,9 @@ void md_do_sync(mddev_t *mddev)
  		mddev->curr_resync = 2;
  
  	try_again:
@@ -2627,7 +2607,7 @@
  		if (kthread_should_stop())
  			set_bit(MD_RECOVERY_INTR, &mddev->recovery);
  
-@@ -6624,6 +6627,10 @@ void md_do_sync(mddev_t *mddev)
+@@ -6656,6 +6659,10 @@ void md_do_sync(mddev_t *mddev)
  					 * time 'round when curr_resync == 2
  					 */
  					continue;
@@ -2638,7 +2618,7 @@
  				/* We need to wait 'interruptible' so as not to
  				 * contribute to the load average, and not to
  				 * be caught by 'softlockup'
-@@ -6636,6 +6643,7 @@ void md_do_sync(mddev_t *mddev)
+@@ -6668,6 +6675,7 @@ void md_do_sync(mddev_t *mddev)
  					       " share one or more physical units)\n",
  					       desc, mdname(mddev), mdname(mddev2));
  					mddev_put(mddev2);
@@ -2646,7 +2626,7 @@
  					if (signal_pending(current))
  						flush_signals(current);
  					schedule();
-@@ -6745,6 +6753,9 @@ void md_do_sync(mddev_t *mddev)
+@@ -6777,6 +6785,9 @@ void md_do_sync(mddev_t *mddev)
  						 || kthread_should_stop());
  		}
  
@@ -2656,7 +2636,7 @@
  		if (kthread_should_stop())
  			goto interrupted;
  
-@@ -6789,6 +6800,9 @@ void md_do_sync(mddev_t *mddev)
+@@ -6821,6 +6832,9 @@ void md_do_sync(mddev_t *mddev)
  			last_mark = next;
  		}
  
@@ -2666,8 +2646,17 @@
  
  		if (kthread_should_stop())
  			goto interrupted;
+@@ -6995,6 +7009,8 @@ void md_check_recovery(mddev_t *mddev)
+ {
+ 	mdk_rdev_t *rdev;
+ 
++	if (unlikely(freezer_is_on()))
++		return;
+ 
+ 	if (mddev->bitmap)
+ 		bitmap_daemon_work(mddev);
 diff --git a/fs/block_dev.c b/fs/block_dev.c
-index 99d6af8..f270494 100644
+index 4c54c86..79a77ac 100644
 --- a/fs/block_dev.c
 +++ b/fs/block_dev.c
 @@ -295,6 +295,93 @@ out:
@@ -3140,7 +3129,7 @@
  	if (d_mountpoint(dentry))
  		error = -EBUSY;
 diff --git a/fs/super.c b/fs/super.c
-index 5c35bc7..7c2e6e8 100644
+index c7765bd..197a0a3 100644
 --- a/fs/super.c
 +++ b/fs/super.c
 @@ -34,6 +34,8 @@
@@ -3153,7 +3142,7 @@
  
  /**
 diff --git a/include/linux/Kbuild b/include/linux/Kbuild
-index 2fc8e14..709a571 100644
+index 9aa9bca..121a9f4 100644
 --- a/include/linux/Kbuild
 +++ b/include/linux/Kbuild
 @@ -216,6 +216,7 @@ unifdef-y += filter.h
@@ -3214,7 +3203,7 @@
  static inline void freezer_do_not_count(void) {}
  static inline void freezer_count(void) {}
 diff --git a/include/linux/fs.h b/include/linux/fs.h
-index 471e1ff..63da27b 100644
+index f0f447a..be4dd65 100644
 --- a/include/linux/fs.h
 +++ b/include/linux/fs.h
 @@ -176,6 +176,7 @@ struct inodes_stat_t {
@@ -3233,7 +3222,7 @@
  #define MS_BORN		(1<<29)
  #define MS_ACTIVE	(1<<30)
  #define MS_NOUSER	(1<<31)
-@@ -235,6 +237,8 @@ struct inodes_stat_t {
+@@ -236,6 +238,8 @@ struct inodes_stat_t {
  #define S_NOCMTIME	128	/* Do not update file c/mtime */
  #define S_SWAPFILE	256	/* Do not truncate: swapon got its bmaps */
  #define S_PRIVATE	512	/* Inode is fs-internal */
@@ -3242,7 +3231,7 @@
  
  /*
   * Note that nosuid etc flags are inode-specific: setting some file-system
-@@ -382,6 +386,7 @@ struct inodes_stat_t {
+@@ -383,6 +387,7 @@ struct inodes_stat_t {
  #include <linux/capability.h>
  #include <linux/semaphore.h>
  #include <linux/fiemap.h>
@@ -3250,7 +3239,7 @@
  
  #include <asm/atomic.h>
  #include <asm/byteorder.h>
-@@ -1395,8 +1400,11 @@ enum {
+@@ -1396,8 +1401,11 @@ enum {
  	SB_FREEZE_TRANS = 2,
  };
  
@@ -3264,7 +3253,7 @@
  
  #define get_fs_excl() atomic_inc(&current->fs_excl)
  #define put_fs_excl() atomic_dec(&current->fs_excl)
-@@ -1954,6 +1962,13 @@ extern struct super_block *freeze_bdev(struct block_device *);
+@@ -1968,6 +1976,13 @@ extern struct super_block *freeze_bdev(struct block_device *);
  extern void emergency_thaw_all(void);
  extern int thaw_bdev(struct block_device *bdev, struct super_block *sb);
  extern int fsync_bdev(struct block_device *);
@@ -3304,7 +3293,7 @@
 +struct block_device *next_bdev_of_type(struct block_device *last,
 +	const char *key);
 diff --git a/include/linux/mm.h b/include/linux/mm.h
-index b969efb..1e63042 100644
+index a2b4804..90d0dfa 100644
 --- a/include/linux/mm.h
 +++ b/include/linux/mm.h
 @@ -98,6 +98,7 @@ extern unsigned int kobjsize(const void *objp);
@@ -3337,7 +3326,7 @@
  #define MAX_LINKS 32		
  
 diff --git a/include/linux/suspend.h b/include/linux/suspend.h
-index 5e781d8..a1c07f3 100644
+index bc7d6bb..311897c 100644
 --- a/include/linux/suspend.h
 +++ b/include/linux/suspend.h
 @@ -329,4 +329,70 @@ static inline void unlock_system_sleep(void)
@@ -3489,7 +3478,7 @@
  	sys_fchdir(old_fd);
  	sys_mount("/", ".", NULL, MS_MOVE, NULL);
 diff --git a/init/main.c b/init/main.c
-index 3bdb152..f74eb5b 100644
+index a42fdf4..5a4febe 100644
 --- a/init/main.c
 +++ b/init/main.c
 @@ -117,6 +117,7 @@ extern void softirq_init(void);
@@ -3553,7 +3542,7 @@
  struct task_struct *find_task_by_vpid(pid_t vnr)
  {
 diff --git a/kernel/power/Kconfig b/kernel/power/Kconfig
-index 5c36ea9..cd32677 100644
+index ca6066a..27524f6 100644
 --- a/kernel/power/Kconfig
 +++ b/kernel/power/Kconfig
 @@ -47,6 +47,13 @@ config CAN_PM_TRACE
@@ -3570,7 +3559,7 @@
  config PM_TRACE
  	bool
  	help
-@@ -197,6 +204,238 @@ config PM_STD_PARTITION
+@@ -198,6 +205,238 @@ config PM_STD_PARTITION
  	  suspended image to. It will simply pick the first available swap 
  	  device.
  
@@ -3810,7 +3799,7 @@
  	tristate "Advanced Power Management Emulation"
  	depends on PM && SYS_SUPPORTS_APM_EMULATION
 diff --git a/kernel/power/Makefile b/kernel/power/Makefile
-index 524e058..3d736f4 100644
+index f9063c6..a3a7444 100644
 --- a/kernel/power/Makefile
 +++ b/kernel/power/Makefile
 @@ -3,6 +3,35 @@ ifeq ($(CONFIG_PM_DEBUG),y)
@@ -4079,7 +4068,7 @@
  /**
   *	state - control system power state.
 diff --git a/kernel/power/power.h b/kernel/power/power.h
-index 006270f..a5e538f 100644
+index 006270f..28010f4 100644
 --- a/kernel/power/power.h
 +++ b/kernel/power/power.h
 @@ -31,8 +31,12 @@ static inline char *check_image_kernel(struct swsusp_info *info)
@@ -4112,7 +4101,7 @@
  /* Preferred image size in bytes (default 500 MB) */
  extern unsigned long image_size;
  extern int in_suspend;
-@@ -233,3 +240,86 @@ static inline void suspend_thaw_processes(void)
+@@ -233,3 +240,93 @@ static inline void suspend_thaw_processes(void)
  {
  }
  #endif
@@ -4172,25 +4161,32 @@
 +					 * bitmap objects and bitmap block
 +					 * objects
 +					 */
-+	struct bm_position cur;		/* most recently used bit position */
-+	struct bm_position iter;	/* most recently used bit position
-+					 * when iterating over a bitmap.
++	struct bm_position *states;	/* most recently used bit position */
++	int num_states;			/* when iterating over a bitmap and
++					 * number of states we support.
 +					 */
 +};
 +
 +extern int memory_bm_create(struct memory_bitmap *bm, gfp_t gfp_mask,
 +		int safe_needed);
++extern int memory_bm_create_index(struct memory_bitmap *bm, gfp_t gfp_mask,
++		int safe_needed, int index);
 +extern void memory_bm_free(struct memory_bitmap *bm, int clear_nosave_free);
 +extern void memory_bm_set_bit(struct memory_bitmap *bm, unsigned long pfn);
 +extern void memory_bm_clear_bit(struct memory_bitmap *bm, unsigned long pfn);
++extern void memory_bm_clear_bit_index(struct memory_bitmap *bm, unsigned long pfn, int index);
 +extern int memory_bm_test_bit(struct memory_bitmap *bm, unsigned long pfn);
++extern int memory_bm_test_bit_index(struct memory_bitmap *bm, unsigned long pfn, int index);
 +extern unsigned long memory_bm_next_pfn(struct memory_bitmap *bm);
++extern unsigned long memory_bm_next_pfn_index(struct memory_bitmap *bm,
++		int index);
 +extern void memory_bm_position_reset(struct memory_bitmap *bm);
 +extern void memory_bm_clear(struct memory_bitmap *bm);
 +extern void memory_bm_copy(struct memory_bitmap *source,
 +		struct memory_bitmap *dest);
 +extern void memory_bm_dup(struct memory_bitmap *source,
 +		struct memory_bitmap *dest);
++extern int memory_bm_set_iterators(struct memory_bitmap *bm, int number);
 +
 +#ifdef CONFIG_TOI
 +struct toi_module_ops;
@@ -4296,7 +4292,7 @@
 + */
 +EXPORT_SYMBOL_GPL(thaw_kernel_threads);
 diff --git a/kernel/power/snapshot.c b/kernel/power/snapshot.c
-index 25ce010..4fde437 100644
+index 25ce010..1d09a68 100644
 --- a/kernel/power/snapshot.c
 +++ b/kernel/power/snapshot.c
 @@ -35,6 +35,8 @@
@@ -4329,7 +4325,7 @@
  	return (unsigned long)get_image_page(gfp_mask, PG_SAFE);
  }
  
-@@ -232,47 +241,22 @@ static void *chain_alloc(struct chain_allocator *ca, unsigned int size)
+@@ -232,47 +241,53 @@ static void *chain_alloc(struct chain_allocator *ca, unsigned int size)
   *	the represented memory area.
   */
  
@@ -4350,12 +4346,20 @@
  }
  
 -/* strcut bm_position is used for browsing memory bitmaps */
--
++/* Functions that operate on memory bitmaps */
+ 
 -struct bm_position {
 -	struct bm_block *block;
 -	int bit;
 -};
--
++void memory_bm_position_reset_index(struct memory_bitmap *bm, int index)
++{
++	bm->states[index].block = list_entry(bm->blocks.next,
++				struct bm_block, hook);
++	bm->states[index].bit = 0;
++}
++EXPORT_SYMBOL_GPL(memory_bm_position_reset_index);
+ 
 -struct memory_bitmap {
 -	struct list_head blocks;	/* list of bitmap blocks */
 -	struct linked_page *p_list;	/* list of pages used to store zone
@@ -4364,37 +4368,78 @@
 -					 */
 -	struct bm_position cur;	/* most recently used bit position */
 -};
--
- /* Functions that operate on memory bitmaps */
++void memory_bm_position_reset(struct memory_bitmap *bm)
++{
++	int i;
+ 
+-/* Functions that operate on memory bitmaps */
++	for (i = 0; i < bm->num_states; i++) {
++		bm->states[i].block = list_entry(bm->blocks.next,
++				struct bm_block, hook);
++		bm->states[i].bit = 0;
++	}
++}
++EXPORT_SYMBOL_GPL(memory_bm_position_reset);
  
 -static void memory_bm_position_reset(struct memory_bitmap *bm)
-+void memory_bm_position_reset(struct memory_bitmap *bm)
++int memory_bm_set_iterators(struct memory_bitmap *bm, int number)
  {
- 	bm->cur.block = list_entry(bm->blocks.next, struct bm_block, hook);
- 	bm->cur.bit = 0;
+-	bm->cur.block = list_entry(bm->blocks.next, struct bm_block, hook);
+-	bm->cur.bit = 0;
 -}
++	int bytes = number * sizeof(struct bm_position);
++	struct bm_position *new_states;
++
++	if (number < bm->num_states)
++		return 0;
  
 -static void memory_bm_free(struct memory_bitmap *bm, int clear_nosave_free);
-+	bm->iter.block = list_entry(bm->blocks.next, struct bm_block, hook);
-+	bm->iter.bit = 0;
++	new_states = kmalloc(bytes, GFP_KERNEL);
++	if (!new_states)
++		return -ENOMEM;
++
++	if (bm->states)
++		kfree(bm->states);
++
++	bm->states = new_states;
++	bm->num_states = number;
++	return 0;
 +}
-+EXPORT_SYMBOL_GPL(memory_bm_position_reset);
++EXPORT_SYMBOL_GPL(memory_bm_set_iterators);
  
  /**
   *	create_bm_block_list - create a list of block bitmap objects
-@@ -380,7 +364,7 @@ static int create_mem_extents(struct list_head *list, gfp_t gfp_mask)
+@@ -380,8 +395,8 @@ static int create_mem_extents(struct list_head *list, gfp_t gfp_mask)
  /**
    *	memory_bm_create - allocate memory for a memory bitmap
    */
 -static int
-+int
- memory_bm_create(struct memory_bitmap *bm, gfp_t gfp_mask, int safe_needed)
+-memory_bm_create(struct memory_bitmap *bm, gfp_t gfp_mask, int safe_needed)
++int memory_bm_create_index(struct memory_bitmap *bm, gfp_t gfp_mask,
++		int safe_needed, int states)
  {
  	struct chain_allocator ca;
-@@ -436,11 +420,12 @@ memory_bm_create(struct memory_bitmap *bm, gfp_t gfp_mask, int safe_needed)
+ 	struct list_head mem_extents;
+@@ -425,6 +440,9 @@ memory_bm_create(struct memory_bitmap *bm, gfp_t gfp_mask, int safe_needed)
+ 		}
+ 	}
+ 
++	if (!error)
++		error = memory_bm_set_iterators(bm, states);
++
+ 	bm->p_list = ca.chain;
+ 	memory_bm_position_reset(bm);
+  Exit:
+@@ -436,11 +454,18 @@ memory_bm_create(struct memory_bitmap *bm, gfp_t gfp_mask, int safe_needed)
  	memory_bm_free(bm, PG_UNSAFE_CLEAR);
  	goto Exit;
  }
++EXPORT_SYMBOL_GPL(memory_bm_create_index);
++
++int memory_bm_create(struct memory_bitmap *bm, gfp_t gfp_mask, int safe_needed)
++{
++	return memory_bm_create_index(bm, gfp_mask, safe_needed, 1);
++}
 +EXPORT_SYMBOL_GPL(memory_bm_create);
  
  /**
@@ -4405,24 +4450,67 @@
  {
  	struct bm_block *bb;
  
-@@ -452,6 +437,7 @@ static void memory_bm_free(struct memory_bitmap *bm, int clear_nosave_free)
+@@ -451,15 +476,22 @@ static void memory_bm_free(struct memory_bitmap *bm, int clear_nosave_free)
+ 	free_list_of_pages(bm->p_list, clear_nosave_free);
  
  	INIT_LIST_HEAD(&bm->blocks);
++
++	if (bm->states) {
++		kfree(bm->states);
++		bm->states = NULL;
++		bm->num_states = 0;
++	}
  }
 +EXPORT_SYMBOL_GPL(memory_bm_free);
  
  /**
   *	memory_bm_find_bit - find the bit in the bitmap @bm that corresponds
-@@ -490,7 +476,7 @@ static int memory_bm_find_bit(struct memory_bitmap *bm, unsigned long pfn,
+  *	to given pfn.  The cur_zone_bm member of @bm and the cur_block member
+- *	of @bm->cur_zone_bm are updated.
++ *	of @bm->states[i]_zone_bm are updated.
+  */
+-static int memory_bm_find_bit(struct memory_bitmap *bm, unsigned long pfn,
+-				void **addr, unsigned int *bit_nr)
++static int memory_bm_find_bit_index(struct memory_bitmap *bm, unsigned long pfn,
++				void **addr, unsigned int *bit_nr, int state)
+ {
+ 	struct bm_block *bb;
+ 
+@@ -467,7 +499,7 @@ static int memory_bm_find_bit(struct memory_bitmap *bm, unsigned long pfn,
+ 	 * Check if the pfn corresponds to the current bitmap block and find
+ 	 * the block where it fits if this is not the case.
+ 	 */
+-	bb = bm->cur.block;
++	bb = bm->states[state].block;
+ 	if (pfn < bb->start_pfn)
+ 		list_for_each_entry_continue_reverse(bb, &bm->blocks, hook)
+ 			if (pfn >= bb->start_pfn)
+@@ -482,15 +514,21 @@ static int memory_bm_find_bit(struct memory_bitmap *bm, unsigned long pfn,
+ 		return -EFAULT;
+ 
+ 	/* The block has been found */
+-	bm->cur.block = bb;
++	bm->states[state].block = bb;
+ 	pfn -= bb->start_pfn;
+-	bm->cur.bit = pfn + 1;
++	bm->states[state].bit = pfn + 1;
+ 	*bit_nr = pfn;
+ 	*addr = bb->data;
  	return 0;
  }
  
 -static void memory_bm_set_bit(struct memory_bitmap *bm, unsigned long pfn)
++static int memory_bm_find_bit(struct memory_bitmap *bm, unsigned long pfn,
++				void **addr, unsigned int *bit_nr)
++{
++	return memory_bm_find_bit_index(bm, pfn, addr, bit_nr, 0);
++}
++
 +void memory_bm_set_bit(struct memory_bitmap *bm, unsigned long pfn)
  {
  	void *addr;
  	unsigned int bit;
-@@ -500,6 +486,7 @@ static void memory_bm_set_bit(struct memory_bitmap *bm, unsigned long pfn)
+@@ -500,6 +538,7 @@ static void memory_bm_set_bit(struct memory_bitmap *bm, unsigned long pfn)
  	BUG_ON(error);
  	set_bit(bit, addr);
  }
@@ -4430,49 +4518,69 @@
  
  static int mem_bm_set_bit_check(struct memory_bitmap *bm, unsigned long pfn)
  {
-@@ -513,7 +500,7 @@ static int mem_bm_set_bit_check(struct memory_bitmap *bm, unsigned long pfn)
+@@ -513,27 +552,43 @@ static int mem_bm_set_bit_check(struct memory_bitmap *bm, unsigned long pfn)
  	return error;
  }
  
 -static void memory_bm_clear_bit(struct memory_bitmap *bm, unsigned long pfn)
-+void memory_bm_clear_bit(struct memory_bitmap *bm, unsigned long pfn)
++void memory_bm_clear_bit_index(struct memory_bitmap *bm, unsigned long pfn,
++		int index)
  {
  	void *addr;
  	unsigned int bit;
-@@ -523,8 +510,9 @@ static void memory_bm_clear_bit(struct memory_bitmap *bm, unsigned long pfn)
+ 	int error;
+ 
+-	error = memory_bm_find_bit(bm, pfn, &addr, &bit);
++	error = memory_bm_find_bit_index(bm, pfn, &addr, &bit, index);
  	BUG_ON(error);
  	clear_bit(bit, addr);
  }
<<Diff was trimmed, longer than 597 lines>>

---- CVS-web:
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/kernel/kernel-tuxonice.patch?r1=1.16&r2=1.17&f=u
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/kernel/kernel.spec?r1=1.834&r2=1.835&f=u



More information about the pld-cvs-commit mailing list