* Acknowledgements:
* * Luc van OostenRyck for numerous patches.
* * Nick Bane for numerous patches.
+ * * Andras Toth for mknod rdev issue.
* * Some code bodily lifted from JFFS2.
*/
+const char *yaffs_fs_c_version = "$Id: yaffs_fs.c,v 1.16 2002-09-27 20:50:50 charles Exp $";
+
#include <linux/config.h>
#include <linux/kernel.h>
#include <linux/module.h>
yaffs_Device *dev;
T((KERN_DEBUG"yaffs_readpage at %08x, size %08x\n",
- pg->index << PAGE_CACHE_SHIFT, PAGE_CACHE_SIZE));
+ (unsigned)(pg->index << PAGE_CACHE_SHIFT), (unsigned)PAGE_CACHE_SIZE));
obj = yaffs_DentryToObject(f->f_dentry);
int nWritten;
unsigned spos = pos;
- unsigned saddr = addr;
+ unsigned saddr = (unsigned)addr;
T((KERN_DEBUG"yaffs_commit_write addr %x pos %x nBytes %d\n",saddr,spos,nBytes));
inode->i_size = ipos;
inode->i_blocks = (ipos + inode->i_blksize - 1)/ inode->i_blksize;
- T((KERN_DEBUG"yaffs_file_write size updated to %d bytes, %d blocks\n",ipos,inode->i_blocks));
+ T((KERN_DEBUG"yaffs_file_write size updated to %d bytes, %d blocks\n",ipos,(int)(inode->i_blocks)));
}
}
/*
* File creation. Allocate an inode, and we're done..
*/
-static int yaffs_mknod(struct inode *dir, struct dentry *dentry, int mode, int dev)
+static int yaffs_mknod(struct inode *dir, struct dentry *dentry, int mode, int rdev)
{
struct inode *inode;
}
T(("yaffs_mknod: making oject for %s, mode %x dev %x\n",
- dentry->d_name.name, mode,dev));
+ dentry->d_name.name, mode,rdev));
dev = parent->myDev;
default:
// Special (socket, fifo, device...)
T((KERN_DEBUG"yaffs_mknod: making special\n"));
- obj = yaffs_MknodSpecial(parent,dentry->d_name.name,mode,current->uid, current->gid,dev);
+ obj = yaffs_MknodSpecial(parent,dentry->d_name.name,mode,current->uid, current->gid,rdev);
break;
case S_IFREG: // file
T((KERN_DEBUG"yaffs_mknod: making file\n"));
if(obj)
{
- inode = yaffs_get_inode(dir->i_sb, mode, dev, obj);
+ inode = yaffs_get_inode(dir->i_sb, mode, rdev, obj);
d_instantiate(dentry, inode);
T((KERN_DEBUG"yaffs_mknod created object %d count = %d\n",obj->objectId,atomic_read(&inode->i_count)));
error = 0;
yaffs_Device *dev;
- T((KERN_DEBUG"yaffs_unlink %d:%s\n",dir->i_ino,dentry->d_name.name));
+ T((KERN_DEBUG"yaffs_unlink %d:%s\n",(int)(dir->i_ino),dentry->d_name.name));
dev = yaffs_InodeToObject(dir)->myDev;
yaffs_GrossLock(dev);
- nlinks =
retVal = yaffs_Unlink(yaffs_InodeToObject(dir),dentry->d_name.name);
yaffs_GrossLock(dev);
+
retVal = yaffs_RenameObject(yaffs_InodeToObject(old_dir),old_dentry->d_name.name,
yaffs_InodeToObject(new_dir),new_dentry->d_name.name);
yaffs_GrossUnlock(dev);
sb->s_blocksize = PAGE_CACHE_SIZE;
sb->s_blocksize_bits = PAGE_CACHE_SHIFT;
#endif
- T(("yaffs_read_super: %s block size %d\n", useRam ? "RAM" : "MTD",sb->s_blocksize));
+ T(("yaffs_read_super: %s block size %d\n", useRam ? "RAM" : "MTD",(int)(sb->s_blocksize)));
#ifdef CONFIG_YAFFS_DISABLE_WRITE_VERIFY
T(("yaffs: Write verification disabled. All guarantees null and void\n");
return NULL;
}
- printk(KERN_DEBUG" erase %x\n",mtd->erase);
- printk(KERN_DEBUG" read %x\n",mtd->read);
- printk(KERN_DEBUG" write %x\n",mtd->write);
- printk(KERN_DEBUG" readoob %x\n",mtd->read_oob);
- printk(KERN_DEBUG" writeoob %x\n",mtd->write_oob);
- printk(KERN_DEBUG" oobblock %x\n",mtd->oobblock);
- printk(KERN_DEBUG" oobsize %x\n",mtd->oobsize);
+ //printk(KERN_DEBUG" erase %x\n",mtd->erase);
+ //printk(KERN_DEBUG" read %x\n",mtd->read);
+ //printk(KERN_DEBUG" write %x\n",mtd->write);
+ //printk(KERN_DEBUG" readoob %x\n",mtd->read_oob);
+ //printk(KERN_DEBUG" writeoob %x\n",mtd->write_oob);
+ //printk(KERN_DEBUG" oobblock %x\n",mtd->oobblock);
+ //printk(KERN_DEBUG" oobsize %x\n",mtd->oobsize);
if(!mtd->erase ||
buf +=sprintf(buf,"garbageCollections. %d\n",dev->garbageCollections);
buf +=sprintf(buf,"nRetriedWrites..... %d\n",dev->nRetriedWrites);
buf +=sprintf(buf,"nRetireBlocks...... %d\n",dev->nRetiredBlocks);
+ buf +=sprintf(buf,"eccFixed........... %d\n",dev->eccFixed);
+ buf +=sprintf(buf,"eccUnfixed......... %d\n",dev->eccUnfixed);
+ buf +=sprintf(buf,"tagsEccFixed....... %d\n",dev->tagsEccFixed);
+ buf +=sprintf(buf,"tagsEccUnfixed..... %d\n",dev->tagsEccUnfixed);
buf +=sprintf(buf,"cacheHits.......... %d\n",dev->cacheHits);
buf +=sprintf(buf,"nDeletedFiles...... %d\n",dev->nDeletedFiles);
buf +=sprintf(buf,"nUnlinkedFiles..... %d\n",dev->nUnlinkedFiles);
}
#ifdef CONFIG_YAFFS_RAM_ENABLED
-
+#if 0
my_proc_ram_write_entry = create_proc_entry("yaffs_ram",
S_IRUGO | S_IFREG,
&proc_root);
{
my_proc_ram_write_entry->write_proc = yaffs_proc_ram_write;
}
+#endif
+
error = register_filesystem(&yaffs_ram_fs_type);
if(error)
{