mtd/fs/jffs2 background.c,1.34,1.35 erase.c,1.48,1.49 file.c,1.82,1.83 fs.c,1.22,1.23 gc.c,1.97,1.98 nodelist.c,1.74,1.75 nodemgmt.c,1.90,1.91 readinode.c,1.100,1.101 super-v24.c,1.63,1.64 super.c,1.75,1.76 wbuf.c,1.23,1.24 write.c,1.64,1.65

David Woodhouse dwmw2 at infradead.org
Tue Jan 21 13:11:32 EST 2003


Update of /home/cvs/mtd/fs/jffs2
In directory phoenix.infradead.org:/tmp/cvs-serv734

Modified Files:
	background.c erase.c file.c fs.c gc.c nodelist.c nodemgmt.c 
	readinode.c super-v24.c super.c wbuf.c write.c 
Log Message:
header cleanups, mode_t conversion

Index: background.c
===================================================================
RCS file: /home/cvs/mtd/fs/jffs2/background.c,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -r1.34 -r1.35
--- background.c	14 Jan 2003 14:54:31 -0000	1.34
+++ background.c	21 Jan 2003 18:11:28 -0000	1.35
@@ -16,7 +16,6 @@
 #include <linux/kernel.h>
 #include <linux/jffs2.h>
 #include <linux/mtd/mtd.h>
-#include <linux/interrupt.h>
 #include <linux/completion.h>
 #include <linux/mtd/compatmac.h> /* recalc_sigpending() */
 #include <linux/unistd.h>

Index: erase.c
===================================================================
RCS file: /home/cvs/mtd/fs/jffs2/erase.c,v
retrieving revision 1.48
retrieving revision 1.49
diff -u -r1.48 -r1.49
--- erase.c	14 Jan 2003 14:54:31 -0000	1.48
+++ erase.c	21 Jan 2003 18:11:28 -0000	1.49
@@ -14,10 +14,10 @@
 #include <linux/kernel.h>
 #include <linux/slab.h>
 #include <linux/mtd/mtd.h>
-#include <linux/interrupt.h>
 #include <linux/compiler.h>
 #include <linux/crc32.h>
 #include <linux/sched.h>
+#include <linux/pagemap.h>
 #include "nodelist.h"
 
 struct erase_priv_struct {

Index: file.c
===================================================================
RCS file: /home/cvs/mtd/fs/jffs2/file.c,v
retrieving revision 1.82
retrieving revision 1.83
diff -u -r1.82 -r1.83
--- file.c	14 Jan 2003 14:06:22 -0000	1.82
+++ file.c	21 Jan 2003 18:11:28 -0000	1.83
@@ -153,11 +153,11 @@
 	if (ivalid & ATTR_MODE)
 		if (iattr->ia_mode & S_ISGID &&
 		    !in_group_p(je16_to_cpu(ri->gid)) && !capable(CAP_FSETID))
-			ri->mode = cpu_to_je32(iattr->ia_mode & ~S_ISGID);
+			ri->mode = cpu_to_jemode(iattr->ia_mode & ~S_ISGID);
 		else 
-			ri->mode = cpu_to_je32(iattr->ia_mode);
+			ri->mode = cpu_to_jemode(iattr->ia_mode);
 	else
-		ri->mode = cpu_to_je32(inode->i_mode);
+		ri->mode = cpu_to_jemode(inode->i_mode);
 
 
 	ri->isize = cpu_to_je32((ivalid & ATTR_SIZE)?iattr->ia_size:inode->i_size);
@@ -194,7 +194,7 @@
 	inode->i_atime = ITIME(je32_to_cpu(ri->atime));
 	inode->i_ctime = ITIME(je32_to_cpu(ri->ctime));
 	inode->i_mtime = ITIME(je32_to_cpu(ri->mtime));
-	inode->i_mode = je32_to_cpu(ri->mode);
+	inode->i_mode = jemode_to_cpu(ri->mode);
 	inode->i_uid = je16_to_cpu(ri->uid);
 	inode->i_gid = je16_to_cpu(ri->gid);
 
@@ -309,7 +309,7 @@
 
 		ri.ino = cpu_to_je32(f->inocache->ino);
 		ri.version = cpu_to_je32(++f->highest_version);
-		ri.mode = cpu_to_je32(inode->i_mode);
+		ri.mode = cpu_to_jemode(inode->i_mode);
 		ri.uid = cpu_to_je16(inode->i_uid);
 		ri.gid = cpu_to_je16(inode->i_gid);
 		ri.isize = cpu_to_je32(max((uint32_t)inode->i_size, pageofs));
@@ -390,7 +390,7 @@
 
 	/* Set the fields that the generic jffs2_write_inode_range() code can't find */
 	ri->ino = cpu_to_je32(inode->i_ino);
-	ri->mode = cpu_to_je32(inode->i_mode);
+	ri->mode = cpu_to_jemode(inode->i_mode);
 	ri->uid = cpu_to_je16(inode->i_uid);
 	ri->gid = cpu_to_je16(inode->i_gid);
 	ri->isize = cpu_to_je32((uint32_t)inode->i_size);

Index: fs.c
===================================================================
RCS file: /home/cvs/mtd/fs/jffs2/fs.c,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -r1.22 -r1.23
--- fs.c	14 Jan 2003 14:54:31 -0000	1.22
+++ fs.c	21 Jan 2003 18:11:28 -0000	1.23
@@ -16,7 +16,6 @@
 #include <linux/sched.h>
 #include <linux/fs.h>
 #include <linux/list.h>
-#include <linux/interrupt.h>
 #include <linux/mtd/mtd.h>
 #include <linux/pagemap.h>
 #include <linux/slab.h>
@@ -87,7 +86,7 @@
 		up(&f->sem);
 		return;
 	}
