mtd/fs/jffs2/ecos/src fs-ecos.c,1.7,1.8

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


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

Modified Files:
	fs-ecos.c 
Log Message:
Mode conversion bits. Oh and don't create new files by default with mode
0644, which is S_ISMQ|S_ISBLK|S_ISSHM|S_IRUSR in eCos. Doh.


Index: fs-ecos.c
===================================================================
RCS file: /home/cvs/mtd/fs/jffs2/ecos/src/fs-ecos.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- fs-ecos.c	19 Jan 2003 11:33:31 -0000	1.7
+++ fs-ecos.c	21 Jan 2003 18:13:01 -0000	1.8
@@ -19,6 +19,7 @@
 #include <linux/jffs2.h>
 #include <linux/jffs2_fs_sb.h>
 #include <linux/jffs2_fs_i.h>
+#include <linux/pagemap.h>
 #include "nodelist.h"
 
 #include <errno.h>
@@ -659,7 +660,7 @@
 			this.len = hashname - (const char *) this.name;
 			this.hash = end_name_hash(hash);
 
-			err = jffs2_create(ds.dir, &this, 0644, &node);
+			err = jffs2_create(ds.dir, &this, S_IRUGO|S_IXUGO|S_IWUSR|S_IFREG, &node);
 
 			if (err != 0) {
 				//Possible orphaned inode on the flash - but will be gc'd
@@ -1990,7 +1991,7 @@
 	memset(ri, 0, sizeof(*ri));
 	/* Set OS-specific defaults for new inodes */
 	ri->uid = ri->gid = cpu_to_je16(0);
-	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);
@@ -1999,7 +2000,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 = cyg_timestamp();
@@ -2034,7 +2035,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);





More information about the linux-mtd-cvs mailing list