Author: arekm                        Date: Sat Mar  6 20:17:56 2010 GMT
Module: packages                      Tag: HEAD
---- Log message:
- update tuxonice and vserver patches

---- Files affected:
packages/kernel:
   kernel-tuxonice.patch (1.9 -> 1.10) , kernel-vserver-2.3.patch (1.33 -> 
1.34) , kernel-vserver-fixes.patch (1.12 -> 1.13) , kernel.spec (1.760 -> 
1.761) 

---- Diffs:

================================================================
Index: packages/kernel/kernel-tuxonice.patch
diff -u packages/kernel/kernel-tuxonice.patch:1.9 
packages/kernel/kernel-tuxonice.patch:1.10
--- packages/kernel/kernel-tuxonice.patch:1.9   Fri Dec  4 20:21:52 2009
+++ packages/kernel/kernel-tuxonice.patch       Sat Mar  6 21:17:49 2010
@@ -1,3 +1,17 @@
+diff --git a/Documentation/kernel-parameters.txt 
b/Documentation/kernel-parameters.txt
+index 736d456..c3048d7 100644
+--- a/Documentation/kernel-parameters.txt
++++ b/Documentation/kernel-parameters.txt
+@@ -2694,6 +2694,9 @@ and is between 256 and 4096 characters. It is defined in 
the file
+                                       medium is write-protected).
+                       Example: quirks=0419:aaf5:rl,0421:0433:rc
+ 
++      uuid_debug=     (Boolean) whether to enable debugging of TuxOnIce's
++                      uuid support.
++
+       vdso=           [X86,SH]
+                       vdso=2: enable compat VDSO (default with COMPAT_VDSO)
+                       vdso=1: enable VDSO (default)
 diff --git a/Documentation/power/tuxonice-internals.txt 
b/Documentation/power/tuxonice-internals.txt
 new file mode 100644
 index 0000000..7a96186
@@ -1436,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 4f96ac8..21b92f2 100644
+index 03f38c1..0087fd5 100644
 --- a/MAINTAINERS
 +++ b/MAINTAINERS
-@@ -5259,6 +5259,13 @@ S:      Maintained
+@@ -5378,6 +5378,13 @@ S:      Maintained
  F:    drivers/tc/
  F:    include/linux/tc.h
  
@@ -1454,10 +1468,10 @@
  M:    Dario Ballabio <[email protected]>
  L:    [email protected]
 diff --git a/arch/powerpc/mm/pgtable_32.c b/arch/powerpc/mm/pgtable_32.c
-index cb96cb2..2be8da2 100644
+index 573b3bd..073736f 100644
 --- a/arch/powerpc/mm/pgtable_32.c
 +++ b/arch/powerpc/mm/pgtable_32.c
-@@ -396,6 +396,7 @@ void kernel_map_pages(struct page *page, int numpages, int 
enable)
+@@ -422,6 +422,7 @@ void kernel_map_pages(struct page *page, int numpages, int 
enable)
  
        change_page_attr(page, numpages, enable ? PAGE_KERNEL : __pgprot(0));
  }
@@ -1466,10 +1480,10 @@
  
  static int fixmaps;
 diff --git a/arch/x86/kernel/reboot.c b/arch/x86/kernel/reboot.c
-index f930787..869133f 100644
+index 704bddc..acdf978 100644
 --- a/arch/x86/kernel/reboot.c
 +++ b/arch/x86/kernel/reboot.c
-@@ -693,6 +693,7 @@ void machine_restart(char *cmd)
+@@ -710,6 +710,7 @@ void machine_restart(char *cmd)
  {
        machine_ops.restart(cmd);
  }
@@ -1478,10 +1492,10 @@
  void machine_halt(void)
  {
 diff --git a/arch/x86/mm/pageattr.c b/arch/x86/mm/pageattr.c
-index dd38bfb..26b3bbf 100644
+index 1d4eb93..035b423 100644
 --- a/arch/x86/mm/pageattr.c
 +++ b/arch/x86/mm/pageattr.c
-@@ -1274,6 +1274,7 @@ void kernel_map_pages(struct page *page, int numpages, 
int enable)
+@@ -1296,6 +1296,7 @@ void kernel_map_pages(struct page *page, int numpages, 
int enable)
         */
        __flush_tlb_all();
  }
@@ -1489,7 +1503,7 @@
  
  #ifdef CONFIG_HIBERNATION
  
