summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Rini <trini@kernel.crashing.org>2004-07-15 20:18:22 -0700
committerTom Rini <trini@kernel.crashing.org>2004-07-15 20:18:22 -0700
commitd77b3c84297c4356beb4a5f6a4153c03577a2bc9 (patch)
tree977b05464a2bc58983f8002e320a1bb3c220ea5e
parent2e8debd54b462823940bf0165798c3475a199161 (diff)
parent3d3b3a5528a89360cefdde65df78f8d63b47463e (diff)
Merge kernel.crashing.org:/home/trini/work/kernel/pristine/linux-2.6
into kernel.crashing.org:/home/trini/work/kernel/pristine/for-linus-ppc
-rw-r--r--drivers/mtd/chips/Kconfig3
-rw-r--r--drivers/mtd/nand/diskonchip.c30
-rw-r--r--fs/Kconfig9
-rw-r--r--fs/jffs2/Makefile3
-rw-r--r--fs/jffs2/compr.h6
-rw-r--r--fs/jffs2/proc.c217
-rw-r--r--fs/jffs2/super.c15
7 files changed, 16 insertions, 267 deletions
diff --git a/drivers/mtd/chips/Kconfig b/drivers/mtd/chips/Kconfig
index 1247669ac0ef..2d2b7d467086 100644
--- a/drivers/mtd/chips/Kconfig
+++ b/drivers/mtd/chips/Kconfig
@@ -1,5 +1,5 @@
# drivers/mtd/chips/Kconfig
-# $Id: Kconfig,v 1.8 2004/07/13 22:32:02 dwmw2 Exp $
+# $Id: Kconfig,v 1.9 2004/07/16 15:32:14 dwmw2 Exp $
menu "RAM/ROM/Flash chip drivers"
depends on MTD!=n
@@ -233,6 +233,7 @@ config MTD_ABSENT
with this driver will return -ENODEV upon access.
config MTD_OBSOLETE_CHIPS
+ depends on MTD && BROKEN
bool "Older (theoretically obsoleted now) drivers for non-CFI chips"
help
This option does not enable any code directly, but will allow you to
diff --git a/drivers/mtd/nand/diskonchip.c b/drivers/mtd/nand/diskonchip.c
index 677c21685218..1455d8caa9eb 100644
--- a/drivers/mtd/nand/diskonchip.c
+++ b/drivers/mtd/nand/diskonchip.c
@@ -7,7 +7,7 @@
*
* Interface to generic NAND code for M-Systems DiskOnChip devices
*
- * $Id: diskonchip.c,v 1.23 2004/07/13 00:14:35 dbrown Exp $
+ * $Id: diskonchip.c,v 1.25 2004/07/16 13:54:27 dbrown Exp $
*/
#include <linux/kernel.h>
@@ -382,7 +382,7 @@ static void doc2001_readbuf(struct mtd_info *mtd,
ReadDOC(docptr, ReadPipeInit);
for (i=0; i < len-1; i++)
- buf[i] = ReadDOC(docptr, Mil_CDSN_IO);
+ buf[i] = ReadDOC(docptr, Mil_CDSN_IO + (i & 0xff));
/* Terminate read pipeline */
buf[i] = ReadDOC(docptr, LastDataRead);
@@ -654,7 +654,7 @@ static int __init find_media_headers(struct mtd_info *mtd, u_char *buf,
int offs, end = (MAX_MEDIAHEADER_SCAN << this->phys_erase_shift);
int ret, retlen;
- end = min(end, mtd->size); // paranoia
+ end = min(end, (int)mtd->size); // paranoia
for (offs = 0; offs < end; offs += mtd->erasesize) {
ret = mtd->read(mtd, offs, mtd->oobblock, &retlen, buf);
if (retlen != mtd->oobblock) continue;
@@ -714,7 +714,7 @@ static inline int __init nftl_partscan(struct mtd_info *mtd,
//#endif
blocks = mtd->size >> this->phys_erase_shift;
- maxblocks = min(32768, mtd->erasesize - psize);
+ maxblocks = min(32768, (int)mtd->erasesize - psize);
if (mh->UnitSizeFactor == 0x00) {
/* Auto-determine UnitSizeFactor. The constraints are:
@@ -741,7 +741,7 @@ static inline int __init nftl_partscan(struct mtd_info *mtd,
mtd->erasesize <<= (0xff - mh->UnitSizeFactor);
printk(KERN_INFO "Setting virtual erase size to %d\n", mtd->erasesize);
blocks = mtd->size >> this->bbt_erase_shift;
- maxblocks = min(32768, mtd->erasesize - psize);
+ maxblocks = min(32768, (int)mtd->erasesize - psize);
}
if (blocks > maxblocks) {
@@ -933,17 +933,6 @@ static int __init inftl_scan_bbt(struct mtd_info *mtd)
return -EIO;
}
- if (mtd->size == (8<<20)) {
-#if 0
-/* This doesn't seem to work for me. I get ECC errors on every page. */
- /* The Millennium 8MiB is actually an NFTL device! */
- mtd->name = "DiskOnChip Millennium 8MiB (NFTL)";
- return nftl_scan_bbt(mtd);
-#endif
- printk(KERN_ERR "DiskOnChip Millennium 8MiB is not supported.\n");
- return -EIO;
- }
-
this->bbt_td->options = NAND_BBT_LASTBLOCK | NAND_BBT_8BIT |
NAND_BBT_VERSION;
if (inftl_bbt_write)
@@ -1011,7 +1000,6 @@ static inline int __init doc2001_init(struct mtd_info *mtd)
this->write_buf = doc2001_writebuf;
this->read_buf = doc2001_readbuf;
this->verify_buf = doc2001_verifybuf;
- this->scan_bbt = inftl_scan_bbt;
ReadDOC(doc->virtadr, ChipID);
ReadDOC(doc->virtadr, ChipID);
@@ -1023,11 +1011,13 @@ static inline int __init doc2001_init(struct mtd_info *mtd)
can have multiple chips. */
doc2000_count_chips(mtd);
mtd->name = "DiskOnChip 2000 (INFTL Model)";
+ this->scan_bbt = inftl_scan_bbt;
return (4 * doc->chips_per_floor);
} else {
/* Bog-standard Millennium */
doc->chips_per_floor = 1;
mtd->name = "DiskOnChip Millennium";
+ this->scan_bbt = nftl_scan_bbt;
return 1;
}
}
@@ -1096,14 +1086,16 @@ static inline int __init doc_probe(unsigned long physadr)
}
for (mtd = doclist; mtd; mtd = doc->nextdoc) {
+ unsigned char oldval;
+ unsigned char newval;
nand = mtd->priv;
doc = (void *)nand->priv;
/* Use the alias resolution register to determine if this is
in fact the same DOC aliased to a new address. If writes
to one chip's alias resolution register change the value on
the other chip, they're the same chip. */
- unsigned char oldval = ReadDOC(doc->virtadr, AliasResolution);
- unsigned char newval = ReadDOC(virtadr, AliasResolution);
+ oldval = ReadDOC(doc->virtadr, AliasResolution);
+ newval = ReadDOC(virtadr, AliasResolution);
if (oldval != newval)
continue;
WriteDOC(~newval, virtadr, AliasResolution);
diff --git a/fs/Kconfig b/fs/Kconfig
index 2c35a14ccfbb..5e7c10fa8f8f 100644
--- a/fs/Kconfig
+++ b/fs/Kconfig
@@ -1216,15 +1216,6 @@ config JFFS2_CMODE_SIZE
endchoice
-config JFFS2_PROC
- bool "JFFS2 proc interface support" if JFFS2_COMPRESSION_OPTIONS
- depends on JFFS2_FS && PROC_FS
- default n
- help
- You can read some statistics and set the compression mode and
- compressor priorities with this interface.
-
-
config CRAMFS
tristate "Compressed ROM file system support"
select ZLIB_INFLATE
diff --git a/fs/jffs2/Makefile b/fs/jffs2/Makefile
index 73ee11016976..27eaa6a2b54f 100644
--- a/fs/jffs2/Makefile
+++ b/fs/jffs2/Makefile
@@ -1,7 +1,7 @@
#
# Makefile for the Linux Journalling Flash File System v2 (JFFS2)
#
-# $Id: Makefile.common,v 1.5 2004/07/15 16:06:41 dwmw2 Exp $
+# $Id: Makefile.common,v 1.6 2004/07/16 15:17:57 dwmw2 Exp $
#
obj-$(CONFIG_JFFS2_FS) += jffs2.o
@@ -15,4 +15,3 @@ jffs2-$(CONFIG_JFFS2_FS_NAND) += wbuf.o
jffs2-$(CONFIG_JFFS2_RUBIN) += compr_rubin.o
jffs2-$(CONFIG_JFFS2_RTIME) += compr_rtime.o
jffs2-$(CONFIG_JFFS2_ZLIB) += compr_zlib.o
-jffs2-$(CONFIG_JFFS2_PROC) += proc.o
diff --git a/fs/jffs2/compr.h b/fs/jffs2/compr.h
index 5e3445da3e5e..6777d8c91524 100644
--- a/fs/jffs2/compr.h
+++ b/fs/jffs2/compr.h
@@ -7,7 +7,7 @@
* For licensing information, see the file 'LICENCE' in the
* jffs2 directory.
*
- * $Id: compr.h,v 1.5 2004/06/23 16:34:39 havasi Exp $
+ * $Id: compr.h,v 1.6 2004/07/16 15:17:57 dwmw2 Exp $
*
*/
@@ -115,8 +115,4 @@ int jffs2_lzo_init(void);
void jffs2_lzo_exit(void);
#endif
-/* Prototypes from proc.c */
-int jffs2_proc_init(void);
-int jffs2_proc_exit(void);
-
#endif /* __JFFS2_COMPR_H__ */
diff --git a/fs/jffs2/proc.c b/fs/jffs2/proc.c
deleted file mode 100644
index 36c0a0e78a4e..000000000000
--- a/fs/jffs2/proc.c
+++ /dev/null
@@ -1,217 +0,0 @@
-/*
- * JFFS2 -- Journalling Flash File System, Version 2.
- *
- * Copyright (C) 2004 Ferenc Havasi <havasi@inf.u-szeged.hu>,
- * University of Szeged, Hungary
- *
- * For licensing information, see the file 'LICENCE' in this directory.
- *
- * $Id: proc.c,v 1.3 2004/06/24 09:51:38 havasi Exp $
- *
- * Files in /proc/fs/jffs2 directory:
- * compr_list
- * read: shows the list of the loaded compressors
- * (name, priority, enadbled/disabled)
- * write: compressors can be enabled/disabled and
- * the priority of them can be changed,
- * required formats:
- * enable COMPRESSOR_NAME
- * disble COMPRESSOR_NAME
- * priority NEW_PRIORITY COMPRESSOR_NAME
- * compr_mode
- * read: shows the name of the actual compression mode
- * write: sets the actual comperession mode
- * compr_stat
- * read: shows compression statistics
- */
-
-#include <linux/errno.h>
-#include <linux/fs.h>
-#include <linux/jffs.h>
-#include <linux/slab.h>
-#include <linux/proc_fs.h>
-#include <linux/sched.h>
-#include <linux/types.h>
-#include <linux/proc_fs.h>
-#include "compr.h"
-
-extern struct proc_dir_entry *jffs_proc_root;
-
-/* Structure for top-level entry in '/proc/fs' directory */
-static struct proc_dir_entry *jffs2_proc_root;
-
-/* Structure for files in /proc/fs/jffs2 directory */
-static struct proc_dir_entry *jffs2_proc_compr_stat;
-static struct proc_dir_entry *jffs2_proc_compr_mode;
-
-/* Read the JFFS2 'compr_stat' file */
-
-static int jffs2_proc_stat_read (char *page, char **start, off_t off,
- int count, int *eof, void *data)
-{
- int len = 0,i;
- char *stat = jffs2_stats();
-
- if (strlen(stat)<off) {
- *eof = 1;
- kfree(stat);
- return len;
- }
- for (i=off;((stat[i]!=0)&&(len<count));i++,len++) {
- page[len]=stat[i];
- }
- if (off+len>=strlen(stat)) *eof = 1;
- else *eof = 0;
- kfree(stat);
- return len;
-}
-
-
-/* Read the JFFS2 'compr_mode' file */
-
-static int jffs2_proc_mode_read (char *page, char **start, off_t off,
- int count, int *eof, void *data)
-{
- int len = 0;
- if (strlen(jffs2_get_compression_mode_name())+1>count) {
- /* it should not happen */
- *eof = 1;
- return 0;
- }
- len += sprintf(page, "%s\n",jffs2_get_compression_mode_name());
- *eof = 1;
- return len;
-}
-
-/* Write the JFFS2 'compr_mode' file
- * sets the actual compression mode
- */
-
-static int jffs2_proc_mode_write(struct file *file, const char *buffer,
- unsigned long count, void *data)
-{
- char *compr_name;
-
- /* collect the name of the compression mode and set it */
- compr_name = kmalloc(count+1,GFP_KERNEL);
- if (sscanf(buffer,"%s",compr_name)>0) {
- if (jffs2_set_compression_mode_name(compr_name)) {
- printk(KERN_WARNING "JFFS2: error switching compression mode. Invalid parameter (%s)?\n",compr_name);
- }
- }
- else {
- printk(KERN_WARNING "JFFS2: error: parameter missing\n");
- }
- kfree(compr_name);
- return count;
-}
-
-/* Read the JFFS2 'compr_list' file */
-
-static int jffs2_proc_list_read (char *page, char **start, off_t off,
- int count, int *eof, void *data)
-{
- int len = 0;
- char *list = jffs2_list_compressors();
- if (strlen(list)+1>count) {
- /* it should not happen */
- *eof = 1;
- kfree(list);
- return 0;
- }
- len += sprintf(page,"%s",list);
- *eof = 1;
- kfree(list);
- return len;
-}
-
-/* Write the JFFS2 'compr_list' file
- * enable/disable a compressor or set the priority of it
- */
-
-static int jffs2_proc_list_write(struct file *file, const char *buffer,
- unsigned long count, void *data)
-{
- int prior;
- char *compr_name,*compr_cmd;
-
- compr_name = kmalloc(count+1,GFP_KERNEL);
- compr_cmd = kmalloc(count+1,GFP_KERNEL);
- if (!compr_name) {
- printk(KERN_WARNING "JFFS2: unable to allocate memory\n");
- goto list_write_end;
- }
- compr_name[0] = 0;
-
- if (sscanf(buffer,"priority %d %s",&prior,compr_name)>1) {
- jffs2_set_compressor_priority(compr_name, prior);
- goto list_write_end;
- }
- if (sscanf(buffer,"enable %s",compr_name)>0) {
- jffs2_enable_compressor_name(compr_name);
- goto list_write_end;
- }
- if (sscanf(buffer,"disable %s",compr_name)>0) {
- jffs2_disable_compressor_name(compr_name);
- goto list_write_end;
- }
- printk(KERN_WARNING "JFFS2: usage of /proc/fs/jffs2/compr_list:\n"
- " echo \"enable COMPRESSOR_NAME\" >/proc/fs/jffs2/compr_list\n"
- " echo \"disable COMPRESSOR_NAME\" >/proc/fs/jffs2/compr_list\n"
- " echo \"priority NEW_PRIORITY COMPRESSOR_NAME\" >/proc/fs/jffs2/compr_list\n");
-list_write_end:
- kfree(compr_cmd);
- kfree(compr_name);
- return count;
-}
-
-/* Register a JFFS2 proc directory */
-
-int jffs2_proc_init(void)
-{
- jffs2_proc_root = proc_mkdir("jffs2", proc_root_fs);
-
- /* create entry for 'compr_stat' file */
- if ((jffs2_proc_compr_stat = create_proc_entry ("compr_stat", 0, jffs2_proc_root))) {
- jffs2_proc_compr_stat->read_proc = jffs2_proc_stat_read;
- }
- else {
- return -ENOMEM;
- }
- /* create entry for 'compr_mode' file */
- if ((jffs2_proc_compr_mode = create_proc_entry ("compr_mode", 0, jffs2_proc_root))) {
- jffs2_proc_compr_mode->read_proc = jffs2_proc_mode_read;
- jffs2_proc_compr_mode->write_proc = jffs2_proc_mode_write;
- }
- else {
- return -ENOMEM;
- }
- /* create entry for 'compr_list' file */
- if ((jffs2_proc_compr_mode = create_proc_entry ("compr_list", 0, jffs2_proc_root))) {
- jffs2_proc_compr_mode->read_proc = jffs2_proc_list_read;
- jffs2_proc_compr_mode->write_proc = jffs2_proc_list_write;
- }
- else {
- return -ENOMEM;
- }
- return 0;
-}
-
-
-/* Unregister a JFFS2 proc directory */
-
-int jffs2_proc_exit(void)
-{
-#if LINUX_VERSION_CODE < 0x020300
- remove_proc_entry ("compr_stat", &jffs2_proc_root);
- remove_proc_entry ("compr_mode", &jffs2_proc_root);
- remove_proc_entry ("compr_list", &jffs2_proc_root);
- remove_proc_entry ("jffs2", &proc_root_fs);
-#else
- remove_proc_entry ("compr_stat", jffs2_proc_root);
- remove_proc_entry ("compr_mode", jffs2_proc_root);
- remove_proc_entry ("compr_list", jffs2_proc_root);
- remove_proc_entry ("jffs2", proc_root_fs);
-#endif
- return 0;
-}
diff --git a/fs/jffs2/super.c b/fs/jffs2/super.c
index 23dad4785e8b..c37fb163ef81 100644
--- a/fs/jffs2/super.c
+++ b/fs/jffs2/super.c
@@ -7,7 +7,7 @@
*
* For licensing information, see the file 'LICENCE' in this directory.
*
- * $Id: super.c,v 1.96 2004/07/13 08:57:30 dwmw2 Exp $
+ * $Id: super.c,v 1.97 2004/07/16 15:17:57 dwmw2 Exp $
*
*/
@@ -308,13 +308,6 @@ static int __init init_jffs2_fs(void)
printk(KERN_ERR "JFFS2 error: Failed to initialise inode cache\n");
return -ENOMEM;
}
-#ifdef CONFIG_JFFS2_PROC
- ret = jffs2_proc_init();
- if (ret) {
- printk(KERN_ERR "JFFS2 error: Failed to initialise proc interface\n");
- goto out;
- }
-#endif
ret = jffs2_compressors_init();
if (ret) {
printk(KERN_ERR "JFFS2 error: Failed to initialise compressors\n");
@@ -336,9 +329,6 @@ static int __init init_jffs2_fs(void)
jffs2_destroy_slab_caches();
out_compressors:
jffs2_compressors_exit();
-#ifdef CONFIG_JFFS2_PROC
- jffs2_proc_exit();
-#endif
out:
return ret;
}
@@ -348,9 +338,6 @@ static void __exit exit_jffs2_fs(void)
unregister_filesystem(&jffs2_fs_type);
jffs2_destroy_slab_caches();
jffs2_compressors_exit();
-#ifdef CONFIG_JFFS2_PROC
- jffs2_proc_exit();
-#endif
kmem_cache_destroy(jffs2_inode_cachep);
}