mirror of
https://github.com/openwrt/openwrt.git
synced 2024-12-24 07:46:48 +00:00
kernel: reorganize 2.6.37 patches
SVN-Revision: 26692
This commit is contained in:
parent
3fa43f54a2
commit
a1624421ae
@ -197,7 +197,7 @@
|
||||
/* TODO - get remaining rev 8 stuff needed */
|
||||
}
|
||||
|
||||
@@ -573,37 +621,34 @@ static int sprom_extract(struct ssb_bus
|
||||
@@ -573,37 +621,34 @@ static int sprom_extract(struct ssb_bus
|
||||
ssb_dprintk(KERN_DEBUG PFX "SPROM revision %d detected.\n", out->revision);
|
||||
memset(out->et0mac, 0xFF, 6); /* preset et0 and et1 mac */
|
||||
memset(out->et1mac, 0xFF, 6);
|
@ -176,7 +176,7 @@
|
||||
|
||||
unsigned int vced_count, vcei_count;
|
||||
|
||||
@@ -31,8 +32,12 @@ static int show_cpuinfo(struct seq_file
|
||||
@@ -31,8 +32,12 @@ static int show_cpuinfo(struct seq_file
|
||||
/*
|
||||
* For the first processor also print the system type
|
||||
*/
|
@ -19,8 +19,6 @@ Date: Wed Mar 30 12:59:26 2011 +0000
|
||||
drivers/atm/solos-pci.c | 9 ++++++++-
|
||||
1 files changed, 8 insertions(+), 1 deletions(-)
|
||||
|
||||
diff --git a/drivers/atm/solos-pci.c b/drivers/atm/solos-pci.c
|
||||
index 2c4146a..968f022 100644
|
||||
--- a/drivers/atm/solos-pci.c
|
||||
+++ b/drivers/atm/solos-pci.c
|
||||
@@ -697,7 +697,7 @@ void solos_bh(unsigned long card_arg)
|
||||
@ -32,7 +30,7 @@ index 2c4146a..968f022 100644
|
||||
dev_info(&card->dev->dev, "size: %d VPI: %d VCI: %d\n",
|
||||
size, le16_to_cpu(header->vpi),
|
||||
le16_to_cpu(header->vci));
|
||||
@@ -1018,8 +1018,15 @@ static uint32_t fpga_tx(struct solos_card *card)
|
||||
@@ -1018,8 +1018,15 @@ static uint32_t fpga_tx(struct solos_car
|
||||
|
||||
/* Clean up and free oldskb now it's gone */
|
||||
if (atmdebug) {
|
||||
@ -48,4 +46,3 @@ index 2c4146a..968f022 100644
|
||||
print_buffer(oldskb);
|
||||
}
|
||||
|
||||
|
@ -22,11 +22,9 @@ Date: Wed Mar 30 13:17:04 2011 +0000
|
||||
net/atm/common.c | 1 +
|
||||
3 files changed, 3 insertions(+), 25 deletions(-)
|
||||
|
||||
diff --git a/drivers/atm/solos-pci.c b/drivers/atm/solos-pci.c
|
||||
index 968f022..cd0ff66 100644
|
||||
--- a/drivers/atm/solos-pci.c
|
||||
+++ b/drivers/atm/solos-pci.c
|
||||
@@ -165,7 +165,6 @@ static uint32_t fpga_tx(struct solos_card *);
|
||||
@@ -165,7 +165,6 @@ static uint32_t fpga_tx(struct solos_car
|
||||
static irqreturn_t solos_irq(int irq, void *dev_id);
|
||||
static struct atm_vcc* find_vcc(struct atm_dev *dev, short vpi, int vci);
|
||||
static int list_vccs(int vci);
|
||||
@ -34,7 +32,7 @@ index 968f022..cd0ff66 100644
|
||||
static int atm_init(struct solos_card *, struct device *);
|
||||
static void atm_remove(struct solos_card *);
|
||||
static int send_command(struct solos_card *card, int dev, const char *buf, size_t size);
|
||||
@@ -384,7 +383,6 @@ static int process_status(struct solos_card *card, int port, struct sk_buff *skb
|
||||
@@ -384,7 +383,6 @@ static int process_status(struct solos_c
|
||||
/* Anything but 'Showtime' is down */
|
||||
if (strcmp(state_str, "Showtime")) {
|
||||
atm_dev_signal_change(card->atmdev[port], ATM_PHY_SIG_LOST);
|
||||
@ -71,7 +69,7 @@ index 968f022..cd0ff66 100644
|
||||
|
||||
static int popen(struct atm_vcc *vcc)
|
||||
{
|
||||
@@ -1269,7 +1245,7 @@ static int atm_init(struct solos_card *card, struct device *parent)
|
||||
@@ -1269,7 +1245,7 @@ static int atm_init(struct solos_card *c
|
||||
card->atmdev[i]->ci_range.vci_bits = 16;
|
||||
card->atmdev[i]->dev_data = card;
|
||||
card->atmdev[i]->phy_data = (void *)(unsigned long)i;
|
||||
@ -80,11 +78,9 @@ index 968f022..cd0ff66 100644
|
||||
|
||||
skb = alloc_skb(sizeof(*header), GFP_ATOMIC);
|
||||
if (!skb) {
|
||||
diff --git a/include/linux/atmdev.h b/include/linux/atmdev.h
|
||||
index 475f8c4..381f4ce 100644
|
||||
--- a/include/linux/atmdev.h
|
||||
+++ b/include/linux/atmdev.h
|
||||
@@ -443,6 +443,7 @@ void atm_dev_signal_change(struct atm_dev *dev, char signal);
|
||||
@@ -443,6 +443,7 @@ void atm_dev_signal_change(struct atm_de
|
||||
|
||||
void vcc_insert_socket(struct sock *sk);
|
||||
|
||||
@ -92,11 +88,9 @@ index 475f8c4..381f4ce 100644
|
||||
|
||||
/*
|
||||
* This is approximately the algorithm used by alloc_skb.
|
||||
diff --git a/net/atm/common.c b/net/atm/common.c
|
||||
index 1b9c52a..22b963d 100644
|
||||
--- a/net/atm/common.c
|
||||
+++ b/net/atm/common.c
|
||||
@@ -252,6 +252,7 @@ void atm_dev_release_vccs(struct atm_dev *dev)
|
||||
@@ -252,6 +252,7 @@ void atm_dev_release_vccs(struct atm_dev
|
||||
}
|
||||
write_unlock_irq(&vcc_sklist_lock);
|
||||
}
|
||||
@ -104,4 +98,3 @@ index 1b9c52a..22b963d 100644
|
||||
|
||||
static int adjust_tp(struct atm_trafprm *tp, unsigned char aal)
|
||||
{
|
||||
|
@ -1,6 +1,6 @@
|
||||
--- a/scripts/Makefile.lib
|
||||
+++ b/scripts/Makefile.lib
|
||||
@@ -231,7 +231,7 @@ cmd_bzip2 = (cat $(filter-out FORCE,$^)
|
||||
@@ -231,7 +231,7 @@ cmd_bzip2 = (cat $(filter-out FORCE,$^)
|
||||
|
||||
quiet_cmd_lzma = LZMA $@
|
||||
cmd_lzma = (cat $(filter-out FORCE,$^) | \
|
@ -1,6 +1,6 @@
|
||||
--- a/lib/Kconfig
|
||||
+++ b/lib/Kconfig
|
||||
@@ -161,16 +161,16 @@ config REED_SOLOMON_DEC16
|
||||
@@ -152,16 +152,16 @@ config REED_SOLOMON_DEC16
|
||||
# Textsearch support is select'ed if needed
|
||||
#
|
||||
config TEXTSEARCH
|
@ -13,7 +13,7 @@
|
||||
|
||||
--- a/arch/mips/kernel/head.S
|
||||
+++ b/arch/mips/kernel/head.S
|
||||
@@ -143,6 +143,12 @@ FEXPORT(__kernel_entry)
|
||||
@@ -141,6 +141,12 @@ FEXPORT(__kernel_entry)
|
||||
j kernel_entry
|
||||
#endif
|
||||
|
@ -1,6 +1,6 @@
|
||||
--- a/arch/mips/include/asm/string.h
|
||||
+++ b/arch/mips/include/asm/string.h
|
||||
@@ -133,11 +133,44 @@ strncmp(__const__ char *__cs, __const__
|
||||
@@ -133,11 +133,44 @@ strncmp(__const__ char *__cs, __const__
|
||||
|
||||
#define __HAVE_ARCH_MEMSET
|
||||
extern void *memset(void *__s, int __c, size_t __count);
|
@ -63,7 +63,7 @@
|
||||
htc_excalibur_s620 MACH_HTC_EXCALIBUR_S620 HTC_EXCALIBUR_S620 2391
|
||||
htc_opal MACH_HTC_OPAL HTC_OPAL 2392
|
||||
touchbook MACH_TOUCHBOOK TOUCHBOOK 2393
|
||||
@@ -2446,7 +2446,7 @@ siogentoo1 MACH_SIOGENTOO1 SIOGENTOO1
|
||||
@@ -2446,7 +2446,7 @@ siogentoo1 MACH_SIOGENTOO1 SIOGENTOO1
|
||||
siogentoo2 MACH_SIOGENTOO2 SIOGENTOO2 2459
|
||||
sm3k MACH_SM3K SM3K 2460
|
||||
acer_tempo_f900 MACH_ACER_TEMPO_F900 ACER_TEMPO_F900 2461
|
@ -255,301 +255,9 @@
|
||||
static DEFINE_SPINLOCK(part_parser_lock);
|
||||
static LIST_HEAD(part_parsers);
|
||||
|
||||
--- a/drivers/mtd/devices/block2mtd.c
|
||||
+++ b/drivers/mtd/devices/block2mtd.c
|
||||
@@ -30,6 +30,8 @@ struct block2mtd_dev {
|
||||
struct block_device *blkdev;
|
||||
struct mtd_info mtd;
|
||||
struct mutex write_mutex;
|
||||
+ rwlock_t bdev_mutex;
|
||||
+ char devname[0];
|
||||
};
|
||||
|
||||
|
||||
@@ -82,6 +84,12 @@ static int block2mtd_erase(struct mtd_in
|
||||
size_t len = instr->len;
|
||||
int err;
|
||||
|
||||
+ read_lock(&dev->bdev_mutex);
|
||||
+ if (!dev->blkdev) {
|
||||
+ err = -EINVAL;
|
||||
+ goto done;
|
||||
+ }
|
||||
+
|
||||
instr->state = MTD_ERASING;
|
||||
mutex_lock(&dev->write_mutex);
|
||||
err = _block2mtd_erase(dev, from, len);
|
||||
@@ -93,6 +101,10 @@ static int block2mtd_erase(struct mtd_in
|
||||
instr->state = MTD_ERASE_DONE;
|
||||
|
||||
mtd_erase_callback(instr);
|
||||
+
|
||||
+done:
|
||||
+ read_unlock(&dev->bdev_mutex);
|
||||
+
|
||||
return err;
|
||||
}
|
||||
|
||||
@@ -104,10 +116,14 @@ static int block2mtd_read(struct mtd_inf
|
||||
struct page *page;
|
||||
int index = from >> PAGE_SHIFT;
|
||||
int offset = from & (PAGE_SIZE-1);
|
||||
- int cpylen;
|
||||
+ int cpylen, err = 0;
|
||||
+
|
||||
+ read_lock(&dev->bdev_mutex);
|
||||
+ if (!dev->blkdev || (from > mtd->size)) {
|
||||
+ err = -EINVAL;
|
||||
+ goto done;
|
||||
+ }
|
||||
|
||||
- if (from > mtd->size)
|
||||
- return -EINVAL;
|
||||
if (from + len > mtd->size)
|
||||
len = mtd->size - from;
|
||||
|
||||
@@ -122,10 +138,14 @@ static int block2mtd_read(struct mtd_inf
|
||||
len = len - cpylen;
|
||||
|
||||
page = page_read(dev->blkdev->bd_inode->i_mapping, index);
|
||||
- if (!page)
|
||||
- return -ENOMEM;
|
||||
- if (IS_ERR(page))
|
||||
- return PTR_ERR(page);
|
||||
+ if (!page) {
|
||||
+ err = -ENOMEM;
|
||||
+ goto done;
|
||||
+ }
|
||||
+ if (IS_ERR(page)) {
|
||||
+ err = PTR_ERR(page);
|
||||
+ goto done;
|
||||
+ }
|
||||
|
||||
memcpy(buf, page_address(page) + offset, cpylen);
|
||||
page_cache_release(page);
|
||||
@@ -136,7 +156,10 @@ static int block2mtd_read(struct mtd_inf
|
||||
offset = 0;
|
||||
index++;
|
||||
}
|
||||
- return 0;
|
||||
+
|
||||
+done:
|
||||
+ read_unlock(&dev->bdev_mutex);
|
||||
+ return err;
|
||||
}
|
||||
|
||||
|
||||
@@ -188,12 +211,22 @@ static int block2mtd_write(struct mtd_in
|
||||
size_t *retlen, const u_char *buf)
|
||||
{
|
||||
struct block2mtd_dev *dev = mtd->priv;
|
||||
- int err;
|
||||
+ int err = 0;
|
||||
+
|
||||
+ read_lock(&dev->bdev_mutex);
|
||||
+ if (!dev->blkdev) {
|
||||
+ err = -EINVAL;
|
||||
+ goto done;
|
||||
+ }
|
||||
|
||||
if (!len)
|
||||
- return 0;
|
||||
- if (to >= mtd->size)
|
||||
- return -ENOSPC;
|
||||
+ goto done;
|
||||
+
|
||||
+ if (to >= mtd->size) {
|
||||
+ err = -ENOSPC;
|
||||
+ goto done;
|
||||
+ }
|
||||
+
|
||||
if (to + len > mtd->size)
|
||||
len = mtd->size - to;
|
||||
|
||||
@@ -202,6 +235,9 @@ static int block2mtd_write(struct mtd_in
|
||||
mutex_unlock(&dev->write_mutex);
|
||||
if (err > 0)
|
||||
err = 0;
|
||||
+
|
||||
+done:
|
||||
+ read_unlock(&dev->bdev_mutex);
|
||||
return err;
|
||||
}
|
||||
|
||||
@@ -210,52 +246,29 @@ static int block2mtd_write(struct mtd_in
|
||||
static void block2mtd_sync(struct mtd_info *mtd)
|
||||
{
|
||||
struct block2mtd_dev *dev = mtd->priv;
|
||||
- sync_blockdev(dev->blkdev);
|
||||
- return;
|
||||
-}
|
||||
-
|
||||
-
|
||||
-static void block2mtd_free_device(struct block2mtd_dev *dev)
|
||||
-{
|
||||
- if (!dev)
|
||||
- return;
|
||||
-
|
||||
- kfree(dev->mtd.name);
|
||||
|
||||
- if (dev->blkdev) {
|
||||
- invalidate_mapping_pages(dev->blkdev->bd_inode->i_mapping,
|
||||
- 0, -1);
|
||||
- close_bdev_exclusive(dev->blkdev, FMODE_READ|FMODE_WRITE);
|
||||
- }
|
||||
+ read_lock(&dev->bdev_mutex);
|
||||
+ if (dev->blkdev)
|
||||
+ sync_blockdev(dev->blkdev);
|
||||
+ read_unlock(&dev->bdev_mutex);
|
||||
|
||||
- kfree(dev);
|
||||
+ return;
|
||||
}
|
||||
|
||||
|
||||
-/* FIXME: ensure that mtd->size % erase_size == 0 */
|
||||
-static struct block2mtd_dev *add_device(char *devname, int erase_size, const char *mtdname)
|
||||
+static int _open_bdev(struct block2mtd_dev *dev)
|
||||
{
|
||||
struct block_device *bdev;
|
||||
- struct block2mtd_dev *dev;
|
||||
- struct mtd_partition *part;
|
||||
- char *name;
|
||||
-
|
||||
- if (!devname)
|
||||
- return NULL;
|
||||
-
|
||||
- dev = kzalloc(sizeof(struct block2mtd_dev), GFP_KERNEL);
|
||||
- if (!dev)
|
||||
- return NULL;
|
||||
|
||||
/* Get a handle on the device */
|
||||
- bdev = open_bdev_exclusive(devname, FMODE_READ|FMODE_WRITE, NULL);
|
||||
+ bdev = open_bdev_exclusive(dev->devname, FMODE_READ|FMODE_WRITE, NULL);
|
||||
#ifndef MODULE
|
||||
if (IS_ERR(bdev)) {
|
||||
|
||||
/* We might not have rootfs mounted at this point. Try
|
||||
to resolve the device name by other means. */
|
||||
|
||||
- dev_t devt = name_to_dev_t(devname);
|
||||
+ dev_t devt = name_to_dev_t(dev->devname);
|
||||
if (devt) {
|
||||
bdev = open_by_devnum(devt, FMODE_WRITE | FMODE_READ);
|
||||
}
|
||||
@@ -263,17 +276,98 @@ static struct block2mtd_dev *add_device(
|
||||
#endif
|
||||
|
||||
if (IS_ERR(bdev)) {
|
||||
- ERROR("error: cannot open device %s", devname);
|
||||
- goto devinit_err;
|
||||
+ ERROR("error: cannot open device %s", dev->devname);
|
||||
+ return 1;
|
||||
}
|
||||
dev->blkdev = bdev;
|
||||
|
||||
if (MAJOR(bdev->bd_dev) == MTD_BLOCK_MAJOR) {
|
||||
ERROR("attempting to use an MTD device as a block device");
|
||||
- goto devinit_err;
|
||||
+ return 1;
|
||||
}
|
||||
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static void _close_bdev(struct block2mtd_dev *dev)
|
||||
+{
|
||||
+ struct block_device *bdev;
|
||||
+
|
||||
+ if (!dev->blkdev)
|
||||
+ return;
|
||||
+
|
||||
+ bdev = dev->blkdev;
|
||||
+ invalidate_mapping_pages(dev->blkdev->bd_inode->i_mapping, 0, -1);
|
||||
+ close_bdev_exclusive(dev->blkdev, FMODE_READ|FMODE_WRITE);
|
||||
+ dev->blkdev = NULL;
|
||||
+}
|
||||
+
|
||||
+static void block2mtd_free_device(struct block2mtd_dev *dev)
|
||||
+{
|
||||
+ if (!dev)
|
||||
+ return;
|
||||
+
|
||||
+ kfree(dev->mtd.name);
|
||||
+ _close_bdev(dev);
|
||||
+ kfree(dev);
|
||||
+}
|
||||
+
|
||||
+
|
||||
+static int block2mtd_refresh(struct mtd_info *mtd)
|
||||
+{
|
||||
+ struct block2mtd_dev *dev = mtd->priv;
|
||||
+ struct block_device *bdev;
|
||||
+ dev_t devt;
|
||||
+ int err = 0;
|
||||
+
|
||||
+ /* no other mtd function can run at this point */
|
||||
+ write_lock(&dev->bdev_mutex);
|
||||
+
|
||||
+ /* get the device number for the whole disk */
|
||||
+ devt = MKDEV(MAJOR(dev->blkdev->bd_dev), 0);
|
||||
+
|
||||
+ /* close the old block device */
|
||||
+ _close_bdev(dev);
|
||||
+
|
||||
+ /* open the whole disk, issue a partition rescan, then */
|
||||
+ bdev = open_by_devnum(devt, FMODE_WRITE | FMODE_READ);
|
||||
+ if (!bdev || !bdev->bd_disk)
|
||||
+ err = -EINVAL;
|
||||
+#ifndef CONFIG_MTD_BLOCK2MTD_MODULE
|
||||
+ else
|
||||
+ err = rescan_partitions(bdev->bd_disk, bdev);
|
||||
+#endif
|
||||
+ if (bdev)
|
||||
+ close_bdev_exclusive(bdev, FMODE_READ|FMODE_WRITE);
|
||||
+
|
||||
+ /* try to open the partition block device again */
|
||||
+ _open_bdev(dev);
|
||||
+ write_unlock(&dev->bdev_mutex);
|
||||
+
|
||||
+ return err;
|
||||
+}
|
||||
+
|
||||
+/* FIXME: ensure that mtd->size % erase_size == 0 */
|
||||
+static struct block2mtd_dev *add_device(char *devname, int erase_size, char *mtdname)
|
||||
+{
|
||||
+ struct block2mtd_dev *dev;
|
||||
+ struct mtd_partition *part;
|
||||
+ char *name;
|
||||
+
|
||||
+ if (!devname)
|
||||
+ return NULL;
|
||||
+
|
||||
+ dev = kzalloc(sizeof(struct block2mtd_dev) + strlen(devname) + 1, GFP_KERNEL);
|
||||
+ if (!dev)
|
||||
+ return NULL;
|
||||
+
|
||||
+ strcpy(dev->devname, devname);
|
||||
+
|
||||
+ if (_open_bdev(dev))
|
||||
+ goto devinit_err;
|
||||
+
|
||||
mutex_init(&dev->write_mutex);
|
||||
+ rwlock_init(&dev->bdev_mutex);
|
||||
|
||||
/* Setup the MTD structure */
|
||||
/* make the name contain the block device in */
|
||||
@@ -298,6 +392,7 @@ static struct block2mtd_dev *add_device(
|
||||
dev->mtd.read = block2mtd_read;
|
||||
dev->mtd.priv = dev;
|
||||
dev->mtd.owner = THIS_MODULE;
|
||||
+ dev->mtd.refresh_device = block2mtd_refresh;
|
||||
|
||||
part = kzalloc(sizeof(struct mtd_partition), GFP_KERNEL);
|
||||
part->name = dev->mtd.name;
|
||||
--- a/drivers/mtd/mtdchar.c
|
||||
+++ b/drivers/mtd/mtdchar.c
|
||||
@@ -841,6 +841,13 @@ static int mtd_ioctl(struct file *file,
|
||||
@@ -841,6 +841,13 @@ static int mtd_ioctl(struct file *file,
|
||||
file->f_pos = 0;
|
||||
break;
|
||||
}
|
292
target/linux/generic/patches-2.6.37/441-block2mtd_refresh.patch
Normal file
292
target/linux/generic/patches-2.6.37/441-block2mtd_refresh.patch
Normal file
@ -0,0 +1,292 @@
|
||||
--- a/drivers/mtd/devices/block2mtd.c
|
||||
+++ b/drivers/mtd/devices/block2mtd.c
|
||||
@@ -30,6 +30,8 @@ struct block2mtd_dev {
|
||||
struct block_device *blkdev;
|
||||
struct mtd_info mtd;
|
||||
struct mutex write_mutex;
|
||||
+ rwlock_t bdev_mutex;
|
||||
+ char devname[0];
|
||||
};
|
||||
|
||||
|
||||
@@ -82,6 +84,12 @@ static int block2mtd_erase(struct mtd_in
|
||||
size_t len = instr->len;
|
||||
int err;
|
||||
|
||||
+ read_lock(&dev->bdev_mutex);
|
||||
+ if (!dev->blkdev) {
|
||||
+ err = -EINVAL;
|
||||
+ goto done;
|
||||
+ }
|
||||
+
|
||||
instr->state = MTD_ERASING;
|
||||
mutex_lock(&dev->write_mutex);
|
||||
err = _block2mtd_erase(dev, from, len);
|
||||
@@ -93,6 +101,10 @@ static int block2mtd_erase(struct mtd_in
|
||||
instr->state = MTD_ERASE_DONE;
|
||||
|
||||
mtd_erase_callback(instr);
|
||||
+
|
||||
+done:
|
||||
+ read_unlock(&dev->bdev_mutex);
|
||||
+
|
||||
return err;
|
||||
}
|
||||
|
||||
@@ -104,10 +116,14 @@ static int block2mtd_read(struct mtd_inf
|
||||
struct page *page;
|
||||
int index = from >> PAGE_SHIFT;
|
||||
int offset = from & (PAGE_SIZE-1);
|
||||
- int cpylen;
|
||||
+ int cpylen, err = 0;
|
||||
+
|
||||
+ read_lock(&dev->bdev_mutex);
|
||||
+ if (!dev->blkdev || (from > mtd->size)) {
|
||||
+ err = -EINVAL;
|
||||
+ goto done;
|
||||
+ }
|
||||
|
||||
- if (from > mtd->size)
|
||||
- return -EINVAL;
|
||||
if (from + len > mtd->size)
|
||||
len = mtd->size - from;
|
||||
|
||||
@@ -122,10 +138,14 @@ static int block2mtd_read(struct mtd_inf
|
||||
len = len - cpylen;
|
||||
|
||||
page = page_read(dev->blkdev->bd_inode->i_mapping, index);
|
||||
- if (!page)
|
||||
- return -ENOMEM;
|
||||
- if (IS_ERR(page))
|
||||
- return PTR_ERR(page);
|
||||
+ if (!page) {
|
||||
+ err = -ENOMEM;
|
||||
+ goto done;
|
||||
+ }
|
||||
+ if (IS_ERR(page)) {
|
||||
+ err = PTR_ERR(page);
|
||||
+ goto done;
|
||||
+ }
|
||||
|
||||
memcpy(buf, page_address(page) + offset, cpylen);
|
||||
page_cache_release(page);
|
||||
@@ -136,7 +156,10 @@ static int block2mtd_read(struct mtd_inf
|
||||
offset = 0;
|
||||
index++;
|
||||
}
|
||||
- return 0;
|
||||
+
|
||||
+done:
|
||||
+ read_unlock(&dev->bdev_mutex);
|
||||
+ return err;
|
||||
}
|
||||
|
||||
|
||||
@@ -188,12 +211,22 @@ static int block2mtd_write(struct mtd_in
|
||||
size_t *retlen, const u_char *buf)
|
||||
{
|
||||
struct block2mtd_dev *dev = mtd->priv;
|
||||
- int err;
|
||||
+ int err = 0;
|
||||
+
|
||||
+ read_lock(&dev->bdev_mutex);
|
||||
+ if (!dev->blkdev) {
|
||||
+ err = -EINVAL;
|
||||
+ goto done;
|
||||
+ }
|
||||
|
||||
if (!len)
|
||||
- return 0;
|
||||
- if (to >= mtd->size)
|
||||
- return -ENOSPC;
|
||||
+ goto done;
|
||||
+
|
||||
+ if (to >= mtd->size) {
|
||||
+ err = -ENOSPC;
|
||||
+ goto done;
|
||||
+ }
|
||||
+
|
||||
if (to + len > mtd->size)
|
||||
len = mtd->size - to;
|
||||
|
||||
@@ -202,6 +235,9 @@ static int block2mtd_write(struct mtd_in
|
||||
mutex_unlock(&dev->write_mutex);
|
||||
if (err > 0)
|
||||
err = 0;
|
||||
+
|
||||
+done:
|
||||
+ read_unlock(&dev->bdev_mutex);
|
||||
return err;
|
||||
}
|
||||
|
||||
@@ -210,52 +246,29 @@ static int block2mtd_write(struct mtd_in
|
||||
static void block2mtd_sync(struct mtd_info *mtd)
|
||||
{
|
||||
struct block2mtd_dev *dev = mtd->priv;
|
||||
- sync_blockdev(dev->blkdev);
|
||||
- return;
|
||||
-}
|
||||
-
|
||||
-
|
||||
-static void block2mtd_free_device(struct block2mtd_dev *dev)
|
||||
-{
|
||||
- if (!dev)
|
||||
- return;
|
||||
-
|
||||
- kfree(dev->mtd.name);
|
||||
|
||||
- if (dev->blkdev) {
|
||||
- invalidate_mapping_pages(dev->blkdev->bd_inode->i_mapping,
|
||||
- 0, -1);
|
||||
- close_bdev_exclusive(dev->blkdev, FMODE_READ|FMODE_WRITE);
|
||||
- }
|
||||
+ read_lock(&dev->bdev_mutex);
|
||||
+ if (dev->blkdev)
|
||||
+ sync_blockdev(dev->blkdev);
|
||||
+ read_unlock(&dev->bdev_mutex);
|
||||
|
||||
- kfree(dev);
|
||||
+ return;
|
||||
}
|
||||
|
||||
|
||||
-/* FIXME: ensure that mtd->size % erase_size == 0 */
|
||||
-static struct block2mtd_dev *add_device(char *devname, int erase_size, const char *mtdname)
|
||||
+static int _open_bdev(struct block2mtd_dev *dev)
|
||||
{
|
||||
struct block_device *bdev;
|
||||
- struct block2mtd_dev *dev;
|
||||
- struct mtd_partition *part;
|
||||
- char *name;
|
||||
-
|
||||
- if (!devname)
|
||||
- return NULL;
|
||||
-
|
||||
- dev = kzalloc(sizeof(struct block2mtd_dev), GFP_KERNEL);
|
||||
- if (!dev)
|
||||
- return NULL;
|
||||
|
||||
/* Get a handle on the device */
|
||||
- bdev = open_bdev_exclusive(devname, FMODE_READ|FMODE_WRITE, NULL);
|
||||
+ bdev = open_bdev_exclusive(dev->devname, FMODE_READ|FMODE_WRITE, NULL);
|
||||
#ifndef MODULE
|
||||
if (IS_ERR(bdev)) {
|
||||
|
||||
/* We might not have rootfs mounted at this point. Try
|
||||
to resolve the device name by other means. */
|
||||
|
||||
- dev_t devt = name_to_dev_t(devname);
|
||||
+ dev_t devt = name_to_dev_t(dev->devname);
|
||||
if (devt) {
|
||||
bdev = open_by_devnum(devt, FMODE_WRITE | FMODE_READ);
|
||||
}
|
||||
@@ -263,17 +276,98 @@ static struct block2mtd_dev *add_device(
|
||||
#endif
|
||||
|
||||
if (IS_ERR(bdev)) {
|
||||
- ERROR("error: cannot open device %s", devname);
|
||||
- goto devinit_err;
|
||||
+ ERROR("error: cannot open device %s", dev->devname);
|
||||
+ return 1;
|
||||
}
|
||||
dev->blkdev = bdev;
|
||||
|
||||
if (MAJOR(bdev->bd_dev) == MTD_BLOCK_MAJOR) {
|
||||
ERROR("attempting to use an MTD device as a block device");
|
||||
- goto devinit_err;
|
||||
+ return 1;
|
||||
}
|
||||
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static void _close_bdev(struct block2mtd_dev *dev)
|
||||
+{
|
||||
+ struct block_device *bdev;
|
||||
+
|
||||
+ if (!dev->blkdev)
|
||||
+ return;
|
||||
+
|
||||
+ bdev = dev->blkdev;
|
||||
+ invalidate_mapping_pages(dev->blkdev->bd_inode->i_mapping, 0, -1);
|
||||
+ close_bdev_exclusive(dev->blkdev, FMODE_READ|FMODE_WRITE);
|
||||
+ dev->blkdev = NULL;
|
||||
+}
|
||||
+
|
||||
+static void block2mtd_free_device(struct block2mtd_dev *dev)
|
||||
+{
|
||||
+ if (!dev)
|
||||
+ return;
|
||||
+
|
||||
+ kfree(dev->mtd.name);
|
||||
+ _close_bdev(dev);
|
||||
+ kfree(dev);
|
||||
+}
|
||||
+
|
||||
+
|
||||
+static int block2mtd_refresh(struct mtd_info *mtd)
|
||||
+{
|
||||
+ struct block2mtd_dev *dev = mtd->priv;
|
||||
+ struct block_device *bdev;
|
||||
+ dev_t devt;
|
||||
+ int err = 0;
|
||||
+
|
||||
+ /* no other mtd function can run at this point */
|
||||
+ write_lock(&dev->bdev_mutex);
|
||||
+
|
||||
+ /* get the device number for the whole disk */
|
||||
+ devt = MKDEV(MAJOR(dev->blkdev->bd_dev), 0);
|
||||
+
|
||||
+ /* close the old block device */
|
||||
+ _close_bdev(dev);
|
||||
+
|
||||
+ /* open the whole disk, issue a partition rescan, then */
|
||||
+ bdev = open_by_devnum(devt, FMODE_WRITE | FMODE_READ);
|
||||
+ if (!bdev || !bdev->bd_disk)
|
||||
+ err = -EINVAL;
|
||||
+#ifndef CONFIG_MTD_BLOCK2MTD_MODULE
|
||||
+ else
|
||||
+ err = rescan_partitions(bdev->bd_disk, bdev);
|
||||
+#endif
|
||||
+ if (bdev)
|
||||
+ close_bdev_exclusive(bdev, FMODE_READ|FMODE_WRITE);
|
||||
+
|
||||
+ /* try to open the partition block device again */
|
||||
+ _open_bdev(dev);
|
||||
+ write_unlock(&dev->bdev_mutex);
|
||||
+
|
||||
+ return err;
|
||||
+}
|
||||
+
|
||||
+/* FIXME: ensure that mtd->size % erase_size == 0 */
|
||||
+static struct block2mtd_dev *add_device(char *devname, int erase_size, char *mtdname)
|
||||
+{
|
||||
+ struct block2mtd_dev *dev;
|
||||
+ struct mtd_partition *part;
|
||||
+ char *name;
|
||||
+
|
||||
+ if (!devname)
|
||||
+ return NULL;
|
||||
+
|
||||
+ dev = kzalloc(sizeof(struct block2mtd_dev) + strlen(devname) + 1, GFP_KERNEL);
|
||||
+ if (!dev)
|
||||
+ return NULL;
|
||||
+
|
||||
+ strcpy(dev->devname, devname);
|
||||
+
|
||||
+ if (_open_bdev(dev))
|
||||
+ goto devinit_err;
|
||||
+
|
||||
mutex_init(&dev->write_mutex);
|
||||
+ rwlock_init(&dev->bdev_mutex);
|
||||
|
||||
/* Setup the MTD structure */
|
||||
/* make the name contain the block device in */
|
||||
@@ -298,6 +392,7 @@ static struct block2mtd_dev *add_device(
|
||||
dev->mtd.read = block2mtd_read;
|
||||
dev->mtd.priv = dev;
|
||||
dev->mtd.owner = THIS_MODULE;
|
||||
+ dev->mtd.refresh_device = block2mtd_refresh;
|
||||
|
||||
part = kzalloc(sizeof(struct mtd_partition), GFP_KERNEL);
|
||||
part->name = dev->mtd.name;
|
@ -1,6 +1,6 @@
|
||||
--- a/drivers/mtd/chips/cfi_cmdset_0002.c
|
||||
+++ b/drivers/mtd/chips/cfi_cmdset_0002.c
|
||||
@@ -446,9 +446,9 @@ struct mtd_info *cfi_cmdset_0002(struct
|
||||
@@ -446,9 +446,9 @@ struct mtd_info *cfi_cmdset_0002(struct
|
||||
|
||||
/*
|
||||
* Valid primary extension versions are: 1.0, 1.1, 1.2, 1.3, 1.4
|
@ -1,6 +1,6 @@
|
||||
--- a/drivers/mtd/chips/cfi_cmdset_0002.c
|
||||
+++ b/drivers/mtd/chips/cfi_cmdset_0002.c
|
||||
@@ -392,9 +392,35 @@ static struct cfi_fixup fixup_table[] =
|
||||
@@ -392,9 +392,35 @@ static struct cfi_fixup fixup_table[] =
|
||||
static void cfi_fixup_major_minor(struct cfi_private *cfi,
|
||||
struct cfi_pri_amdstd *extp)
|
||||
{
|
@ -601,7 +601,7 @@
|
||||
dev->checkpointBlockList[i] = -1;
|
||||
}
|
||||
|
||||
@@ -191,18 +185,17 @@ int yaffs_GetCheckpointSum(yaffs_Device
|
||||
@@ -191,18 +185,17 @@ int yaffs_GetCheckpointSum(yaffs_Device
|
||||
|
||||
static int yaffs_CheckpointFlushBuffer(yaffs_Device *dev)
|
||||
{
|
||||
@ -926,7 +926,7 @@
|
||||
{
|
||||
unsigned char cDelta; /* column parity delta */
|
||||
unsigned lDelta; /* line parity delta */
|
||||
@@ -294,8 +292,7 @@ int yaffs_ECCCorrectOther(unsigned char
|
||||
@@ -294,8 +292,7 @@ int yaffs_ECCCorrectOther(unsigned char
|
||||
return 0; /* no error */
|
||||
|
||||
if (lDelta == ~lDeltaPrime &&
|
||||
@ -936,7 +936,7 @@
|
||||
/* Single bit (recoverable) error in data */
|
||||
|
||||
bit = 0;
|
||||
@@ -307,7 +304,7 @@ int yaffs_ECCCorrectOther(unsigned char
|
||||
@@ -307,7 +304,7 @@ int yaffs_ECCCorrectOther(unsigned char
|
||||
if (cDelta & 0x02)
|
||||
bit |= 0x01;
|
||||
|
||||
@ -945,7 +945,7 @@
|
||||
return -1;
|
||||
|
||||
data[lDelta] ^= (1 << bit);
|
||||
@@ -316,7 +313,7 @@ int yaffs_ECCCorrectOther(unsigned char
|
||||
@@ -316,7 +313,7 @@ int yaffs_ECCCorrectOther(unsigned char
|
||||
}
|
||||
|
||||
if ((yaffs_CountBits32(lDelta) + yaffs_CountBits32(lDeltaPrime) +
|
||||
@ -954,7 +954,7 @@
|
||||
/* Reccoverable error in ecc */
|
||||
|
||||
*read_ecc = *test_ecc;
|
||||
@@ -326,6 +323,4 @@ int yaffs_ECCCorrectOther(unsigned char
|
||||
@@ -326,6 +323,4 @@ int yaffs_ECCCorrectOther(unsigned char
|
||||
/* Unrecoverable error */
|
||||
|
||||
return -1;
|
||||
@ -1398,7 +1398,7 @@
|
||||
{
|
||||
unsigned char *alias;
|
||||
int ret;
|
||||
@@ -329,7 +395,7 @@ static int yaffs_readlink(struct dentry
|
||||
@@ -329,7 +395,7 @@ static int yaffs_readlink(struct dentry
|
||||
return ret;
|
||||
}
|
||||
|
||||
@ -1560,7 +1560,7 @@
|
||||
static int yaffs_file_flush(struct file *file, fl_owner_t id)
|
||||
#else
|
||||
static int yaffs_file_flush(struct file *file)
|
||||
@@ -513,8 +579,8 @@ static int yaffs_file_flush(struct file
|
||||
@@ -513,8 +579,8 @@ static int yaffs_file_flush(struct file
|
||||
yaffs_Device *dev = obj->myDev;
|
||||
|
||||
T(YAFFS_TRACE_OS,
|
||||
@ -1571,7 +1571,7 @@
|
||||
|
||||
yaffs_GrossLock(dev);
|
||||
|
||||
@@ -535,15 +601,15 @@ static int yaffs_readpage_nolock(struct
|
||||
@@ -535,15 +601,15 @@ static int yaffs_readpage_nolock(struct
|
||||
|
||||
yaffs_Device *dev;
|
||||
|
||||
@ -1591,7 +1591,7 @@
|
||||
BUG_ON(!PageLocked(pg));
|
||||
#else
|
||||
if (!PageLocked(pg))
|
||||
@@ -555,9 +621,9 @@ static int yaffs_readpage_nolock(struct
|
||||
@@ -555,9 +621,9 @@ static int yaffs_readpage_nolock(struct
|
||||
|
||||
yaffs_GrossLock(dev);
|
||||
|
||||
@ -1604,7 +1604,7 @@
|
||||
|
||||
yaffs_GrossUnlock(dev);
|
||||
|
||||
@@ -575,7 +641,7 @@ static int yaffs_readpage_nolock(struct
|
||||
@@ -575,7 +641,7 @@ static int yaffs_readpage_nolock(struct
|
||||
flush_dcache_page(pg);
|
||||
kunmap(pg);
|
||||
|
||||
@ -3193,7 +3193,7 @@
|
||||
if (n < step) {
|
||||
n++;
|
||||
continue;
|
||||
@@ -2119,7 +2356,7 @@ static int yaffs_proc_write(struct file
|
||||
@@ -2119,7 +2356,7 @@ static int yaffs_proc_write(struct file
|
||||
char *end;
|
||||
char *mask_name;
|
||||
const char *x;
|
||||
@ -3202,7 +3202,7 @@
|
||||
int i;
|
||||
int done = 0;
|
||||
int add, len = 0;
|
||||
@@ -2129,9 +2366,8 @@ static int yaffs_proc_write(struct file
|
||||
@@ -2129,9 +2366,8 @@ static int yaffs_proc_write(struct file
|
||||
|
||||
while (!done && (pos < count)) {
|
||||
done = 1;
|
||||
@ -3213,7 +3213,7 @@
|
||||
|
||||
switch (buf[pos]) {
|
||||
case '+':
|
||||
@@ -2148,20 +2384,21 @@ static int yaffs_proc_write(struct file
|
||||
@@ -2148,20 +2384,21 @@ static int yaffs_proc_write(struct file
|
||||
mask_name = NULL;
|
||||
|
||||
mask_bitfield = simple_strtoul(buf + pos, &end, 0);
|
||||
@ -3240,7 +3240,7 @@
|
||||
mask_name = mask_flags[i].mask_name;
|
||||
mask_bitfield = mask_flags[i].mask_bitfield;
|
||||
done = 0;
|
||||
@@ -2172,7 +2409,7 @@ static int yaffs_proc_write(struct file
|
||||
@@ -2172,7 +2409,7 @@ static int yaffs_proc_write(struct file
|
||||
|
||||
if (mask_name != NULL) {
|
||||
done = 0;
|
||||
@ -3249,7 +3249,7 @@
|
||||
case '-':
|
||||
rg &= ~mask_bitfield;
|
||||
break;
|
||||
@@ -2191,13 +2428,13 @@ static int yaffs_proc_write(struct file
|
||||
@@ -2191,13 +2428,13 @@ static int yaffs_proc_write(struct file
|
||||
|
||||
yaffs_traceMask = rg | YAFFS_TRACE_ALWAYS;
|
||||
|
||||
@ -5691,7 +5691,7 @@
|
||||
{
|
||||
/* Get the real object in case we were fed a hard link as an equivalent object */
|
||||
equivalentObject = yaffs_GetEquivalentObject(equivalentObject);
|
||||
@@ -2363,33 +2396,31 @@ yaffs_Object *yaffs_Link(yaffs_Object *
|
||||
@@ -2363,33 +2396,31 @@ yaffs_Object *yaffs_Link(yaffs_Object *
|
||||
|
||||
}
|
||||
|
||||
@ -7622,7 +7622,7 @@
|
||||
int nToCopy;
|
||||
int n = nBytes;
|
||||
int nDone = 0;
|
||||
@@ -4600,27 +4665,26 @@ int yaffs_ReadDataFromFile(yaffs_Object
|
||||
@@ -4600,27 +4665,26 @@ int yaffs_ReadDataFromFile(yaffs_Object
|
||||
dev = in->myDev;
|
||||
|
||||
while (n > 0) {
|
||||
@ -7657,7 +7657,7 @@
|
||||
if (dev->nShortOpCaches > 0) {
|
||||
|
||||
/* If we can't find the data in the cache, then load it up. */
|
||||
@@ -4641,14 +4705,9 @@ int yaffs_ReadDataFromFile(yaffs_Object
|
||||
@@ -4641,14 +4705,9 @@ int yaffs_ReadDataFromFile(yaffs_Object
|
||||
|
||||
cache->locked = 1;
|
||||
|
||||
@ -7673,7 +7673,7 @@
|
||||
cache->locked = 0;
|
||||
} else {
|
||||
/* Read into the local buffer then copy..*/
|
||||
@@ -4657,41 +4716,19 @@ int yaffs_ReadDataFromFile(yaffs_Object
|
||||
@@ -4657,41 +4716,19 @@ int yaffs_ReadDataFromFile(yaffs_Object
|
||||
yaffs_GetTempBuffer(dev, __LINE__);
|
||||
yaffs_ReadChunkDataFromObject(in, chunk,
|
||||
localBuffer);
|
||||
@ -7718,7 +7718,7 @@
|
||||
}
|
||||
|
||||
n -= nToCopy;
|
||||
@@ -4704,28 +4741,37 @@ int yaffs_ReadDataFromFile(yaffs_Object
|
||||
@@ -4704,28 +4741,37 @@ int yaffs_ReadDataFromFile(yaffs_Object
|
||||
return nDone;
|
||||
}
|
||||
|
||||
@ -7923,7 +7923,7 @@
|
||||
int newFullChunks;
|
||||
|
||||
yaffs_Device *dev = in->myDev;
|
||||
@@ -4955,13 +4981,11 @@ int yaffs_ResizeFile(yaffs_Object * in,
|
||||
@@ -4955,13 +4981,11 @@ int yaffs_ResizeFile(yaffs_Object * in,
|
||||
|
||||
yaffs_CheckGarbageCollection(dev);
|
||||
|
||||
@ -7941,7 +7941,7 @@
|
||||
|
||||
if (newSize < oldFileSize) {
|
||||
|
||||
@@ -4994,21 +5018,20 @@ int yaffs_ResizeFile(yaffs_Object * in,
|
||||
@@ -4994,21 +5018,20 @@ int yaffs_ResizeFile(yaffs_Object * in,
|
||||
}
|
||||
|
||||
|
||||
@ -7968,7 +7968,7 @@
|
||||
{
|
||||
obj = yaffs_GetEquivalentObject(obj);
|
||||
|
||||
@@ -5024,7 +5047,7 @@ loff_t yaffs_GetFileSize(yaffs_Object *
|
||||
@@ -5024,7 +5047,7 @@ loff_t yaffs_GetFileSize(yaffs_Object *
|
||||
|
||||
|
||||
|
||||
@ -9789,7 +9789,7 @@
|
||||
{
|
||||
int init_failed = 0;
|
||||
unsigned x;
|
||||
@@ -7040,6 +7126,8 @@ int yaffs_GutsInitialise(yaffs_Device *
|
||||
@@ -7040,6 +7126,8 @@ int yaffs_GutsInitialise(yaffs_Device *
|
||||
dev->chunkOffset = 0;
|
||||
dev->nFreeChunks = 0;
|
||||
|
||||
@ -9798,7 +9798,7 @@
|
||||
if (dev->startBlock == 0) {
|
||||
dev->internalStartBlock = dev->startBlock + 1;
|
||||
dev->internalEndBlock = dev->endBlock + 1;
|
||||
@@ -7049,18 +7137,18 @@ int yaffs_GutsInitialise(yaffs_Device *
|
||||
@@ -7049,18 +7137,18 @@ int yaffs_GutsInitialise(yaffs_Device *
|
||||
|
||||
/* Check geometry parameters. */
|
||||
|
||||
@ -9823,7 +9823,7 @@
|
||||
return YAFFS_FAIL;
|
||||
}
|
||||
|
||||
@@ -7070,6 +7158,12 @@ int yaffs_GutsInitialise(yaffs_Device *
|
||||
@@ -7070,6 +7158,12 @@ int yaffs_GutsInitialise(yaffs_Device *
|
||||
return YAFFS_FAIL;
|
||||
}
|
||||
|
||||
@ -9836,7 +9836,7 @@
|
||||
/* Got the right mix of functions? */
|
||||
if (!yaffs_CheckDevFunctions(dev)) {
|
||||
/* Function missing */
|
||||
@@ -7097,31 +7191,18 @@ int yaffs_GutsInitialise(yaffs_Device *
|
||||
@@ -7097,31 +7191,18 @@ int yaffs_GutsInitialise(yaffs_Device *
|
||||
|
||||
dev->isMounted = 1;
|
||||
|
||||
@ -9875,7 +9875,7 @@
|
||||
|
||||
/*
|
||||
* Calculate chunkGroupBits.
|
||||
@@ -7133,16 +7214,15 @@ int yaffs_GutsInitialise(yaffs_Device *
|
||||
@@ -7133,16 +7214,15 @@ int yaffs_GutsInitialise(yaffs_Device *
|
||||
bits = ShiftsGE(x);
|
||||
|
||||
/* Set up tnode width if wide tnodes are enabled. */
|
||||
@ -9896,7 +9896,7 @@
|
||||
dev->tnodeWidth = 16;
|
||||
|
||||
dev->tnodeMask = (1<<dev->tnodeWidth)-1;
|
||||
@@ -7193,7 +7273,7 @@ int yaffs_GutsInitialise(yaffs_Device *
|
||||
@@ -7193,7 +7273,7 @@ int yaffs_GutsInitialise(yaffs_Device *
|
||||
dev->hasPendingPrioritisedGCs = 1; /* Assume the worst for now, will get fixed on first GC */
|
||||
|
||||
/* Initialise temporary buffers and caches. */
|
||||
@ -9905,7 +9905,7 @@
|
||||
init_failed = 1;
|
||||
|
||||
dev->srCache = NULL;
|
||||
@@ -7203,25 +7283,26 @@ int yaffs_GutsInitialise(yaffs_Device *
|
||||
@@ -7203,25 +7283,26 @@ int yaffs_GutsInitialise(yaffs_Device *
|
||||
if (!init_failed &&
|
||||
dev->nShortOpCaches > 0) {
|
||||
int i;
|
||||
@ -9940,7 +9940,7 @@
|
||||
init_failed = 1;
|
||||
|
||||
dev->srLastUse = 0;
|
||||
@@ -7229,29 +7310,30 @@ int yaffs_GutsInitialise(yaffs_Device *
|
||||
@@ -7229,29 +7310,30 @@ int yaffs_GutsInitialise(yaffs_Device *
|
||||
|
||||
dev->cacheHits = 0;
|
||||
|
||||
@ -9979,7 +9979,7 @@
|
||||
T(YAFFS_TRACE_ALWAYS,
|
||||
(TSTR("yaffs: restored from checkpoint" TENDSTR)));
|
||||
} else {
|
||||
@@ -7273,24 +7355,25 @@ int yaffs_GutsInitialise(yaffs_Device *
|
||||
@@ -7273,24 +7355,25 @@ int yaffs_GutsInitialise(yaffs_Device *
|
||||
dev->nBackgroundDeletions = 0;
|
||||
dev->oldestDirtySequence = 0;
|
||||
|
||||
@ -10011,7 +10011,7 @@
|
||||
/* Clean up the mess */
|
||||
T(YAFFS_TRACE_TRACING,
|
||||
(TSTR("yaffs: yaffs_GutsInitialise() aborted.\n" TENDSTR)));
|
||||
@@ -7318,7 +7401,7 @@ int yaffs_GutsInitialise(yaffs_Device *
|
||||
@@ -7318,7 +7401,7 @@ int yaffs_GutsInitialise(yaffs_Device *
|
||||
|
||||
}
|
||||
|
||||
@ -10710,7 +10710,7 @@
|
||||
{
|
||||
if (etags) {
|
||||
memset(etags, 0, sizeof(*etags));
|
||||
@@ -169,9 +169,9 @@ static int rettags(yaffs_ExtendedTags *
|
||||
@@ -169,9 +169,9 @@ static int rettags(yaffs_ExtendedTags *
|
||||
* Returns YAFFS_OK or YAFFS_FAIL.
|
||||
*/
|
||||
int nandmtd1_ReadChunkWithTagsFromNAND(yaffs_Device *dev,
|
||||
@ -11038,14 +11038,14 @@
|
||||
+ yaffs_UnpackTags2(tags, &pt);
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
|
||||
- if(tags && retval == -EBADMSG && tags->eccResult == YAFFS_ECC_RESULT_NO_ERROR)
|
||||
- tags->eccResult = YAFFS_ECC_RESULT_UNFIXED;
|
||||
+ if (localData)
|
||||
+ yaffs_ReleaseTempBuffer(dev, data, __LINE__);
|
||||
|
||||
- if(tags && retval == -EBADMSG && tags->eccResult == YAFFS_ECC_RESULT_NO_ERROR)
|
||||
+ if (tags && retval == -EBADMSG && tags->eccResult == YAFFS_ECC_RESULT_NO_ERROR)
|
||||
tags->eccResult = YAFFS_ECC_RESULT_UNFIXED;
|
||||
-
|
||||
+ tags->eccResult = YAFFS_ECC_RESULT_UNFIXED;
|
||||
if (retval == 0)
|
||||
return YAFFS_OK;
|
||||
else
|
@ -316,7 +316,7 @@
|
||||
chunk/page state. This byte is zeroed when the page is discarded.
|
||||
Choose this option if you have existing on-NAND data in this format
|
||||
that you need to continue to support. New data written also uses the
|
||||
@@ -57,7 +78,7 @@ adjusted to use the older-style format.
|
||||
@@ -57,7 +78,7 @@ adjusted to use the older-style format.
|
||||
MTD versions in yaffs_mtdif1.c.
|
||||
*/
|
||||
/* Default: Not selected */
|
||||
@ -1614,7 +1614,7 @@
|
||||
yaffs_ECCOther *read_ecc,
|
||||
const yaffs_ECCOther *test_ecc)
|
||||
{
|
||||
@@ -304,7 +301,7 @@ int yaffs_ECCCorrectOther(unsigned char
|
||||
@@ -304,7 +301,7 @@ int yaffs_ECCCorrectOther(unsigned char
|
||||
if (cDelta & 0x02)
|
||||
bit |= 0x01;
|
||||
|
||||
@ -1623,7 +1623,7 @@
|
||||
return -1;
|
||||
|
||||
data[lDelta] ^= (1 << bit);
|
||||
@@ -312,8 +309,8 @@ int yaffs_ECCCorrectOther(unsigned char
|
||||
@@ -312,8 +309,8 @@ int yaffs_ECCCorrectOther(unsigned char
|
||||
return 1; /* corrected */
|
||||
}
|
||||
|
@ -124,7 +124,7 @@
|
||||
/* LzmaDecode
|
||||
--- a/lib/lzma/LzmaDec.c
|
||||
+++ b/lib/lzma/LzmaDec.c
|
||||
@@ -682,7 +682,7 @@ static void LzmaDec_InitRc(CLzmaDec *p,
|
||||
@@ -682,7 +682,7 @@ static void LzmaDec_InitRc(CLzmaDec *p,
|
||||
p->needFlush = 0;
|
||||
}
|
||||
|
||||
@ -194,7 +194,7 @@
|
||||
{
|
||||
CLzmaProps propNew;
|
||||
RINOK(LzmaProps_Decode(&propNew, props, propsSize));
|
||||
@@ -944,7 +944,7 @@ SRes LzmaDec_AllocateProbs(CLzmaDec *p,
|
||||
@@ -944,7 +944,7 @@ SRes LzmaDec_AllocateProbs(CLzmaDec *p,
|
||||
return SZ_OK;
|
||||
}
|
||||
|
||||
@ -375,7 +375,7 @@
|
||||
void MatchFinder_Construct(CMatchFinder *p);
|
||||
|
||||
/* Conditions:
|
||||
@@ -70,12 +65,6 @@ int MatchFinder_Create(CMatchFinder *p,
|
||||
@@ -70,12 +65,6 @@ int MatchFinder_Create(CMatchFinder *p,
|
||||
UInt32 keepAddBufferBefore, UInt32 matchMaxLen, UInt32 keepAddBufferAfter,
|
||||
ISzAlloc *alloc);
|
||||
void MatchFinder_Free(CMatchFinder *p, ISzAlloc *alloc);
|
@ -107,7 +107,7 @@ Signed-off-by: Phillip Lougher <phillip@lougher.demon.co.uk>
|
||||
+#endif
|
||||
--- a/lib/Kconfig
|
||||
+++ b/lib/Kconfig
|
||||
@@ -124,6 +124,9 @@ config DECOMPRESS_LZO
|
||||
@@ -130,6 +130,9 @@ config DECOMPRESS_LZO
|
||||
select LZO_DECOMPRESS
|
||||
tristate
|
||||
|
@ -1,6 +1,6 @@
|
||||
--- a/net/netfilter/Kconfig
|
||||
+++ b/net/netfilter/Kconfig
|
||||
@@ -948,6 +948,27 @@ config NETFILTER_XT_MATCH_STATE
|
||||
@@ -946,6 +946,27 @@ config NETFILTER_XT_MATCH_STATE
|
||||
|
||||
To compile it as a module, choose M here. If unsure, say N.
|
||||
|
||||
@ -30,7 +30,7 @@
|
||||
depends on NETFILTER_ADVANCED
|
||||
--- a/net/netfilter/Makefile
|
||||
+++ b/net/netfilter/Makefile
|
||||
@@ -95,6 +95,7 @@ obj-$(CONFIG_NETFILTER_XT_MATCH_RECENT)
|
||||
@@ -95,6 +95,7 @@ obj-$(CONFIG_NETFILTER_XT_MATCH_RECENT)
|
||||
obj-$(CONFIG_NETFILTER_XT_MATCH_SCTP) += xt_sctp.o
|
||||
obj-$(CONFIG_NETFILTER_XT_MATCH_SOCKET) += xt_socket.o
|
||||
obj-$(CONFIG_NETFILTER_XT_MATCH_STATE) += xt_state.o
|
@ -1,6 +1,6 @@
|
||||
--- a/net/netfilter/Kconfig
|
||||
+++ b/net/netfilter/Kconfig
|
||||
@@ -762,6 +762,27 @@ config NETFILTER_XT_MATCH_IPVS
|
||||
@@ -760,6 +760,27 @@ config NETFILTER_XT_MATCH_IPVS
|
||||
|
||||
If unsure, say N.
|
||||
|
||||
@ -28,7 +28,7 @@
|
||||
config NETFILTER_XT_MATCH_LENGTH
|
||||
tristate '"length" match support'
|
||||
depends on NETFILTER_ADVANCED
|
||||
@@ -948,26 +969,11 @@ config NETFILTER_XT_MATCH_STATE
|
||||
@@ -946,26 +967,11 @@ config NETFILTER_XT_MATCH_STATE
|
||||
|
||||
To compile it as a module, choose M here. If unsure, say N.
|
||||
|
@ -1,6 +1,6 @@
|
||||
--- a/drivers/net/phy/Kconfig
|
||||
+++ b/drivers/net/phy/Kconfig
|
||||
@@ -92,6 +92,11 @@ config MICREL_PHY
|
||||
@@ -98,6 +98,11 @@ config MICREL_PHY
|
||||
---help---
|
||||
Supports the KSZ9021, VSC8201, KS8001 PHYs.
|
||||
|
||||
@ -14,7 +14,7 @@
|
||||
depends on PHYLIB=y
|
||||
--- a/drivers/net/phy/Makefile
|
||||
+++ b/drivers/net/phy/Makefile
|
||||
@@ -13,6 +13,7 @@ obj-$(CONFIG_VITESSE_PHY) += vitesse.o
|
||||
@@ -14,6 +14,7 @@ obj-$(CONFIG_VITESSE_PHY) += vitesse.o
|
||||
obj-$(CONFIG_BROADCOM_PHY) += broadcom.o
|
||||
obj-$(CONFIG_BCM63XX_PHY) += bcm63xx.o
|
||||
obj-$(CONFIG_ICPLUS_PHY) += icplus.o
|
@ -1,6 +1,6 @@
|
||||
--- a/drivers/net/wireless/hostap/hostap_ap.c
|
||||
+++ b/drivers/net/wireless/hostap/hostap_ap.c
|
||||
@@ -2335,13 +2335,13 @@ int prism2_ap_get_sta_qual(local_info_t
|
||||
@@ -2335,13 +2335,13 @@ int prism2_ap_get_sta_qual(local_info_t
|
||||
addr[count].sa_family = ARPHRD_ETHER;
|
||||
memcpy(addr[count].sa_data, sta->addr, ETH_ALEN);
|
||||
if (sta->last_rx_silence == 0)
|
@ -11,7 +11,7 @@
|
||||
endif # NEW_LEDS
|
||||
--- a/drivers/leds/Makefile
|
||||
+++ b/drivers/leds/Makefile
|
||||
@@ -52,3 +52,4 @@ obj-$(CONFIG_LEDS_TRIGGER_HEARTBEAT) +=
|
||||
@@ -52,3 +52,4 @@ obj-$(CONFIG_LEDS_TRIGGER_HEARTBEAT) +=
|
||||
obj-$(CONFIG_LEDS_TRIGGER_BACKLIGHT) += ledtrig-backlight.o
|
||||
obj-$(CONFIG_LEDS_TRIGGER_GPIO) += ledtrig-gpio.o
|
||||
obj-$(CONFIG_LEDS_TRIGGER_DEFAULT_ON) += ledtrig-default-on.o
|
@ -14,7 +14,7 @@
|
||||
endif # NEW_LEDS
|
||||
--- a/drivers/leds/Makefile
|
||||
+++ b/drivers/leds/Makefile
|
||||
@@ -53,3 +53,4 @@ obj-$(CONFIG_LEDS_TRIGGER_BACKLIGHT) +=
|
||||
@@ -53,3 +53,4 @@ obj-$(CONFIG_LEDS_TRIGGER_BACKLIGHT) +=
|
||||
obj-$(CONFIG_LEDS_TRIGGER_GPIO) += ledtrig-gpio.o
|
||||
obj-$(CONFIG_LEDS_TRIGGER_DEFAULT_ON) += ledtrig-default-on.o
|
||||
obj-$(CONFIG_LEDS_TRIGGER_MORSE) += ledtrig-morse.o
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user