-@@ -1288,7 +1289,7 @@ bool kernel_page_present(struct page *page)
+@@ -1310,7 +1311,7 @@ bool kernel_page_present(struct page *page)
        pte = lookup_address((unsigned long)page_address(page), &level);
        return (pte_val(*pte) & _PAGE_PRESENT);
  }
@@ -1499,10 +1513,10 @@
  
  #endif /* CONFIG_DEBUG_PAGEALLOC */
 diff --git a/arch/x86/power/cpu.c b/arch/x86/power/cpu.c
-index 8aa85f1..b22c157 100644
+index 0a979f3..7cdace5 100644
 --- a/arch/x86/power/cpu.c
 +++ b/arch/x86/power/cpu.c
-@@ -111,9 +111,7 @@ void save_processor_state(void)
+@@ -112,9 +112,7 @@ void save_processor_state(void)
  {
        __save_processor_state(&saved_context);
  }
@@ -1558,7 +1572,7 @@
  }
 +EXPORT_SYMBOL_GPL(arch_hibernation_header_restore);
 diff --git a/block/Makefile b/block/Makefile
-index ba74ca6..aa30a88 100644
+index cb2d515..f35a848 100644
 --- a/block/Makefile
 +++ b/block/Makefile
 @@ -5,7 +5,7 @@
@@ -1569,9 +1583,9 @@
 +                      blk-iopoll.o ioctl.o genhd.o scsi_ioctl.o uuid.o
  
  obj-$(CONFIG_BLK_DEV_BSG)     += bsg.o
- obj-$(CONFIG_IOSCHED_NOOP)    += noop-iosched.o
+ obj-$(CONFIG_BLK_CGROUP)      += blk-cgroup.o
 diff --git a/block/blk-core.c b/block/blk-core.c
-index 71da511..e338e9d 100644
+index 718897e..70b4bd9 100644
 --- a/block/blk-core.c
 +++ b/block/blk-core.c
 @@ -37,6 +37,9 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(block_remap);
@@ -1595,7 +1609,7 @@
         * If it's a regular read/write or a barrier with data attached,
         * go through the normal accounting stuff before submission.
 diff --git a/block/genhd.c b/block/genhd.c
-index 517e433..9a5fa6f 100644
+index d13ba76..a69521c 100644
 --- a/block/genhd.c
 +++ b/block/genhd.c
 @@ -18,6 +18,8 @@
@@ -1607,7 +1621,7 @@
  
  #include "blk.h"
  
-@@ -1274,3 +1276,30 @@ int invalidate_partition(struct gendisk *disk, int 
partno)
+@@ -1286,3 +1288,82 @@ int invalidate_partition(struct gendisk *disk, int 
partno)
  }
  
  EXPORT_SYMBOL(invalidate_partition);
@@ -1638,35 +1652,95 @@
 +      return devt;
 +}
 +EXPORT_SYMBOL_GPL(blk_lookup_uuid);
++
++/* Caller uses NULL, key to start. For each match found, we return a bdev on
++ * which we have done blkdev_get, and we do the blkdev_put on block devices
++ * that are passed to us. When no more matches are found, we return NULL.
++ */
++struct block_device *next_bdev_of_type(struct block_device *last,
++      const char *key)
++{
++      dev_t devt = MKDEV(0, 0);
++      struct class_dev_iter iter;
++      struct device *dev;
++      struct block_device *next = NULL, *bdev;
++      int got_last = 0;
++
++      if (!key)
++              goto out;
++
++      class_dev_iter_init(&iter, &block_class, NULL, &disk_type);
++      while (!devt && (dev = class_dev_iter_next(&iter))) {
++              struct gendisk *disk = dev_to_disk(dev);
++              struct disk_part_iter piter;
++              struct hd_struct *part;
++
++              disk_part_iter_init(&piter, disk, DISK_PITER_INCL_PART0);
++
++              while ((part = disk_part_iter_next(&piter))) {
++                      bdev = bdget(part_devt(part));
++                      if (last && !got_last) {
++                              if (last == bdev)
++                                      got_last = 1;
++                              continue;
++                      }
++
++                      if (blkdev_get(bdev, FMODE_READ))
++                              continue;
++
++                      if (bdev_matches_key(bdev, key)) {
++                              next = bdev;
++                              break;
++                      }
++
++                      blkdev_put(bdev, FMODE_READ);
++              }
++              disk_part_iter_exit(&piter);
++      }
++      class_dev_iter_exit(&iter);
++out:
++      if (last)
++              blkdev_put(last, FMODE_READ);
++      return next;
++}
++EXPORT_SYMBOL_GPL(next_bdev_of_type);
 diff --git a/block/uuid.c b/block/uuid.c
 new file mode 100644
