*/
-const char *yaffs_fs_c_version = "$Id: yaffs_fs.c,v 1.40 2005-06-25 03:22:23 charles Exp $";
+const char *yaffs_fs_c_version = "$Id: yaffs_fs.c,v 1.41 2005-10-11 23:43:27 charles Exp $";
extern const char *yaffs_guts_c_version;
{
T(YAFFS_TRACE_OS,("yaffs_lookup found %d\n",obj->objectId));
- inode = yaffs_get_inode(dir->i_sb, obj->st_mode,0,obj);
+ inode = yaffs_get_inode(dir->i_sb, obj->yst_mode,0,obj);
if(inode)
{
if (inode && obj)
{
inode->i_ino = obj->objectId;
- inode->i_mode = obj->st_mode;
- inode->i_uid = obj->st_uid;
- inode->i_gid = obj->st_gid;
+ inode->i_mode = obj->yst_mode;
+ inode->i_uid = obj->yst_uid;
+ inode->i_gid = obj->yst_gid;
inode->i_blksize = inode->i_sb->s_blocksize;
//#if defined(CONFIG_KERNEL_2_5)
#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0))
- inode->i_rdev = old_decode_dev(obj->st_rdev);
- inode->i_atime.tv_sec = (time_t)(obj->st_atime);
+ inode->i_rdev = old_decode_dev(obj->yst_rdev);
+ inode->i_atime.tv_sec = (time_t)(obj->yst_atime);
inode->i_atime.tv_nsec = 0;
- inode->i_mtime.tv_sec = (time_t)obj->st_mtime;
+ inode->i_mtime.tv_sec = (time_t)obj->yst_mtime;
inode->i_mtime.tv_nsec =0;
- inode->i_ctime.tv_sec = (time_t)obj->st_ctime;
+ inode->i_ctime.tv_sec = (time_t)obj->yst_ctime;
inode->i_ctime.tv_nsec = 0;
#else
- inode->i_rdev = obj->st_rdev;
- inode->i_atime = obj->st_atime;
- inode->i_mtime = obj->st_mtime;
- inode->i_ctime = obj->st_ctime;
+ inode->i_rdev = obj->yst_rdev;
+ inode->i_atime = obj->yst_atime;
+ inode->i_mtime = obj->yst_mtime;
+ inode->i_ctime = obj->yst_ctime;
#endif
inode->i_size = yaffs_GetObjectFileLength(obj);
inode->i_blocks = (inode->i_size + 511) >> 9;
T(YAFFS_TRACE_OS,("yaffs_FillInode mode %x uid %d gid %d size %d count %d\n",
inode->i_mode, inode->i_uid, inode->i_gid, (int)inode->i_size, atomic_read(&inode->i_count)));
- switch (obj->st_mode & S_IFMT)
+ switch (obj->yst_mode & S_IFMT)
{
default: // fifo, device or socket
#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0))
- init_special_inode(inode, obj->st_mode,old_decode_dev(obj->st_rdev));
+ init_special_inode(inode, obj->yst_mode,old_decode_dev(obj->yst_rdev));
#else
- init_special_inode(inode, obj->st_mode,(dev_t)(obj->st_rdev));
+ init_special_inode(inode, obj->yst_mode,(dev_t)(obj->yst_rdev));
#endif
break;
case S_IFREG: // file
struct inode* inode;
- inode = yaffs_get_inode(dir->i_sb, obj->st_mode, 0, obj);
+ inode = yaffs_get_inode(dir->i_sb, obj->yst_mode, 0, obj);
d_instantiate(dentry, inode);
T(YAFFS_TRACE_OS,("symlink created OK\n"));
return 0;
error = -EPERM;
}
yaffs_GrossUnlock(dev);
- inode_setattr(inode,attr);
+ error = inode_setattr(inode,attr);
}
return error;
}
*/
//yaffs_guts.c
-const char *yaffs_guts_c_version="$Id: yaffs_guts.c,v 1.42 2005-06-25 03:22:23 charles Exp $";
+const char *yaffs_guts_c_version="$Id: yaffs_guts.c,v 1.43 2005-10-11 23:43:27 charles Exp $";
#include "yportenv.h"
obj->unlinkAllowed= 0; // ... or unlink it
obj->deleted = 0;
obj->unlinked = 0;
- obj->st_mode = mode;
+ obj->yst_mode = mode;
obj->myDev = dev;
obj->chunkId = 0; // Not a valid chunk.
}
#else
- theObject->st_atime = theObject->st_mtime = theObject->st_ctime = Y_CURRENT_TIME;
+ theObject->yst_atime = theObject->yst_mtime = theObject->yst_ctime = Y_CURRENT_TIME;
#endif
switch(type)
in->valid = 1;
in->variantType = type;
- in->st_mode = mode;
+ in->yst_mode = mode;
#ifdef CONFIG_YAFFS_WINCE
yfsd_WinFileTimeNow(in->win_atime);
#else
- in->st_atime = in->st_mtime = in->st_ctime = Y_CURRENT_TIME;
- in->st_rdev = rdev;
- in->st_uid = uid;
- in->st_gid = gid;
+ in->yst_atime = in->yst_mtime = in->yst_ctime = Y_CURRENT_TIME;
+ in->yst_rdev = rdev;
+ in->yst_uid = uid;
+ in->yst_gid = gid;
#endif
in->nDataChunks = 0;
// Header data
oh->type = in->variantType;
- oh->st_mode = in->st_mode;
+ oh->yst_mode = in->yst_mode;
#ifdef CONFIG_YAFFS_WINCE
oh->win_atime[0] = in->win_atime[0];
oh->win_ctime[1] = in->win_ctime[1];
oh->win_mtime[1] = in->win_mtime[1];
#else
- oh->st_uid = in->st_uid;
- oh->st_gid = in->st_gid;
- oh->st_atime = in->st_atime;
- oh->st_mtime = in->st_mtime;
- oh->st_ctime = in->st_ctime;
- oh->st_rdev = in->st_rdev;
+ oh->yst_uid = in->yst_uid;
+ oh->yst_gid = in->yst_gid;
+ oh->yst_atime = in->yst_atime;
+ oh->yst_mtime = in->yst_mtime;
+ oh->yst_ctime = in->yst_ctime;
+ oh->yst_rdev = in->yst_rdev;
#endif
if(in->parent)
{
#ifdef CONFIG_YAFFS_WINCE
yfsd_WinFileTimeNow(in->win_mtime);
#else
- in->st_mtime = Y_CURRENT_TIME;
+ in->yst_mtime = Y_CURRENT_TIME;
#endif
}
in->valid = 1;
in->variantType = oh->type;
- in->st_mode = oh->st_mode;
+ in->yst_mode = oh->yst_mode;
#ifdef CONFIG_YAFFS_WINCE
in->win_atime[0] = oh->win_atime[0];
in->win_ctime[0] = oh->win_ctime[0];
in->win_ctime[1] = oh->win_ctime[1];
in->win_mtime[1] = oh->win_mtime[1];
#else
- in->st_uid = oh->st_uid;
- in->st_gid = oh->st_gid;
- in->st_atime = oh->st_atime;
- in->st_mtime = oh->st_mtime;
- in->st_ctime = oh->st_ctime;
- in->st_rdev = oh->st_rdev;
+ in->yst_uid = oh->yst_uid;
+ in->yst_gid = oh->yst_gid;
+ in->yst_atime = oh->yst_atime;
+ in->yst_mtime = oh->yst_mtime;
+ in->yst_ctime = oh->yst_ctime;
+ in->yst_rdev = oh->yst_rdev;
#endif
in->chunkId = chunk;
in->valid = 1;
in->variantType = oh->type;
- in->st_mode = oh->st_mode;
+ in->yst_mode = oh->yst_mode;
#ifdef CONFIG_YAFFS_WINCE
in->win_atime[0] = oh->win_atime[0];
in->win_ctime[0] = oh->win_ctime[0];
in->win_ctime[1] = oh->win_ctime[1];
in->win_mtime[1] = oh->win_mtime[1];
#else
- in->st_uid = oh->st_uid;
- in->st_gid = oh->st_gid;
- in->st_atime = oh->st_atime;
- in->st_mtime = oh->st_mtime;
- in->st_ctime = oh->st_ctime;
- in->st_rdev = oh->st_rdev;
+ in->yst_uid = oh->yst_uid;
+ in->yst_gid = oh->yst_gid;
+ in->yst_atime = oh->yst_atime;
+ in->yst_mtime = oh->yst_mtime;
+ in->yst_ctime = oh->yst_ctime;
+ in->yst_rdev = oh->yst_rdev;
#endif
in->chunkId = chunk;
case YAFFS_OBJECT_TYPE_SYMLINK: return DT_LNK; break;
case YAFFS_OBJECT_TYPE_HARDLINK: return DT_REG; break;
case YAFFS_OBJECT_TYPE_SPECIAL:
- if(S_ISFIFO(obj->st_mode)) return DT_FIFO;
- if(S_ISCHR(obj->st_mode)) return DT_CHR;
- if(S_ISBLK(obj->st_mode)) return DT_BLK;
- if(S_ISSOCK(obj->st_mode)) return DT_SOCK;
+ if(S_ISFIFO(obj->yst_mode)) return DT_FIFO;
+ if(S_ISCHR(obj->yst_mode)) return DT_CHR;
+ if(S_ISBLK(obj->yst_mode)) return DT_BLK;
+ if(S_ISSOCK(obj->yst_mode)) return DT_SOCK;
default: return DT_REG; break;
}
}
{
unsigned int valid = attr->ia_valid;
- if(valid & ATTR_MODE) obj->st_mode = attr->ia_mode;
- if(valid & ATTR_UID) obj->st_uid = attr->ia_uid;
- if(valid & ATTR_GID) obj->st_gid = attr->ia_gid;
+ if(valid & ATTR_MODE) obj->yst_mode = attr->ia_mode;
+ if(valid & ATTR_UID) obj->yst_uid = attr->ia_uid;
+ if(valid & ATTR_GID) obj->yst_gid = attr->ia_gid;
- 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->yst_atime = Y_TIME_CONVERT(attr->ia_atime);
+ if(valid & ATTR_CTIME) obj->yst_ctime = Y_TIME_CONVERT(attr->ia_ctime);
+ if(valid & ATTR_MTIME) obj->yst_mtime = Y_TIME_CONVERT(attr->ia_mtime);
if(valid & ATTR_SIZE) yaffs_ResizeFile(obj,attr->ia_size);
{
unsigned int valid = 0;
- attr->ia_mode = obj->st_mode; valid |= ATTR_MODE;
- attr->ia_uid = obj->st_uid; valid |= ATTR_UID;
- attr->ia_gid = obj->st_gid; valid |= ATTR_GID;
+ attr->ia_mode = obj->yst_mode; valid |= ATTR_MODE;
+ attr->ia_uid = obj->yst_uid; valid |= ATTR_UID;
+ attr->ia_gid = obj->yst_gid; valid |= ATTR_GID;
- 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;
+ Y_TIME_CONVERT(attr->ia_atime) = obj->yst_atime; valid |= ATTR_ATIME;
+ Y_TIME_CONVERT(attr->ia_ctime) = obj->yst_ctime; valid |= ATTR_CTIME;
+ Y_TIME_CONVERT(attr->ia_mtime) = obj->yst_mtime; valid |= ATTR_MTIME;
attr->ia_size = yaffs_GetFileSize(obj); valid |= ATTR_SIZE;
*
* Note: Only YAFFS headers are LGPL, YAFFS C code is covered by GPL.
*
- * $Id: yaffs_guts.h,v 1.20 2005-06-25 03:22:24 charles Exp $
+ * $Id: yaffs_guts.h,v 1.21 2005-10-11 23:43:27 charles Exp $
*/
#ifndef __YAFFS_GUTS_H__
char name[YAFFS_MAX_NAME_LENGTH + 1];
// Thes following apply to directories, files, symlinks - not hard links
- __u32 st_mode; // protection
+ __u32 yst_mode; // protection
#ifdef CONFIG_YAFFS_WINCE
__u32 notForWinCE[5];
#else
- __u32 st_uid; // user ID of owner
- __u32 st_gid; // group ID of owner
- __u32 st_atime; // time of last access
- __u32 st_mtime; // time of last modification
- __u32 st_ctime; // time of last change
+ __u32 yst_uid; // user ID of owner
+ __u32 yst_gid; // group ID of owner
+ __u32 yst_atime; // time of last access
+ __u32 yst_mtime; // time of last modification
+ __u32 yst_ctime; // time of last change
#endif
// File size applies to files only
// Alias is for symlinks only.
char alias[YAFFS_MAX_ALIAS_LENGTH + 1];
- __u32 st_rdev; // device stuff for block and char devices (maj/min)
+ __u32 yst_rdev; // device stuff for block and char devices (maj/min)
#ifdef CONFIG_YAFFS_WINCE
__u32 win_ctime[2];
__u32 objectId; // the object id value
- __u32 st_mode; // protection
+ __u32 yst_mode; // protection
#ifdef CONFIG_YAFFS_SHORT_NAMES_IN_RAM
char shortName[YAFFS_SHORT_NAME_LENGTH+1];
__u32 win_mtime[2];
__u32 win_atime[2];
#else
- __u32 st_uid; // user ID of owner
- __u32 st_gid; // group ID of owner
- __u32 st_atime; // time of last access
- __u32 st_mtime; // time of last modification
- __u32 st_ctime; // time of last change
+ __u32 yst_uid; // user ID of owner
+ __u32 yst_gid; // group ID of owner
+ __u32 yst_atime; // time of last access
+ __u32 yst_mtime; // time of last modification
+ __u32 yst_ctime; // time of last change
#endif
- __u32 st_rdev; // device stuff for block and char devices
+ __u32 yst_rdev; // device stuff for block and char devices