-	inode->i_mode = je32_to_cpu(latest_node.mode);
+	inode->i_mode = jemode_to_cpu(latest_node.mode);
 	inode->i_uid = je16_to_cpu(latest_node.uid);
 	inode->i_gid = je16_to_cpu(latest_node.gid);
 	inode->i_size = je32_to_cpu(latest_node.isize);
@@ -229,7 +228,7 @@
 	} else {
 		ri->gid = cpu_to_je16(current->fsgid);
 	}
-	ri->mode =  cpu_to_je32(mode);
+	ri->mode =  cpu_to_jemode(mode);
 	ret = jffs2_do_new_inode (c, f, mode, ri);
 	if (ret) {
 		make_bad_inode(inode);
@@ -238,7 +237,7 @@
 	}
 	inode->i_nlink = 1;
 	inode->i_ino = je32_to_cpu(ri->ino);
-	inode->i_mode = je32_to_cpu(ri->mode);
+	inode->i_mode = jemode_to_cpu(ri->mode);
 	inode->i_gid = je16_to_cpu(ri->gid);
 	inode->i_uid = je16_to_cpu(ri->uid);
 	inode->i_atime = inode->i_ctime = inode->i_mtime = CURRENT_TIME;

Index: gc.c
===================================================================
RCS file: /home/cvs/mtd/fs/jffs2/gc.c,v
retrieving revision 1.97
retrieving revision 1.98
diff -u -r1.97 -r1.98
--- gc.c	19 Jan 2003 17:09:13 -0000	1.97
+++ gc.c	21 Jan 2003 18:11:28 -0000	1.98
@@ -14,7 +14,6 @@
 #include <linux/kernel.h>
 #include <linux/mtd/mtd.h>
 #include <linux/slab.h>
-#include <linux/interrupt.h>
 #include <linux/pagemap.h>
 #include <linux/crc32.h>
 #include <linux/compiler.h>
@@ -611,7 +610,7 @@
 
 	ri.ino = cpu_to_je32(f->inocache->ino);
 	ri.version = cpu_to_je32(++f->highest_version);
-	ri.mode = cpu_to_je32(JFFS2_F_I_MODE(f));
+	ri.mode = cpu_to_jemode(JFFS2_F_I_MODE(f));
 	ri.uid = cpu_to_je16(JFFS2_F_I_UID(f));
 	ri.gid = cpu_to_je16(JFFS2_F_I_GID(f));
 	ri.isize = cpu_to_je32(JFFS2_F_I_SIZE(f));
@@ -876,7 +875,7 @@
 		ri.csize = cpu_to_je32(0);
 		ri.compr = JFFS2_COMPR_ZERO;
 	}
-	ri.mode = cpu_to_je32(JFFS2_F_I_MODE(f));
+	ri.mode = cpu_to_jemode(JFFS2_F_I_MODE(f));
 	ri.uid = cpu_to_je16(JFFS2_F_I_UID(f));
 	ri.gid = cpu_to_je16(JFFS2_F_I_GID(f));
 	ri.isize = cpu_to_je32(JFFS2_F_I_SIZE(f));
