*** empty log message ***
authorcharles <charles>
Sun, 10 Oct 2004 17:54:59 +0000 (17:54 +0000)
committercharles <charles>
Sun, 10 Oct 2004 17:54:59 +0000 (17:54 +0000)
direct/yaffscfg.h
direct/ydirectenv.h
wince/ywinceenv.h
yaffs_guts.c
yaffs_guts.h
yportenv.h

index b8a53b36955f61f46e444d972d143f37ed204385..5031fdd1e387f49c21e72de55ae22910ebe39299 100644 (file)
@@ -8,15 +8,14 @@
 #define __YAFFSCFG_H__
 
 
-
-#include "yaffs_guts.h"
+#include "devextras.h"
 
 #define YAFFSFS_N_HANDLES 200
 
 
 typedef struct {
        const char *prefix;
-       yaffs_Device *dev;
+       struct yaffs_DeviceStruct *dev;
 } yaffsfs_DeviceConfiguration;
 
 
@@ -29,3 +28,4 @@ void yaffsfs_SetError(int err);
 
 #endif
 
+
index 08f4b57c1caf7b42abdaf6306e887e8a551f8759..2478ebc9da513082ccd748ffcb88001a4349a8d4 100644 (file)
@@ -14,7 +14,7 @@
  *
  * Note: Only YAFFS headers are LGPL, YAFFS C code is covered by GPL.
  *
- * $Id: ydirectenv.h,v 1.1 2004-09-19 09:21:38 charles Exp $
+ * $Id: ydirectenv.h,v 1.2 2004-10-10 17:54:59 charles Exp $
  *
  */
  
@@ -23,6 +23,8 @@
 
 // Direct interface
 
+#include "devextras.h"
+
 #include "stdlib.h"
 #include "stdio.h"
 #include "string.h"
@@ -46,7 +48,9 @@
 
 #include "yaffscfg.h"
 
-#define CURRENT_TIME yaffsfs_CurrentTime()
+#define Y_CURRENT_TIME yaffsfs_CurrentTime()
+#define Y_TIME_CONVERT(x) (x)
+
 #define YAFFS_ROOT_MODE                                0666
 #define YAFFS_LOSTNFOUND_MODE          0666
 
@@ -54,3 +58,5 @@
 #define yaffs_strcmp(a,b) strcmp(a,b)
 
 #endif
+
+
index 33fee72e37abc9f944e6bdac2f6d3aba0e1d246c..5366ddf911d318087471dbcd1989aa1ae3dc3f3c 100644 (file)
@@ -14,7 +14,7 @@
  *
  * Note: Only YAFFS headers are LGPL, YAFFS C code is covered by GPL.
  *
- * $Id: ywinceenv.h,v 1.1 2004-09-19 09:21:38 charles Exp $
+ * $Id: ywinceenv.h,v 1.2 2004-10-10 17:54:59 charles Exp $
  *
  */
  
@@ -58,7 +58,9 @@
 
 extern unsigned yfsd_U32FileTimeNow(void);
 
-#define CURRENT_TIME                            yfsd_U32FileTimeNow()
+#define Y_CURRENT_TIME                          yfsd_U32FileTimeNow()
+#define Y_TIME_CONVERT(x) (x)
+
 #define YAFFS_ROOT_MODE                                FILE_ATTRIBUTE_ARCHIVE
 #define YAFFS_LOSTNFOUND_MODE          FILE_ATTRIBUTE_HIDDEN
 
@@ -70,3 +72,4 @@ extern unsigned yfsd_U32FileTimeNow(void);
 #define YBUG() T(YAFFS_TRACE_BUG,(TSTR("==>> yaffs bug: %s %d" TENDSTR),TEXT(__FILE__),__LINE__))
 
 #endif
+
index 4757ff6802ceed1571b8fad2c556522010a454b7..91fb73c598fda9e44ed5052abc06a0ff8de1b38d 100644 (file)
@@ -14,7 +14,7 @@
  */
  //yaffs_guts.c
 
