Fixes for 2.6 special inodes
authorcharles <charles>
Sun, 24 Apr 2005 08:54:36 +0000 (08:54 +0000)
committercharles <charles>
Sun, 24 Apr 2005 08:54:36 +0000 (08:54 +0000)
yaffs_fs.c
yaffs_guts.c

index e06b080..86a2559 100644 (file)
@@ -29,7 +29,7 @@
  */
 
 
-const char *yaffs_fs_c_version = "$Id: yaffs_fs.c,v 1.38 2005-04-05 03:49:16 charles Exp $";
+const char *yaffs_fs_c_version = "$Id: yaffs_fs.c,v 1.39 2005-04-24 08:54:36 charles Exp $";
 extern const char *yaffs_guts_c_version;
 
 
@@ -640,7 +640,11 @@ static void yaffs_FillInodeFromObject(struct inode *inode, yaffs_Object *obj)
                switch (obj->st_mode & S_IFMT) 
                {
                        default: // fifo, device or socket
-                               init_special_inode(inode, obj->st_mode,(dev_t)(obj->st_rdev));
+#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0))
+                               init_special_inode(inode, obj->st_mode,old_decode_dev(obj->st_rdev));
+#else
+                                 init_special_inode(inode, obj->st_mode,(dev_t)(obj->st_rdev));
+#endif
                                break;
                        case S_IFREG:   // file         
                                inode->i_op = &yaffs_file_inode_operations;
@@ -904,7 +908,11 @@ static int yaffs_mknod(struct inode *dir, struct dentry *dentry, int mode, int r
                default:
                        // Special (socket, fifo, device...)
                        T(YAFFS_TRACE_OS,("yaffs_mknod: making special\n"));
-                       obj = yaffs_MknodSpecial(parent,dentry->d_name.name,mode,current->uid, current->gid,rdev);
+#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0))
+                        obj = yaffs_MknodSpecial(parent,dentry->d_name.name,mode,current->uid, current->gid,old_encode_dev(rdev));
+#else
+                        obj = yaffs_MknodSpecial(parent,dentry->d_name.name,mode,current->uid, current->gid,rdev);
+#endif
                        break;
                case S_IFREG:   // file         
                        T(YAFFS_TRACE_OS,("yaffs_mknod: making file\n"));
@@ -1714,3 +1722,4 @@ MODULE_DESCRIPTION("YAFFS - a NAND specific flash file system");
 MODULE_AUTHOR("Charles Manning, Aleph One Ltd., 2002");
 MODULE_LICENSE("GPL");
 
+
index 87fa7a9..e4a61c0 100644 (file)
@@ -14,7 +14,7 @@
  */
  //yaffs_guts.c
 
-const char *yaffs_guts_c_version="$Id: yaffs_guts.c,v 1.40 2005-04-05 03:45:40 charles Exp $";
+const char *yaffs_guts_c_version="$Id: yaffs_guts.c,v 1.41 2005-04-24 08:54:36 charles Exp $";
 
 #include "yportenv.h"
 
@@ -1828,7 +1828,7 @@ yaffs_Object *yaffs_MknodDirectory(yaffs_Object *parent,const char *name, __u32
 
 yaffs_Object *yaffs_MknodSpecial(yaffs_Object *parent,const char *name, __u32 mode, __u32 uid, __u32 gid, __u32 rdev)
 {
-       return yaffs_MknodObject(YAFFS_OBJECT_TYPE_DIRECTORY,parent,name,mode,uid,gid,NULL,NULL,rdev);
+       return yaffs_MknodObject(YAFFS_OBJECT_TYPE_SPECIAL,parent,name,mode,uid,gid,NULL,NULL,rdev);
 }
 
 yaffs_Object *yaffs_MknodSymLink(yaffs_Object *parent,const char *name, __u32 mode, __u32 uid, __u32 gid,const char *alias)
@@ -3975,6 +3975,9 @@ static int yaffs_UnlinkWorker(yaffs_Object *obj)
                        case YAFFS_OBJECT_TYPE_SYMLINK:
                                return yaffs_DeleteSymLink(obj);
                                break;
+                       case YAFFS_OBJECT_TYPE_SPECIAL:
+                               return yaffs_DoGenericObjectDeletion(obj);
+                               break;
                        case YAFFS_OBJECT_TYPE_HARDLINK:
                        case YAFFS_OBJECT_TYPE_UNKNOWN:
                        default:
@@ -5018,3 +5021,4 @@ void yaffs_GutsTest(yaffs_Device *dev)
 
 
 
+