aboutsummaryrefslogtreecommitdiffstats
path: root/fs/jffs
diff options
context:
space:
mode:
authorDavid Woodhouse <dwmw2@infradead.org>2007-01-17 18:34:51 -0500
committerDavid Woodhouse <dwmw2@infradead.org>2007-01-17 18:34:51 -0500
commit9cdf083f981b8d37b3212400a359368661385099 (patch)
treeaa15a6a08ad87e650dea40fb59b3180bef0d345b /fs/jffs
parente499e01d234a31d59679b7b1e1cf628d917ba49a (diff)
parenta8b3485287731978899ced11f24628c927890e78 (diff)
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
Diffstat (limited to 'fs/jffs')
-rw-r--r--fs/jffs/inode-v23.c14
-rw-r--r--fs/jffs/intrep.c18
-rw-r--r--fs/jffs/jffs_fm.c4
3 files changed, 18 insertions, 18 deletions
diff --git a/fs/jffs/inode-v23.c b/fs/jffs/inode-v23.c
index 3f7899ea4cba..43baa1afa021 100644
--- a/fs/jffs/inode-v23.c
+++ b/fs/jffs/inode-v23.c
@@ -61,8 +61,8 @@ static const struct file_operations jffs_dir_operations;
61static struct inode_operations jffs_dir_inode_operations; 61static struct inode_operations jffs_dir_inode_operations;
62static const struct address_space_operations jffs_address_operations; 62static const struct address_space_operations jffs_address_operations;
63 63
64kmem_cache_t *node_cache = NULL; 64struct kmem_cache *node_cache = NULL;
65kmem_cache_t *fm_cache = NULL; 65struct kmem_cache *fm_cache = NULL;
66 66
67/* Called by the VFS at mount time to initialize the whole file system. */ 67/* Called by the VFS at mount time to initialize the whole file system. */
68static int jffs_fill_super(struct super_block *sb, void *data, int silent) 68static int jffs_fill_super(struct super_block *sb, void *data, int silent)
@@ -566,7 +566,7 @@ static int
566jffs_readdir(struct file *filp, void *dirent, filldir_t filldir) 566jffs_readdir(struct file *filp, void *dirent, filldir_t filldir)
567{ 567{
568 struct jffs_file *f; 568 struct jffs_file *f;
569 struct dentry *dentry = filp->f_dentry; 569 struct dentry *dentry = filp->f_path.dentry;
570 struct inode *inode = dentry->d_inode; 570 struct inode *inode = dentry->d_inode;
571 struct jffs_control *c = (struct jffs_control *)inode->i_sb->s_fs_info; 571 struct jffs_control *c = (struct jffs_control *)inode->i_sb->s_fs_info;
572 int j; 572 int j;
@@ -818,7 +818,7 @@ jffs_mkdir(struct inode *dir, struct dentry *dentry, int mode)
818 818
819 D1({ 819 D1({
820 int len = dentry->d_name.len; 820 int len = dentry->d_name.len;
821 char *_name = (char *) kmalloc(len + 1, GFP_KERNEL); 821 char *_name = kmalloc(len + 1, GFP_KERNEL);
822 memcpy(_name, dentry->d_name.name, len); 822 memcpy(_name, dentry->d_name.name, len);
823 _name[len] = '\0'; 823 _name[len] = '\0';
824 printk("***jffs_mkdir(): dir = 0x%p, name = \"%s\", " 824 printk("***jffs_mkdir(): dir = 0x%p, name = \"%s\", "
@@ -964,7 +964,7 @@ jffs_remove(struct inode *dir, struct dentry *dentry, int type)
964 D1({ 964 D1({
965 int len = dentry->d_name.len; 965 int len = dentry->d_name.len;
966 const char *name = dentry->d_name.name; 966 const char *name = dentry->d_name.name;
967 char *_name = (char *) kmalloc(len + 1, GFP_KERNEL); 967 char *_name = kmalloc(len + 1, GFP_KERNEL);
968 memcpy(_name, name, len); 968 memcpy(_name, name, len);
969 _name[len] = '\0'; 969 _name[len] = '\0';
970 printk("***jffs_remove(): file = \"%s\", ino = %ld\n", _name, dentry->d_inode->i_ino); 970 printk("***jffs_remove(): file = \"%s\", ino = %ld\n", _name, dentry->d_inode->i_ino);
@@ -1372,7 +1372,7 @@ jffs_file_write(struct file *filp, const char *buf, size_t count,
1372 struct jffs_control *c; 1372 struct jffs_control *c;
1373 struct jffs_file *f; 1373 struct jffs_file *f;
1374 struct jffs_node *node; 1374 struct jffs_node *node;
1375 struct dentry *dentry = filp->f_dentry; 1375 struct dentry *dentry = filp->f_path.dentry;
1376 struct inode *inode = dentry->d_inode; 1376 struct inode *inode = dentry->d_inode;
1377 int recoverable = 0; 1377 int recoverable = 0;
1378 size_t written = 0; 1378 size_t written = 0;
@@ -1380,7 +1380,7 @@ jffs_file_write(struct file *filp, const char *buf, size_t count,
1380 loff_t pos = *ppos; 1380 loff_t pos = *ppos;
1381 int err; 1381 int err;
1382 1382
1383 inode = filp->f_dentry->d_inode; 1383 inode = filp->f_path.dentry->d_inode;
1384 1384
1385 D2(printk("***jffs_file_write(): inode: 0x%p (ino: %lu), " 1385 D2(printk("***jffs_file_write(): inode: 0x%p (ino: %lu), "
1386 "filp: 0x%p, buf: 0x%p, count: %d\n", 1386 "filp: 0x%p, buf: 0x%p, count: %d\n",
diff --git a/fs/jffs/intrep.c b/fs/jffs/intrep.c
index 4a543e114970..6dd18911b44c 100644
--- a/fs/jffs/intrep.c
+++ b/fs/jffs/intrep.c
@@ -66,6 +66,7 @@
66#include <linux/smp_lock.h> 66#include <linux/smp_lock.h>
67#include <linux/time.h> 67#include <linux/time.h>
68#include <linux/ctype.h> 68#include <linux/ctype.h>
69#include <linux/freezer.h>
69 70
70#include "intrep.h" 71#include "intrep.h"
71#include "jffs_fm.h" 72#include "jffs_fm.h"
@@ -435,7 +436,7 @@ jffs_checksum_flash(struct mtd_info *mtd, loff_t start, int size, __u32 *result)
435 int i, length; 436 int i, length;
436 437
437 /* Allocate read buffer */ 438 /* Allocate read buffer */
438 read_buf = (__u8 *) kmalloc (sizeof(__u8) * 4096, GFP_KERNEL); 439 read_buf = kmalloc(sizeof(__u8) * 4096, GFP_KERNEL);
439 if (!read_buf) { 440 if (!read_buf) {
440 printk(KERN_NOTICE "kmalloc failed in jffs_checksum_flash()\n"); 441 printk(KERN_NOTICE "kmalloc failed in jffs_checksum_flash()\n");
441 return -ENOMEM; 442 return -ENOMEM;
@@ -591,7 +592,7 @@ jffs_add_virtual_root(struct jffs_control *c)
591 D2(printk("jffs_add_virtual_root(): " 592 D2(printk("jffs_add_virtual_root(): "
592 "Creating a virtual root directory.\n")); 593 "Creating a virtual root directory.\n"));
593 594
594 if (!(root = kmalloc(sizeof(struct jffs_file), GFP_KERNEL))) { 595 if (!(root = kzalloc(sizeof(struct jffs_file), GFP_KERNEL))) {
595 return -ENOMEM; 596 return -ENOMEM;
596 } 597 }
597 no_jffs_file++; 598 no_jffs_file++;
@@ -603,7 +604,6 @@ jffs_add_virtual_root(struct jffs_control *c)
603 DJM(no_jffs_node++); 604 DJM(no_jffs_node++);
604 memset(node, 0, sizeof(struct jffs_node)); 605 memset(node, 0, sizeof(struct jffs_node));
605 node->ino = JFFS_MIN_INO; 606 node->ino = JFFS_MIN_INO;
606 memset(root, 0, sizeof(struct jffs_file));
607 root->ino = JFFS_MIN_INO; 607 root->ino = JFFS_MIN_INO;
608 root->mode = S_IFDIR | S_IRWXU | S_IRGRP 608 root->mode = S_IFDIR | S_IRWXU | S_IRGRP
609 | S_IXGRP | S_IROTH | S_IXOTH; 609 | S_IXGRP | S_IROTH | S_IXOTH;
@@ -744,11 +744,11 @@ static int check_partly_erased_sectors(struct jffs_fmcontrol *fmc){
744 744
745 745
746 /* Allocate read buffers */ 746 /* Allocate read buffers */
747 read_buf1 = (__u8 *) kmalloc (sizeof(__u8) * READ_AHEAD_BYTES, GFP_KERNEL); 747 read_buf1 = kmalloc(sizeof(__u8) * READ_AHEAD_BYTES, GFP_KERNEL);
748 if (!read_buf1) 748 if (!read_buf1)
749 return -ENOMEM; 749 return -ENOMEM;
750 750
751 read_buf2 = (__u8 *) kmalloc (sizeof(__u8) * READ_AHEAD_BYTES, GFP_KERNEL); 751 read_buf2 = kmalloc(sizeof(__u8) * READ_AHEAD_BYTES, GFP_KERNEL);
752 if (!read_buf2) { 752 if (!read_buf2) {
753 kfree(read_buf1); 753 kfree(read_buf1);
754 return -ENOMEM; 754 return -ENOMEM;
@@ -876,7 +876,7 @@ jffs_scan_flash(struct jffs_control *c)
876 } 876 }
877 877
878 /* Allocate read buffer */ 878 /* Allocate read buffer */
879 read_buf = (__u8 *) kmalloc (sizeof(__u8) * 4096, GFP_KERNEL); 879 read_buf = kmalloc(sizeof(__u8) * 4096, GFP_KERNEL);
880 if (!read_buf) { 880 if (!read_buf) {
881 flash_safe_release(fmc->mtd); 881 flash_safe_release(fmc->mtd);
882 return -ENOMEM; 882 return -ENOMEM;
@@ -1463,7 +1463,7 @@ jffs_insert_node(struct jffs_control *c, struct jffs_file *f,
1463 kfree(f->name); 1463 kfree(f->name);
1464 DJM(no_name--); 1464 DJM(no_name--);
1465 } 1465 }
1466 if (!(f->name = (char *) kmalloc(raw_inode->nsize + 1, 1466 if (!(f->name = kmalloc(raw_inode->nsize + 1,
1467 GFP_KERNEL))) { 1467 GFP_KERNEL))) {
1468 return -ENOMEM; 1468 return -ENOMEM;
1469 } 1469 }
@@ -1737,7 +1737,7 @@ jffs_find_child(struct jffs_file *dir, const char *name, int len)
1737 printk("jffs_find_child(): Found \"%s\".\n", f->name); 1737 printk("jffs_find_child(): Found \"%s\".\n", f->name);
1738 } 1738 }
1739 else { 1739 else {
1740 char *copy = (char *) kmalloc(len + 1, GFP_KERNEL); 1740 char *copy = kmalloc(len + 1, GFP_KERNEL);
1741 if (copy) { 1741 if (copy) {
1742 memcpy(copy, name, len); 1742 memcpy(copy, name, len);
1743 copy[len] = '\0'; 1743 copy[len] = '\0';
@@ -2627,7 +2627,7 @@ jffs_print_tree(struct jffs_file *first_file, int indent)
2627 return; 2627 return;
2628 } 2628 }
2629 2629
2630 if (!(space = (char *) kmalloc(indent + 1, GFP_KERNEL))) { 2630 if (!(space = kmalloc(indent + 1, GFP_KERNEL))) {
2631 printk("jffs_print_tree(): Out of memory!\n"); 2631 printk("jffs_print_tree(): Out of memory!\n");
2632 return; 2632 return;
2633 } 2633 }
diff --git a/fs/jffs/jffs_fm.c b/fs/jffs/jffs_fm.c
index 6aab317f56e0..5a95fbdd6fdb 100644
--- a/fs/jffs/jffs_fm.c
+++ b/fs/jffs/jffs_fm.c
@@ -30,8 +30,8 @@ static int jffs_mark_obsolete(struct jffs_fmcontrol *fmc, __u32 fm_offset);
30static struct jffs_fm *jffs_alloc_fm(void); 30static struct jffs_fm *jffs_alloc_fm(void);
31static void jffs_free_fm(struct jffs_fm *n); 31static void jffs_free_fm(struct jffs_fm *n);
32 32
33extern kmem_cache_t *fm_cache; 33extern struct kmem_cache *fm_cache;
34extern kmem_cache_t *node_cache; 34extern struct kmem_cache *node_cache;
35 35
36#if CONFIG_JFFS_FS_VERBOSE > 0 36#if CONFIG_JFFS_FS_VERBOSE > 0
37void 37void