-const char *yaffs_guts_c_version="$Id: yaffs_guts.c,v 1.35 2004-09-21 03:03:12 charles Exp $";
+const char *yaffs_guts_c_version="$Id: yaffs_guts.c,v 1.36 2004-10-10 17:54:59 charles Exp $";
 
 #include "yportenv.h"
 
@@ -1638,12 +1638,8 @@ yaffs_Object *yaffs_CreateNewObject(yaffs_Device *dev,int number,yaffs_ObjectTyp
 
 #else
 
-//#if defined(CONFIG_KERNEL_2_5)
-#if defined(__KERNEL__) && (LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0))
-               theObject->st_atime = theObject->st_mtime =     theObject->st_ctime = CURRENT_TIME.tv_sec;              
-#else
-               theObject->st_atime = theObject->st_mtime =     theObject->st_ctime = CURRENT_TIME;             
-#endif
+               theObject->st_atime = theObject->st_mtime =     theObject->st_ctime = Y_CURRENT_TIME;
+
 #endif
                switch(type)
                {
@@ -1747,12 +1743,8 @@ yaffs_Object *yaffs_MknodObject( yaffs_ObjectType type,
                in->win_ctime[1] = in->win_mtime[1] = in->win_atime[1];
                
 #else
-//#if defined(CONFIG_KERNEL_2_5)
-#if defined(__KERNEL__) && (LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0))
-               in->st_atime = in->st_mtime = in->st_ctime = CURRENT_TIME.tv_sec;
-#else
-               in->st_atime = in->st_mtime = in->st_ctime = CURRENT_TIME;
-#endif
+
+               in->st_atime = in->st_mtime = in->st_ctime = Y_CURRENT_TIME;
                in->st_rdev  = rdev;
                in->st_uid   = uid;
                in->st_gid   = gid;
@@ -3727,12 +3719,7 @@ int yaffs_FlushFile(yaffs_Object *in, int updateTime)
 #ifdef CONFIG_YAFFS_WINCE
                        yfsd_WinFileTimeNow(in->win_mtime);
 #else
-//#if defined(CONFIG_KERNEL_2_5)
-#if defined(__KERNEL__) && (LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0))
-                       in->st_mtime = CURRENT_TIME.tv_sec;
-#else
-                       in->st_mtime = CURRENT_TIME;
-#endif
+                       in->st_mtime = Y_CURRENT_TIME;
 #endif
                }
 
@@ -4586,17 +4573,10 @@ int yaffs_SetAttributes(yaffs_Object *obj, struct iattr *attr)
        if(valid & ATTR_UID) obj->st_uid = attr->ia_uid;
        if(valid & ATTR_GID) obj->st_gid = attr->ia_gid;
        
-//#if defined(CONFIG_KERNEL_2_5)
-#if defined(__KERNEL__) && (LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0))
+       if(valid & ATTR_ATIME) obj->st_atime = Y_TIME_CONVERT(attr->ia_atime);
+       if(valid & ATTR_CTIME) obj->st_ctime = Y_TIME_CONVERT(attr->ia_ctime);
+       if(valid & ATTR_MTIME) obj->st_mtime = Y_TIME_CONVERT(attr->ia_mtime);
 
-       if(valid & ATTR_ATIME) obj->st_atime = attr->ia_atime.tv_sec;
-       if(valid & ATTR_CTIME) obj->st_ctime = attr->ia_ctime.tv_sec;
-       if(valid & ATTR_MTIME) obj->st_mtime = attr->ia_mtime.tv_sec;
-#else
-       if(valid & ATTR_ATIME) obj->st_atime = attr->ia_atime;
-       if(valid & ATTR_CTIME) obj->st_ctime = attr->ia_ctime;
-       if(valid & ATTR_MTIME) obj->st_mtime = attr->ia_mtime;
-#endif
        
        if(valid & ATTR_SIZE) yaffs_ResizeFile(obj,attr->ia_size);
        
@@ -4605,6 +4585,7 @@ int yaffs_SetAttributes(yaffs_Object *obj, struct iattr *attr)
        return YAFFS_OK;
        
 }
+
 int yaffs_GetAttributes(yaffs_Object *obj, struct iattr *attr)
 {
        unsigned int valid = 0;
@@ -4613,16 +4594,11 @@ int yaffs_GetAttributes(yaffs_Object *obj, struct iattr *attr)
        attr->ia_uid = obj->st_uid;             valid |= ATTR_UID;
        attr->ia_gid = obj->st_gid;             valid |= ATTR_GID;
        
-//#if defined(CONFIG_KERNEL_2_5)
-#if defined(__KERNEL__) && (LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0))
-       attr->ia_atime.tv_sec = obj->st_atime;  valid |= ATTR_ATIME;
-       attr->ia_ctime.tv_sec = obj->st_ctime;  valid |= ATTR_CTIME;
-       attr->ia_mtime.tv_sec = obj->st_mtime;  valid |= ATTR_MTIME;
-#else  
-       attr->ia_atime = obj->st_atime; valid |= ATTR_ATIME;
-       attr->ia_ctime = obj->st_ctime; valid |= ATTR_CTIME;
-       attr->ia_mtime = obj->st_mtime; valid |= ATTR_MTIME;
-#endif 
+       
+       Y_TIME_CONVERT(attr->ia_atime) = obj->st_atime; valid |= ATTR_ATIME;
+       Y_TIME_CONVERT(attr->ia_ctime) = obj->st_ctime; valid |= ATTR_CTIME;
+       Y_TIME_CONVERT(attr->ia_mtime) = obj->st_mtime; valid |= ATTR_MTIME;
+
        attr->ia_size = yaffs_GetFileSize(obj); valid |= ATTR_SIZE;
        
        attr->ia_valid = valid;
@@ -5006,3 +4982,5 @@ void yaffs_GutsTest(yaffs_Device *dev)
 
 
 
+
+
index 769dcc50adc2a7706012569b9d54c96bc8dbc64e..4aafe1dae791dc5b3a879ccd1d4bae9a82142c73 100644 (file)
  *
  * Note: Only YAFFS headers are LGPL, YAFFS C code is covered by GPL.
  *
- * $Id: yaffs_guts.h,v 1.16 2003-01-31 03:30:33 charles Exp $
+ * $Id: yaffs_guts.h,v 1.17 2004-10-10 17:54:59 charles Exp $
  */
 
 #ifndef __YAFFS_GUTS_H__
 #define __YAFFS_GUTS_H__
 
-#include "devextras.h"
-
+#include "yportenv.h"
 
 #define YAFFS_OK       1
 #define YAFFS_FAIL  0
@@ -586,3 +585,4 @@ void yaffs_GutsTest(yaffs_Device *dev);
 
 #endif
 
+
index 0c640372a2290c0030882405eda0c7b5eac07a18..dade8e4c0f91a5fb5163b4c399ade3a3575bb2f6 100644 (file)
@@ -15,7 +15,7 @@
  *
  * Note: Only YAFFS headers are LGPL, YAFFS C code is covered by GPL.
  *
- * $Id: yportenv.h,v 1.12 2004-10-04 23:24:21 charles Exp $
+ * $Id: yportenv.h,v 1.13 2004-10-10 17:54:59 charles Exp $
  *
  */
  
 #define YAFFS_ROOT_MODE                                0666
 #define YAFFS_LOSTNFOUND_MODE          0666
 
+#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0))
+#define Y_CURRENT_TIME CURRENT_TIME.tv_sec
+#define Y_TIME_CONVERT(x) (x).tv_sec
+#else
+#define Y_CURRENT_TIME CURRENT_TIME
+#define Y_TIME_CONVERT(x) (x)
+#endif
 
 #define yaffs_SumCompare(x,y) ((x) == (y))
 #define yaffs_strcmp(a,b) strcmp(a,b)
@@ -124,3 +131,4 @@ extern unsigned yaffs_traceMask;
 #endif
 
 #endif
+