projects
/
openwrt.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[generic-2.6] remove a bogus byteswap in the hifn_795x driver, should fix support...
[openwrt.git]
/
target
/
linux
/
generic-2.6
/
patches-2.6.30
/
065-rootfs_split.patch
diff --git
a/target/linux/generic-2.6/patches-2.6.30/065-rootfs_split.patch
b/target/linux/generic-2.6/patches-2.6.30/065-rootfs_split.patch
index
0eca899
..
34c1f5a
100644
(file)
--- a/
target/linux/generic-2.6/patches-2.6.30/065-rootfs_split.patch
+++ b/
target/linux/generic-2.6/patches-2.6.30/065-rootfs_split.patch
@@
-37,7
+37,7
@@
/*
* MTD methods which simply translate the effective address and pass through
/*
* MTD methods which simply translate the effective address and pass through
-@@ -512,6 +514,15
6
@@ out_register:
+@@ -512,6 +514,15
5
@@ out_register:
return slave;
}
return slave;
}
@@
-54,32
+54,31
@@
+
+static int split_squashfs(struct mtd_info *master, int offset, int *split_offset)
+{
+
+static int split_squashfs(struct mtd_info *master, int offset, int *split_offset)
+{
-+ char buf[512];
-+ struct squashfs_super_block *sb = (struct squashfs_super_block *) buf;
++ struct squashfs_super_block sb;
+ int len, ret;
+
+ int len, ret;
+
-+ ret = master->read(master, offset, sizeof(
*sb), &len, buf
);
-+ if (ret || (len != sizeof(
*
sb))) {
++ ret = master->read(master, offset, sizeof(
sb), &len, (void *) &sb
);
++ if (ret || (len != sizeof(sb))) {
+ printk(KERN_ALERT "split_squashfs: error occured while reading "
+ "from \"%s\"\n", master->name);
+ return -EINVAL;
+ }
+
+ printk(KERN_ALERT "split_squashfs: error occured while reading "
+ "from \"%s\"\n", master->name);
+ return -EINVAL;
+ }
+
-+ if (
*((u32 *) buf) != SQUASHFS_MAGIC
) {
++ if (
SQUASHFS_MAGIC != le32_to_cpu(sb.s_magic)
) {
+ printk(KERN_ALERT "split_squashfs: no squashfs found in \"%s\"\n",
+ master->name);
+ *split_offset = 0;
+ return 0;
+ }
+
+ printk(KERN_ALERT "split_squashfs: no squashfs found in \"%s\"\n",
+ master->name);
+ *split_offset = 0;
+ return 0;
+ }
+
-+ if (
sb->bytes_used
<= 0) {
++ if (
le64_to_cpu((sb.bytes_used))
<= 0) {
+ printk(KERN_ALERT "split_squashfs: squashfs is empty in \"%s\"\n",
+ master->name);
+ *split_offset = 0;
+ return 0;
+ }
+
+ printk(KERN_ALERT "split_squashfs: squashfs is empty in \"%s\"\n",
+ master->name);
+ *split_offset = 0;
+ return 0;
+ }
+
-+ len = (u32)
sb->bytes_used
;
++ len = (u32)
le64_to_cpu(sb.bytes_used)
;
+ len += (offset & 0x000fffff);
+ len += (master->erasesize - 1);
+ len &= ~(master->erasesize - 1);
+ len += (offset & 0x000fffff);
+ len += (master->erasesize - 1);
+ len &= ~(master->erasesize - 1);
@@
-194,7
+193,7
@@
/*
* This function, given a master MTD object and a partition table, creates
* and registers slave MTD objects which are bound to the master according to
/*
* This function, given a master MTD object and a partition table, creates
* and registers slave MTD objects which are bound to the master according to
-@@ -527,14 +67
9
,29 @@ int add_mtd_partitions(struct mtd_info *
+@@ -527,14 +67
8
,29 @@ int add_mtd_partitions(struct mtd_info *
{
struct mtd_part *slave;
uint64_t cur_offset = 0;
{
struct mtd_part *slave;
uint64_t cur_offset = 0;
@@
-227,7
+226,7
@@
cur_offset = slave->offset + slave->mtd.size;
}
cur_offset = slave->offset + slave->mtd.size;
}
-@@ -542,6 +70
9
,32 @@ int add_mtd_partitions(struct mtd_info *
+@@ -542,6 +70
8
,32 @@ int add_mtd_partitions(struct mtd_info *
}
EXPORT_SYMBOL(add_mtd_partitions);
}
EXPORT_SYMBOL(add_mtd_partitions);
@@
-442,7
+441,7
@@
if (devt) {
bdev = open_by_devnum(devt, FMODE_WRITE | FMODE_READ);
}
if (devt) {
bdev = open_by_devnum(devt, FMODE_WRITE | FMODE_READ);
}
-@@ -263,17 +276,9
7
@@ static struct block2mtd_dev *add_device(
+@@ -263,17 +276,9
8
@@ static struct block2mtd_dev *add_device(
#endif
if (IS_ERR(bdev)) {
#endif
if (IS_ERR(bdev)) {
@@
-506,9
+505,10
@@
+ bdev = open_by_devnum(devt, FMODE_WRITE | FMODE_READ);
+ if (!bdev || !bdev->bd_disk)
+ err = -EINVAL;
+ bdev = open_by_devnum(devt, FMODE_WRITE | FMODE_READ);
+ if (!bdev || !bdev->bd_disk)
+ err = -EINVAL;
-+ else {
++#ifndef CONFIG_MTD_BLOCK2MTD_MODULE
++ else
+ err = rescan_partitions(bdev->bd_disk, bdev);
+ err = rescan_partitions(bdev->bd_disk, bdev);
-+
}
++
#endif
+ if (bdev)
+ close_bdev_exclusive(bdev, FMODE_READ|FMODE_WRITE);
+
+ if (bdev)
+ close_bdev_exclusive(bdev, FMODE_READ|FMODE_WRITE);
+
@@
-543,7
+543,7
@@
if (!mtdname)
mtdname = devname;
if (!mtdname)
mtdname = devname;
-@@ -297,6 +39
0
,7 @@ static struct block2mtd_dev *add_device(
+@@ -297,6 +39
1
,7 @@ static struct block2mtd_dev *add_device(
dev->mtd.read = block2mtd_read;
dev->mtd.priv = dev;
dev->mtd.owner = THIS_MODULE;
dev->mtd.read = block2mtd_read;
dev->mtd.priv = dev;
dev->mtd.owner = THIS_MODULE;
This page took
0.031049 seconds
and
4
git commands to generate.