@@ -1041,7 +1040,7 @@
 
 		ri.ino = cpu_to_je32(f->inocache->ino);
 		ri.version = cpu_to_je32(++f->highest_version);
-		ri.mode = cpu_to_je32(JFFS2_F_I_MODE(f));
+		ri.mode = cpu_to_jemode(JFFS2_F_I_MODE(f));
 		ri.uid = cpu_to_je16(JFFS2_F_I_UID(f));
 		ri.gid = cpu_to_je16(JFFS2_F_I_GID(f));
 		ri.isize = cpu_to_je32(JFFS2_F_I_SIZE(f));

Index: nodelist.c
===================================================================
RCS file: /home/cvs/mtd/fs/jffs2/nodelist.c,v
retrieving revision 1.74
retrieving revision 1.75
diff -u -r1.74 -r1.75
--- nodelist.c	17 Jan 2003 16:04:16 -0000	1.74
+++ nodelist.c	21 Jan 2003 18:11:28 -0000	1.75
@@ -15,7 +15,6 @@
 #include <linux/sched.h>
 #include <linux/fs.h>
 #include <linux/mtd/mtd.h>
-#include <linux/interrupt.h>
 #include <linux/rbtree.h>
 #include <linux/crc32.h>
 #include <linux/slab.h>

Index: nodemgmt.c
===================================================================
RCS file: /home/cvs/mtd/fs/jffs2/nodemgmt.c,v
retrieving revision 1.90
retrieving revision 1.91
diff -u -r1.90 -r1.91
--- nodemgmt.c	18 Jan 2003 00:27:43 -0000	1.90
+++ nodemgmt.c	21 Jan 2003 18:11:28 -0000	1.91
@@ -14,7 +14,6 @@
 #include <linux/kernel.h>
 #include <linux/slab.h>
 #include <linux/mtd/mtd.h>
-#include <linux/interrupt.h>
 #include <linux/compiler.h>
 #include <linux/sched.h> /* For cond_resched() */
 #include "nodelist.h"

Index: readinode.c
===================================================================
RCS file: /home/cvs/mtd/fs/jffs2/readinode.c,v
retrieving revision 1.100
retrieving revision 1.101
diff -u -r1.100 -r1.101
--- readinode.c	18 Jan 2003 21:10:14 -0000	1.100
+++ readinode.c	21 Jan 2003 18:11:29 -0000	1.101
@@ -17,7 +17,6 @@
 #include <linux/crc32.h>
 #include <linux/pagemap.h>
 #include <linux/mtd/mtd.h>
-#include <linux/interrupt.h>
 #include <linux/compiler.h>
 #include "nodelist.h"
 
@@ -431,7 +430,7 @@
 			}
 			printk(KERN_WARNING "jffs2_do_read_inode(): But it has children so we fake some modes for it\n");
 		}
-		latest_node->mode = cpu_to_je32(S_IFDIR|S_IRUGO|S_IWUSR|S_IXUGO);
+		latest_node->mode = cpu_to_jemode(S_IFDIR|S_IRUGO|S_IWUSR|S_IXUGO);
 		latest_node->version = cpu_to_je32(0);
 		latest_node->atime = latest_node->ctime = latest_node->mtime = cpu_to_je32(0);
 		latest_node->isize = cpu_to_je32(0);
@@ -459,7 +458,7 @@
 		return -EIO;
 	}
 
