diff options
Diffstat (limited to 'sys-kernel/suspend2-sources/files/suspend2-2.2-rc13-filewriter.patch')
-rw-r--r-- | sys-kernel/suspend2-sources/files/suspend2-2.2-rc13-filewriter.patch | 156 |
1 files changed, 156 insertions, 0 deletions
diff --git a/sys-kernel/suspend2-sources/files/suspend2-2.2-rc13-filewriter.patch b/sys-kernel/suspend2-sources/files/suspend2-2.2-rc13-filewriter.patch new file mode 100644 index 000000000000..eee9fc9fea98 --- /dev/null +++ b/sys-kernel/suspend2-sources/files/suspend2-2.2-rc13-filewriter.patch @@ -0,0 +1,156 @@ +diff -ruNp 9770-filewriter.patch-old/kernel/power/io.c 9770-filewriter.patch-new/kernel/power/io.c +--- 9770-filewriter.patch-old/kernel/power/io.c 2005-11-26 00:09:09.000000000 +1100 ++++ 9770-filewriter.patch-new/kernel/power/io.c 2005-11-26 00:07:52.000000000 +1100 +@@ -690,11 +690,9 @@ int write_image_header(void) + } + + /* Write suspend header */ +- printk("Writing image header.\n"); + fill_suspend_header((struct suspend_header *) header_buffer); + active_writer->ops.writer.write_header_chunk(header_buffer, + sizeof(struct suspend_header)); +- printk("Done.\n"); + + free_page((unsigned long) header_buffer); + +diff -ruNp 9770-filewriter.patch-old/kernel/power/suspend_file.c 9770-filewriter.patch-new/kernel/power/suspend_file.c +--- 9770-filewriter.patch-old/kernel/power/suspend_file.c 2005-11-26 00:09:09.000000000 +1100 ++++ 9770-filewriter.patch-new/kernel/power/suspend_file.c 2005-11-26 00:02:36.000000000 +1100 +@@ -300,7 +300,8 @@ static void filewriter_cleanup(int finis + } + } + +-static void filewriter_get_target_info(char *target, int get_size) ++static void filewriter_get_target_info(char *target, int get_size, ++ int resume2) + { + if (target_file) + filewriter_cleanup(0); +@@ -310,7 +311,7 @@ static void filewriter_get_target_info(c + + target_file = filp_open(target, O_RDWR, 0); + +- if (target_file <= 0) { ++ if (IS_ERR(target_file) || !target_file) { + printk("Open file %s returned %p.\n", target, target_file); + target_file = NULL; + return; +@@ -333,10 +334,11 @@ static void filewriter_get_target_info(c + } else + target_bdev = target_inode->i_sb->s_bdev; + +- target_firstblock = bmap(target_inode, 0); +- + get_target_info(get_size); + ++ if (!resume2) ++ target_firstblock = bmap(target_inode, 0) << target_bmap_shift; ++ + return; + cleanup: + target_inode = NULL; +@@ -672,13 +674,13 @@ static int filewriter_write_header_clean + + /* Adjust image header */ + suspend_bio_ops.bdev_page_io(READ, target_bdev, +- target_firstblock << target_bmap_shift, ++ target_firstblock, + virt_to_page(filewriter_buffer)); + + prepare_signature(first_header_submit_info, filewriter_buffer); + + suspend_bio_ops.bdev_page_io(WRITE, target_bdev, +- target_firstblock << target_bmap_shift, ++ target_firstblock, + virt_to_page(filewriter_buffer)); + + free_page((unsigned long) filewriter_buffer); +@@ -736,13 +738,12 @@ static int file_init(void) + + /* Read filewriter configuration */ + suspend_bio_ops.bdev_page_io(READ, target_bdev, +- target_firstblock << target_bmap_shift, ++ target_firstblock, + virt_to_page((unsigned long) filewriter_buffer)); + + suspend_message(SUSPEND_WRITER, SUSPEND_HIGH, 0, +- "Retrieving %d bytes from %x:%x to page %d, %p-%p.\n", ++ "Retrieving from %x:%x to page %d, %p-%p.\n", + target_bdev->bd_dev, target_firstblock, +- sizeof(filewriter_header_data), + filewriter_page_index, + filewriter_buffer, filewriter_buffer + sizeof(filewriter_header_data) - 1); + +@@ -826,17 +827,9 @@ static int filewriter_read_header_chunk( + suspend_message(SUSPEND_WRITER, SUSPEND_HIGH, 0, + "Reading header page %d. ", + filewriter_page_index); +- suspend_message(SUSPEND_WRITER, SUSPEND_HIGH, 0, +- "Dev is %x. Block is %lu. Blocksperpage is %d. ", +- target_bdev, +- next, +- target_blocksperpage); +- suspend_message(SUSPEND_WRITER, SUSPEND_HIGH, 0, +- "Bd_block_size is %d.\n", +- target_bdev->bd_block_size); + + suspend_bio_ops.bdev_page_io(READ, target_bdev, +- next << target_bmap_shift, ++ next, + virt_to_page(filewriter_buffer)); + } + +@@ -1088,7 +1081,7 @@ static int filewriter_signature_op(int o + } + + suspend_bio_ops.bdev_page_io(READ, target_bdev, +- target_firstblock << target_bmap_shift, ++ target_firstblock, + virt_to_page(cur)); + + result = parse_signature(cur); +@@ -1112,7 +1105,7 @@ static int filewriter_signature_op(int o + + if (changed) + suspend_bio_ops.bdev_page_io(WRITE, target_bdev, +- target_firstblock << target_bmap_shift, ++ target_firstblock, + virt_to_page(cur)); + + out: +@@ -1282,7 +1275,7 @@ static int filewriter_parse_sig_location + } + } + +- filewriter_get_target_info(commandline, 0); ++ filewriter_get_target_info(commandline, 0, 1); + + if (colon) + *colon = ':'; +@@ -1333,7 +1326,7 @@ static void filewriter_set_resume2(void) + + if (sector) + offset += snprintf(buffer + offset, PAGE_SIZE - offset, +- ":0x%lx", sector); ++ ":0x%lx", sector << target_bmap_shift); + } else + offset += snprintf(buffer + offset, PAGE_SIZE - offset, + "%s is not a valid target.", filewriter_target); +@@ -1373,7 +1366,7 @@ static void filewriter_load_config_info( + + static void test_filewriter_target(void) + { +- filewriter_get_target_info(filewriter_target, 0); ++ filewriter_get_target_info(filewriter_target, 0, 0); + if (filewriter_signature_op(GET_IMAGE_EXISTS) > -1) { + printk(name_suspend "Filewriter: File signature found.\n"); + filewriter_set_resume2(); +@@ -1403,7 +1396,7 @@ static int filewriter_initialise(int sta + } + + if (filewriter_target) +- filewriter_get_target_info(filewriter_target, starting_cycle); ++ filewriter_get_target_info(filewriter_target, starting_cycle, 0); + + if (starting_cycle && (filewriter_image_exists() == -1)) { + printk("%s is does not have a valid signature for suspending.\n", |