-index 0000000..fefc3ed
+index 0000000..3862685
 --- /dev/null
 +++ b/block/uuid.c
-@@ -0,0 +1,366 @@
+@@ -0,0 +1,528 @@
 +#include <linux/blkdev.h>
 +#include <linux/ctype.h>
++#include <linux/uuid.h>
 +
-+#if 0
-+#define PRINTK(fmt, args...) printk(KERN_DEBUG fmt, ## args)
-+#define PRINT_HEX_DUMP(v1, v2, v3, v4, v5, v6, v7, v8) \
-+      print_hex_dump(v1, v2, v3, v4, v5, v6, v7, v8)
-+#else
-+#define PRINTK(fmt, args...)
-+#define PRINT_HEX_DUMP(v1, v2, v3, v4, v5, v6, v7, v8)
-+#endif
++static int debug_enabled;
++
++#define PRINTK(fmt, args...) do {                                     \
++      if (debug_enabled)                                              \
++              printk(KERN_DEBUG fmt, ## args);                        \
++      } while(0)
++
++#define PRINT_HEX_DUMP(v1, v2, v3, v4, v5, v6, v7, v8)                        
\
++      do {                                                            \
++              if (debug_enabled)                                      \
++                      print_hex_dump(v1, v2, v3, v4, v5, v6, v7, v8); \
++      } while(0)
 +
 +/*
 + * Simple UUID translation
 + */
 +
 +struct uuid_info {
++      const char *key;
 +      const char *name;
 +      long bkoff;
 +      unsigned sboff;
 +      unsigned sig_len;
 +      const char *magic;
 +      int uuid_offset;
++      int last_mount_offset;
++      int last_mount_size;
 +};
 +
 +/*
@@ -1674,104 +1748,110 @@
 + * have uuid offsets for all of these yet - mssing ones are 0x0.
 + * Further information welcome.
 + *
-+ * Rearranged by sector of fs signature for optimisation.
++ * Rearranged by page of fs signature for optimisation.
 + */
 +static struct uuid_info uuid_list[] = {
-+  { "oracleasm", 0,   32,  8, "ORCLDISK",             0x0 },
-+  { "ntfs",    0,      3,  8, "NTFS    ",             0x0 },
-+  { "vfat",      0,   0x52,  5, "MSWIN",                0x0 },
-+  { "vfat",      0,   0x52,  8, "FAT32   ",             0x0 },
-+  { "vfat",      0,   0x36,  5, "MSDOS",                0x0 },
-+  { "vfat",      0,   0x36,  8, "FAT16   ",             0x0 },
-+  { "vfat",      0,   0x36,  8, "FAT12   ",             0x0 },
-+  { "vfat",      0,      0,  1, "\353",                 0x0 },
-+  { "vfat",      0,      0,  1, "\351",                 0x0 },
-+  { "vfat",      0,  0x1fe,  2, "\125\252",             0x0 },
-+  { "xfs",     0,      0,  4, "XFSB",                 0x14 },
-+  { "romfs",   0,      0,  8, "-rom1fs-",             0x0 },
-+  { "bfs",     0,      0,  4, "\316\372\173\033",     0 },
-+  { "cramfs",  0,      0,  4, "E=\315\050",           0x0 },
-+  { "qnx4",    0,      4,  6, "QNX4FS",               0 },
-+  { "crypt_LUKS", 0,   0,  6, "LUKS\xba\xbe",         0x0 },
-+  { "squashfs",        0,      0,  4, "sqsh",                 0 },
-+  { "squashfs",        0,      0,  4, "hsqs",                 0 },
-+  { "ocfs",    0,      8,  9, "OracleCFS",            0x0 },
-+  { "lvm2pv",  0,  0x018,  8, "LVM2 001",             0x0 },
-+  { "sysv",    0,  0x3f8,  4, "\020~\030\375",        0 },
-+  { "jbd",     1,   0x38,  2, "\123\357",             0x0 },
-+  { "ext4dev",         1,   0x38,  2, "\123\357",             0x468 },
-+  { "ext4",    1,   0x38,  2, "\123\357",             0x468 },
-+  { "ext3",    1,   0x38,  2, "\123\357",             0x468 },
-+  { "ext2",    1,   0x38,  2, "\123\357",             0x468 },
-+  { "minix",     1,   0x10,  2, "\177\023",             0 },
-+  { "minix",     1,   0x10,  2, "\217\023",             0 },
-+  { "minix",   1,   0x10,  2, "\150\044",             0 },
-+  { "minix",   1,   0x10,  2, "\170\044",             0 },
-+  { "lvm2pv",  1,  0x018,  8, "LVM2 001",             0x0 },
-+  { "vxfs",    1,      0,  4, "\365\374\001\245",     0 },
-+  { "hfsplus",         1,      0,  2, "BD",                   0x0 },
-+  { "hfsplus",         1,      0,  2, "H+",                   0x0 },
-+  { "hfsplus",         1,      0,  2, "HX",                   0x0 },
-+  { "hfs",     1,      0,  2, "BD",                   0x0 },
-+  { "ocfs2",   1,      0,  6, "OCFSV2",               0x0 },
-+  { "lvm2pv",  0,  0x218,  8, "LVM2 001",             0x0 },
-+  { "lvm2pv",  1,  0x218,  8, "LVM2 001",             0x0 },
-+  { "ocfs2",   2,      0,  6, "OCFSV2",               0x0 },
-+  { "swap",    0,  0xff6, 10, "SWAP-SPACE",           0x40c },
-+  { "swap",    0,  0xff6, 10, "SWAPSPACE2",           0x40c },
-+  { "swsuspend", 0,  0xff6,  9, "S1SUSPEND",          0x40c },
-+  { "swsuspend", 0,  0xff6,  9, "S2SUSPEND",          0x40c },
-+  { "swsuspend", 0,  0xff6,  9, "ULSUSPEND",          0x40c },
-+  { "ocfs2",   4,      0,  6, "OCFSV2",               0x0 },
-+  { "ocfs2",   8,      0,  6, "OCFSV2",               0x0 },
-+  { "hpfs",    8,      0,  4, "I\350\225\371",        0 },
-+  { "reiserfs",        8,   0x34,  8, "ReIsErFs",             0x10054 },
-+  { "reiserfs",        8,     20,  8, "ReIsErFs",             0x10054 },
-+  { "zfs",       8,    0,  8, "\0\0\x02\xf5\xb0\x07\xb1\x0c", 0x0 },
-+  { "zfs",       8,    0,  8, "\x0c\xb1\x07\xb0\xf5\x02\0\0", 0x0 },
-+  { "ufs",     8,  0x55c,  4, "T\031\001\000",        0 },
-+  { "swap",    0, 0x1ff6, 10, "SWAP-SPACE",           0x40c },
-+  { "swap",    0, 0x1ff6, 10, "SWAPSPACE2",           0x40c },
-+  { "swsuspend", 0, 0x1ff6,  9, "S1SUSPEND",          0x40c },
-+  { "swsuspend", 0, 0x1ff6,  9, "S2SUSPEND",          0x40c },
-+  { "swsuspend", 0, 0x1ff6,  9, "ULSUSPEND",          0x40c },
-+  { "reiserfs", 64,   0x34,  9, "ReIsEr2Fs",          0x10054 },
-+  { "reiserfs", 64,   0x34,  9, "ReIsEr3Fs",          0x10054 },
-+  { "reiserfs", 64,   0x34,  8, "ReIsErFs",           0x10054 },
-+  { "reiser4",  64,    0,  7, "ReIsEr4",              0x100544 },
-+  { "gfs2",     64,      0,  4, "\x01\x16\x19\x70",     0x0 },
-+  { "gfs",      64,      0,  4, "\x01\x16\x19\x70",     0x0 },
-+  { "btrfs",  64,   0x40,  8, "_BHRfS_M",             0x0 },
-+  { "swap",    0, 0x3ff6, 10, "SWAP-SPACE",           0x40c },
-+  { "swap",    0, 0x3ff6, 10, "SWAPSPACE2",           0x40c },
-+  { "swsuspend", 0, 0x3ff6,  9, "S1SUSPEND",          0x40c },
-+  { "swsuspend", 0, 0x3ff6,  9, "S2SUSPEND",          0x40c },
-+  { "swsuspend", 0, 0x3ff6,  9, "ULSUSPEND",          0x40c },
-+  { "udf",    32,      1,  5, "BEA01",                0x0 },
-+  { "udf",    32,      1,  5, "BOOT2",                0x0 },
-+  { "udf",    32,      1,  5, "CD001",                0x0 },
-+  { "udf",    32,      1,  5, "CDW02",                0x0 },
-+  { "udf",    32,      1,  5, "NSR02",                0x0 },
-+  { "udf",    32,      1,  5, "NSR03",                0x0 },
-+  { "udf",    32,      1,  5, "TEA01",                0x0 },
-+  { "iso9660",        32,      1,  5, "CD001",                0x0 },
-+  { "iso9660",        32,      9,  5, "CDROM",                0x0 },
-+  { "jfs",    32,      0,  4, "JFS1",                 0x88 },
-+  { "swap",    0, 0x7ff6, 10, "SWAP-SPACE",           0x40c },
-+  { "swap",    0, 0x7ff6, 10, "SWAPSPACE2",           0x40c },
-+  { "swsuspend", 0, 0x7ff6,  9, "S1SUSPEND",          0x40c },
-+  { "swsuspend", 0, 0x7ff6,  9, "S2SUSPEND",          0x40c },
-+  { "swsuspend", 0, 0x7ff6,  9, "ULSUSPEND",          0x40c },
-+  { "swap",    0, 0xfff6, 10, "SWAP-SPACE",           0x40c },
-+  { "swap",    0, 0xfff6, 10, "SWAPSPACE2",           0x40c },
-+  { "swsuspend", 0, 0xfff6,  9, "S1SUSPEND",          0x40c },
-+  { "swsuspend", 0, 0xfff6,  9, "S2SUSPEND",          0x40c },
-+  { "swsuspend", 0, 0xfff6,  9, "ULSUSPEND",          0x40c },
-+  { "zfs",     264,    0,  8, "\0\0\x02\xf5\xb0\x07\xb1\x0c", 0x0 },
-+  { "zfs",     264,    0,  8, "\x0c\xb1\x07\xb0\xf5\x02\0\0", 0x0 },
-+  { NULL,        0,      0,  0, NULL,                 0x0 }
++ { NULL, "oracleasm", 0, 32, 8, "ORCLDISK", 0x0, 0, 0 },
++ { "ntfs", "ntfs", 0, 3, 8, "NTFS    ", 0x0, 0, 0 },
++ { "vfat", "vfat", 0, 0x52, 5, "MSWIN", 0x0, 0, 0 },
++ { "vfat", "vfat", 0, 0x52, 8, "FAT32   ", 0x0, 0, 0 },
++ { "vfat", "vfat", 0, 0x36, 5, "MSDOS", 0x0, 0, 0 },
++ { "vfat", "vfat", 0, 0x36, 8, "FAT16   ", 0x0, 0, 0 },
++ { "vfat", "vfat", 0, 0x36, 8, "FAT12   ", 0x0, 0, 0 },
++ { "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 },
++ { "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 },
++ { "qnx4", "qnx4", 0, 4, 6, "QNX4FS", 0, 0, 0 },
++ { NULL, "crypt_LUKS", 0, 0, 6, "LUKS\xba\xbe", 0x0, 0, 0 },
++ { "squashfs", "squashfs", 0, 0, 4, "sqsh", 0, 0, 0 },
++ { "squashfs", "squashfs", 0, 0, 4, "hsqs", 0, 0, 0 },
++ { "ocfs", "ocfs", 0, 8, 9, "OracleCFS", 0x0, 0, 0 },
++ { "lvm2pv", "lvm2pv", 0, 0x018, 8, "LVM2 001", 0x0, 0, 0 },
++ { "sysv", "sysv", 0, 0x3f8, 4, "\020~\030\375", 0, 0, 0 },
++ { "ext", "ext", 1, 0x38, 2, "\123\357", 0x468, 0x42c, 4 },
++ { "minix", "minix", 1, 0x10, 2, "\177\023", 0, 0, 0 },
++ { "minix", "minix", 1, 0x10, 2, "\217\023", 0, 0, 0 },
++ { "minix", "minix", 1, 0x10, 2, "\150\044", 0, 0, 0 },
++ { "minix", "minix", 1, 0x10, 2, "\170\044", 0, 0, 0 },
++ { "lvm2pv", "lvm2pv", 1, 0x018, 8, "LVM2 001", 0x0, 0, 0 },
++ { "vxfs", "vxfs", 1, 0, 4, "\365\374\001\245", 0, 0, 0 },
++ { "hfsplus", "hfsplus", 1, 0, 2, "BD", 0x0, 0, 0 },
++ { "hfsplus", "hfsplus", 1, 0, 2, "H+", 0x0, 0, 0 },
++ { "hfsplus", "hfsplus", 1, 0, 2, "HX", 0x0, 0, 0 },
++ { "hfs", "hfs", 1, 0, 2, "BD", 0x0, 0, 0 },
++ { "ocfs2", "ocfs2", 1, 0, 6, "OCFSV2", 0x0, 0, 0 },
++ { "lvm2pv", "lvm2pv", 0, 0x218, 8, "LVM2 001", 0x0, 0, 0 },
++ { "lvm2pv", "lvm2pv", 1, 0x218, 8, "LVM2 001", 0x0, 0, 0 },
++ { "ocfs2", "ocfs2", 2, 0, 6, "OCFSV2", 0x0, 0, 0 },
++ { "swap", "swap", 0, 0xff6, 10, "SWAP-SPACE", 0x40c, 0, 0 },
++ { "swap", "swap", 0, 0xff6, 10, "SWAPSPACE2", 0x40c, 0, 0 },
++ { "swap", "swsuspend", 0, 0xff6, 9, "S1SUSPEND", 0x40c, 0, 0 },
++ { "swap", "swsuspend", 0, 0xff6, 9, "S2SUSPEND", 0x40c, 0, 0 },
++ { "swap", "swsuspend", 0, 0xff6, 9, "ULSUSPEND", 0x40c, 0, 0 },
++ { "ocfs2", "ocfs2", 4, 0, 6, "OCFSV2", 0x0, 0, 0 },
++ { "ocfs2", "ocfs2", 8, 0, 6, "OCFSV2", 0x0, 0, 0 },
++ { "hpfs", "hpfs", 8, 0, 4, "I\350\225\371", 0, 0, 0 },
++ { "reiserfs", "reiserfs", 8, 0x34, 8, "ReIsErFs", 0x10054, 0, 0 },
++ { "reiserfs", "reiserfs", 8, 20, 8, "ReIsErFs", 0x10054, 0, 0 },
++ { "zfs", "zfs", 8, 0, 8, "\0\0\x02\xf5\xb0\x07\xb1\x0c", 0x0, 0, 0 },
++ { "zfs", "zfs", 8, 0, 8, "\x0c\xb1\x07\xb0\xf5\x02\0\0", 0x0, 0, 0 },
++ { "ufs", "ufs", 8, 0x55c, 4, "T\031\001\000", 0, 0, 0 },
++ { "swap", "swap", 0, 0x1ff6, 10, "SWAP-SPACE", 0x40c, 0, 0 },
++ { "swap", "swap", 0, 0x1ff6, 10, "SWAPSPACE2", 0x40c, 0, 0 },
++ { "swap", "swsuspend", 0, 0x1ff6, 9, "S1SUSPEND", 0x40c, 0, 0 },
++ { "swap", "swsuspend", 0, 0x1ff6, 9, "S2SUSPEND", 0x40c, 0, 0 },
++ { "swap", "swsuspend", 0, 0x1ff6, 9, "ULSUSPEND", 0x40c, 0, 0 },
++ { "reiserfs", "reiserfs", 64, 0x34, 9, "ReIsEr2Fs", 0x10054, 0, 0 },
++ { "reiserfs", "reiserfs", 64, 0x34, 9, "ReIsEr3Fs", 0x10054, 0, 0 },
++ { "reiserfs", "reiserfs", 64, 0x34, 8, "ReIsErFs", 0x10054, 0, 0 },
++ { "reiser4", "reiser4", 64, 0, 7, "ReIsEr4", 0x100544, 0, 0 },
++ { "gfs2", "gfs2", 64, 0, 4, "\x01\x16\x19\x70", 0x0, 0, 0 },
++ { "gfs", "gfs", 64, 0, 4, "\x01\x16\x19\x70", 0x0, 0, 0 },
++ { "btrfs", "btrfs", 64, 0x40, 8, "_BHRfS_M", 0x0, 0, 0 },
++ { "swap", "swap", 0, 0x3ff6, 10, "SWAP-SPACE", 0x40c, 0, 0 },
++ { "swap", "swap", 0, 0x3ff6, 10, "SWAPSPACE2", 0x40c, 0, 0 },
++ { "swap", "swsuspend", 0, 0x3ff6, 9, "S1SUSPEND", 0x40c, 0, 0 },
++ { "swap", "swsuspend", 0, 0x3ff6, 9, "S2SUSPEND", 0x40c, 0, 0 },
++ { "swap", "swsuspend", 0, 0x3ff6, 9, "ULSUSPEND", 0x40c, 0, 0 },
++ { "udf", "udf", 32, 1, 5, "BEA01", 0x0, 0, 0 },
++ { "udf", "udf", 32, 1, 5, "BOOT2", 0x0, 0, 0 },
++ { "udf", "udf", 32, 1, 5, "CD001", 0x0, 0, 0 },
++ { "udf", "udf", 32, 1, 5, "CDW02", 0x0, 0, 0 },
++ { "udf", "udf", 32, 1, 5, "NSR02", 0x0, 0, 0 },
++ { "udf", "udf", 32, 1, 5, "NSR03", 0x0, 0, 0 },
++ { "udf", "udf", 32, 1, 5, "TEA01", 0x0, 0, 0 },
++ { "iso9660", "iso9660", 32, 1, 5, "CD001", 0x0, 0, 0 },
++ { "iso9660", "iso9660", 32, 9, 5, "CDROM", 0x0, 0, 0 },
++ { "jfs", "jfs", 32, 0, 4, "JFS1", 0x88, 0, 0 },
++ { "swap", "swap", 0, 0x7ff6, 10, "SWAP-SPACE", 0x40c, 0, 0 },
++ { "swap", "swap", 0, 0x7ff6, 10, "SWAPSPACE2", 0x40c, 0, 0 },
++ { "swap", "swsuspend", 0, 0x7ff6, 9, "S1SUSPEND", 0x40c, 0, 0 },
++ { "swap", "swsuspend", 0, 0x7ff6, 9, "S2SUSPEND", 0x40c, 0, 0 },
++ { "swap", "swsuspend", 0, 0x7ff6, 9, "ULSUSPEND", 0x40c, 0, 0 },
++ { "swap", "swap", 0, 0xfff6, 10, "SWAP-SPACE", 0x40c, 0, 0 },
++ { "swap", "swap", 0, 0xfff6, 10, "SWAPSPACE2", 0x40c, 0, 0 },
++ { "swap", "swsuspend", 0, 0xfff6, 9, "S1SUSPEND", 0x40c, 0, 0 },
++ { "swap", "swsuspend", 0, 0xfff6, 9, "S2SUSPEND", 0x40c, 0, 0 },
++ { "swap", "swsuspend", 0, 0xfff6, 9, "ULSUSPEND", 0x40c, 0, 0 },
++ { "zfs", "zfs", 264, 0, 8, "\0\0\x02\xf5\xb0\x07\xb1\x0c", 0x0, 0, 0 },
++ { "zfs", "zfs", 264, 0, 8, "\x0c\xb1\x07\xb0\xf5\x02\0\0", 0x0, 0, 0 },
++ { NULL, NULL, 0, 0, 0, NULL, 0x0, 0, 0 }
 +};
 +
++static int null_uuid(const char *uuid)
++{
++      int i;
++
++      for (i = 0; i < 16 && !uuid[i]; i++);
++
++      return (i == 16);
++}
++
++
 +static void uuid_end_bio(struct bio *bio, int err)
 +{
 +      struct page *page = bio->bi_io_vec[0].bv_page;
@@ -1785,54 +1865,115 @@
 +
 +/**
 + * submit - submit BIO request
-+ * @writing: READ or WRITE.
 + * @dev: The block device we're using.
-+ * @first_block: The first sector we're using.
-+ * @page: The page being used for I/O.
-+ * @free_group: If writing, the group that was used in allocating the page
-+ *    and which will be used in freeing the page from the completion
-+ *    routine.
++ * @page_num: The page we're reading.
 + *
 + * Based on Patrick Mochell's pmdisk code from long ago: "Straight from the
 + * textbook - allocate and initialize the bio. If we're writing, make sure
 + * the page is marked as dirty. Then submit it and carry on."
-+ *
-+ * If we're just testing the speed of our own code, we fake having done all
-+ * the hard work and all toi_end_bio immediately.
 + **/
-+static struct page *read_bdev_sector(struct block_device *dev,
-+              sector_t first_block)
++static struct page *read_bdev_page(struct block_device *dev, int page_num)
 +{
 +      struct bio *bio = NULL;
-+      struct page *page = alloc_page(GFP_KERNEL);
++      struct page *page = alloc_page(GFP_NOFS);
 +
-+      if (!page)
++      if (!page) {
++              printk(KERN_ERR "Failed to allocate a page for reading data "
++                              "in UUID checks.");
 +              return NULL;
++      }
 +
-+      lock_page(page);
-+
-+      bio = bio_alloc(GFP_KERNEL, 1);
++      bio = bio_alloc(GFP_NOFS, 1);
 +      bio->bi_bdev = dev;
-+      bio->bi_sector = first_block;
++      bio->bi_sector = page_num << 3;
 +      bio->bi_end_io = uuid_end_bio;
 +
++      PRINTK("Submitting bio on device %lx, page %d.\n",
++                      (unsigned long) dev->bd_dev, page_num);
++
 +      if (bio_add_page(bio, page, PAGE_SIZE, 0) < PAGE_SIZE) {
-+              printk(KERN_DEBUG "ERROR: adding page to bio at %lld\n",
-+                              (unsigned long long) first_block);
++              printk(KERN_DEBUG "ERROR: adding page to bio at %d\n",
++                              page_num);
 +              bio_put(bio);
 +              __free_page(page);
-+              printk(KERN_DEBUG "read_bdev_sector freed page %p (in error "
++              printk(KERN_DEBUG "read_bdev_page freed page %p (in error "
 +                              "path).\n", page);
 +              return ERR_PTR(-EFAULT);
 +      }
 +
++      lock_page(page);
 +      submit_bio(READ | (1 << BIO_RW_SYNCIO) |
 +                      (1 << BIO_RW_UNPLUG), bio);
 +
-+      wait_on_page_bit(page, PG_locked);
++      wait_on_page_locked(page);
 +      return page;
 +}
 +
++int bdev_matches_key(struct block_device *bdev, const char *key)
++{
++      unsigned char *data = NULL;
++      struct page *data_page = NULL;
++
++      int dev_offset, pg_num, pg_off, i;
++      int last_pg_num = -1;
++      int result = 0;
++      char buf[50];
++
++      if (null_uuid(key)) {
++              PRINTK("Refusing to find a NULL key.\n");
++              return 0;
++      }
++
++      if (!bdev->bd_disk) {
++              bdevname(bdev, buf);
++              PRINTK("bdev %s has no bd_disk.\n", buf);
++              return 0;
++      }
++
++      if (!bdev->bd_disk->queue) {
++              bdevname(bdev, buf);
++              PRINTK("bdev %s has no queue.\n", buf);
++              return 0;
++      }
++
++      for (i = 0; uuid_list[i].name; i++) {
++              struct uuid_info *dat = &uuid_list[i];
++
++              if (!dat->key || strcmp(dat->key, key))
++                      continue;
++
++              dev_offset = (dat->bkoff << 10) + dat->sboff;
++              pg_num = dev_offset >> 12;
++              pg_off = dev_offset & 0xfff;
++
++              if ((((pg_num + 1) << 3) - 1) > bdev->bd_part->nr_sects >> 1)
++                      continue;
++
++              if (pg_num != last_pg_num) {
++                      if (data_page)
++                              __free_page(data_page);
++                      data_page = read_bdev_page(bdev, pg_num);
++                      if (!data_page) {
++                              result = -ENOMEM;
++                              break;
++                      }
++                      data = page_address(data_page);
++              }
++
++              last_pg_num = pg_num;
++
++              if (strncmp(&data[pg_off], dat->magic, dat->sig_len))
++                      continue;
++
++              result = 1;
++              break;
++      }
++
++      if (data_page)
++              __free_page(data_page);
++
++      return result;
++}
 +
 +int part_matches_uuid(struct hd_struct *part, const char *uuid)
 +{
@@ -1845,10 +1986,15 @@
 +      unsigned char *uuid_data = NULL;
 +      struct page *uuid_data_page = NULL;
 +
-+      int last_pg_num = 0, last_uuid_pg_num = 0;
++      int last_pg_num = -1, last_uuid_pg_num = 0;
 +      int result = 0;
 +      char buf[50];
 +
++      if (null_uuid(uuid)) {
++              PRINTK("Refusing to find a NULL uuid.\n");
++              return 0;
++      }
<<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.9&r2=1.10&f=u
    
http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/kernel/kernel-vserver-2.3.patch?r1=1.33&r2=1.34&f=u
    
http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/kernel/kernel-vserver-fixes.patch?r1=1.12&r2=1.13&f=u
    
http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/kernel/kernel.spec?r1=1.760&r2=1.761&f=u

_______________________________________________
pld-cvs-commit mailing list
[email protected]
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit

Reply via email to