-	switch(je32_to_cpu(latest_node->mode) & S_IFMT) {
+	switch(jemode_to_cpu(latest_node->mode) & S_IFMT) {
 	case S_IFDIR:
 		if (mctime_ver > je32_to_cpu(latest_node->version)) {
 			/* The times in the latest_node are actually older than
@@ -488,20 +487,23 @@
 		/* Xertain inode types should have only one data node, and it's
 		   kept as the metadata node */
 		if (f->metadata) {
-			printk(KERN_WARNING "Argh. Special inode #%u with mode 0%o had metadata node\n", ino, je32_to_cpu(latest_node->mode));
+			printk(KERN_WARNING "Argh. Special inode #%u with mode 0%o had metadata node\n",
+			       ino, jemode_to_cpu(latest_node->mode));
 			up(&f->sem);
 			jffs2_do_clear_inode(c, f);
 			return -EIO;
 		}
 		if (!frag_first(&f->fragtree)) {
-			printk(KERN_WARNING "Argh. Special inode #%u with mode 0%o has no fragments\n", ino, je32_to_cpu(latest_node->mode));
+			printk(KERN_WARNING "Argh. Special inode #%u with mode 0%o has no fragments\n",
+			       ino, jemode_to_cpu(latest_node->mode));
 			up(&f->sem);
 			jffs2_do_clear_inode(c, f);
 			return -EIO;
 		}
 		/* ASSERT: f->fraglist != NULL */
 		if (frag_next(frag_first(&f->fragtree))) {
-			printk(KERN_WARNING "Argh. Special inode #%u with mode 0%o had more than one node\n", ino, je32_to_cpu(latest_node->mode));
+			printk(KERN_WARNING "Argh. Special inode #%u with mode 0x%x had more than one node\n",
+			       ino, jemode_to_cpu(latest_node->mode));
 			/* FIXME: Deal with it - check crc32, check for duplicate node, check times and discard the older one */
 			up(&f->sem);
 			jffs2_do_clear_inode(c, f);

Index: super-v24.c
===================================================================
RCS file: /home/cvs/mtd/fs/jffs2/super-v24.c,v
retrieving revision 1.63
retrieving revision 1.64
diff -u -r1.63 -r1.64
--- super-v24.c	20 May 2002 14:56:39 -0000	1.63
+++ super-v24.c	21 Jan 2003 18:11:29 -0000	1.64
@@ -22,7 +22,6 @@
 #include <linux/jffs2.h>
 #include <linux/pagemap.h>
 #include <linux/mtd/mtd.h>
-#include <linux/interrupt.h>
 #include "nodelist.h"
 
 #ifndef MTD_BLOCK_MAJOR

Index: super.c
===================================================================
RCS file: /home/cvs/mtd/fs/jffs2/super.c,v
retrieving revision 1.75
retrieving revision 1.76
diff -u -r1.75 -r1.76
--- super.c	14 Jan 2003 14:06:22 -0000	1.75
+++ super.c	21 Jan 2003 18:11:29 -0000	1.76
@@ -23,7 +23,6 @@
 #include <linux/jffs2.h>
 #include <linux/pagemap.h>
 #include <linux/mtd/mtd.h>
-#include <linux/interrupt.h>
 #include <linux/ctype.h>
 #include <linux/namei.h>
 #include "nodelist.h"

Index: wbuf.c
===================================================================
RCS file: /home/cvs/mtd/fs/jffs2/wbuf.c,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -r1.23 -r1.24
--- wbuf.c	14 Jan 2003 14:54:32 -0000	1.23
+++ wbuf.c	21 Jan 2003 18:11:29 -0000	1.24
@@ -14,7 +14,6 @@
 #include <linux/kernel.h>
 #include <linux/slab.h>
 #include <linux/mtd/mtd.h>
-#include <linux/interrupt.h>
 #include <linux/crc32.h>
 #include <linux/mtd/nand.h>
 #include "nodelist.h"

Index: write.c
===================================================================
RCS file: /home/cvs/mtd/fs/jffs2/write.c,v
retrieving revision 1.64
retrieving revision 1.65
diff -u -r1.64 -r1.65
--- write.c	18 Jan 2003 01:28:04 -0000	1.64
+++ write.c	21 Jan 2003 18:11:29 -0000	1.65
@@ -47,7 +47,7 @@
 	ri->nodetype = cpu_to_je16(JFFS2_NODETYPE_INODE);
 	ri->totlen = cpu_to_je32(PAD(sizeof(*ri)));
 	ri->hdr_crc = cpu_to_je32(crc32(0, ri, sizeof(struct jffs2_unknown_node)-4));
-	ri->mode = cpu_to_je32(mode);
+	ri->mode = cpu_to_jemode(mode);
 
 	f->highest_version = 1;
 	ri->version = cpu_to_je32(f->highest_version);
@@ -400,7 +400,7 @@
 	fn = jffs2_write_dnode(c, f, ri, NULL, 0, phys_ofs, &writtenlen);
 
 	D1(printk(KERN_DEBUG "jffs2_do_create created file with mode 0x%x\n",
-		  je32_to_cpu(ri->mode)));
+		  jemode_to_cpu(ri->mode)));
 
 	if (IS_ERR(fn)) {
 		D1(printk(KERN_DEBUG "jffs2_write_dnode() failed\n"));





More information about the linux-mtd-cvs mailing list