-static yaffs_Object *yaffsfs_FindObject(yaffs_Object *relativeDirectory, const YCHAR *path, int symDepth, int getEquiv);
-static void yaffsfs_RemoveObjectCallback(yaffs_Object *obj);
+static yaffs_obj_t *yaffsfs_FindObject(yaffs_obj_t *relativeDirectory, const YCHAR *path, int symDepth, int getEquiv);
+static void yaffsfs_RemoveObjectCallback(yaffs_obj_t *obj);
* Curveballs: Should match paths that end in '/' too
* Curveball2 Might have "/x/ and "/x/y". Need to return the longest match
*/
* Curveballs: Should match paths that end in '/' too
* Curveball2 Might have "/x/ and "/x/y". Need to return the longest match
*/
* 2) Matches the longest.
*/
ylist_for_each(cfg, &yaffsfs_deviceList){
* 2) Matches the longest.
*/
ylist_for_each(cfg, &yaffsfs_deviceList){
- while(obj && obj->variantType == YAFFS_OBJECT_TYPE_SYMLINK){
- YCHAR *alias = obj->variant.symLinkVariant.alias;
+ while(obj && obj->variant_type == YAFFS_OBJECT_TYPE_SYMLINK){
+ YCHAR *alias = obj->variant.symlink_variant.alias;
if(yaffsfs_IsPathDivider(*alias))
/* Starts with a /, need to scan from root up */
if(yaffsfs_IsPathDivider(*alias))
/* Starts with a /, need to scan from root up */
const YCHAR *path,YCHAR **name,int symDepth)
{
return yaffsfs_DoFindDirectory(relativeDirectory,path,name,symDepth);
const YCHAR *path,YCHAR **name,int symDepth)
{
return yaffsfs_DoFindDirectory(relativeDirectory,path,name,symDepth);
-static yaffs_Object *yaffsfs_FindObject(yaffs_Object *relativeDirectory, const YCHAR *path,int symDepth,int getEquiv)
+static yaffs_obj_t *yaffsfs_FindObject(yaffs_obj_t *relativeDirectory, const YCHAR *path,int symDepth, int getEquiv)
YCHAR *name;
dir = yaffsfs_FindDirectory(relativeDirectory,path,&name,symDepth);
if(dir && *name)
YCHAR *name;
dir = yaffsfs_FindDirectory(relativeDirectory,path,&name,symDepth);
if(dir && *name)
int yaffs_open_sharing(const YCHAR *path, int oflag, int mode, int sharing)
{
int yaffs_open_sharing(const YCHAR *path, int oflag, int mode, int sharing)
{
__u8 shareRead = (sharing & YAFFS_SHARE_READ) ? 1 : 0;
__u8 shareWrite = (sharing & YAFFS_SHARE_WRITE) ? 1 : 0;
__u8 sharedReadAllowed;
__u8 shareRead = (sharing & YAFFS_SHARE_READ) ? 1 : 0;
__u8 shareWrite = (sharing & YAFFS_SHARE_WRITE) ? 1 : 0;
__u8 sharedReadAllowed;
/* The file already exists or it might be a directory */
/* If it is a directory then we can't open it as a file */
/* The file already exists or it might be a directory */
/* If it is a directory then we can't open it as a file */
- if( (oflag & (O_RDWR | O_WRONLY)) == 0 && /* ie O_RDONLY */
- !(obj->yst_mode & S_IREAD))
- openDenied = 1;
-
- if( (oflag & O_RDWR) &&
- !(obj->yst_mode & S_IREAD))
+ if( readRequested && !(obj->yst_mode & S_IREAD))
} else if((oflag & O_CREAT)) {
/* Let's see if we can create this file */
dir = yaffsfs_FindDirectory(NULL,path,&name,0);
} else if((oflag & O_CREAT)) {
/* Let's see if we can create this file */
dir = yaffsfs_FindDirectory(NULL,path,&name,0);
- obj = yaffs_MknodFile(dir,name,mode,0,0);
+ obj = yaffs_create_file(dir,name,mode,0,0);
yh->append = (oflag & O_APPEND) ? 1 : 0;
yh->position = 0;
yh->shareRead = shareRead;
yh->shareWrite = shareWrite;
/* Hook inode to object */
yh->append = (oflag & O_APPEND) ? 1 : 0;
yh->position = 0;
yh->shareRead = shareRead;
yh->shareWrite = shareWrite;
/* Hook inode to object */
int yaffsfs_do_read(int fd, void *vbuf, unsigned int nbyte, int isPread, int offset)
{
yaffsfs_Handle *h = NULL;
int yaffsfs_do_read(int fd, void *vbuf, unsigned int nbyte, int isPread, int offset)
{
yaffsfs_Handle *h = NULL;
- nRead = yaffs_ReadDataFromFile(obj,buf,pos,nToRead);
+ nRead = yaffs_file_rd(obj,buf,pos,nToRead);
int yaffsfs_do_write(int fd, const void *vbuf, unsigned int nbyte, int isPwrite, int offset)
{
yaffsfs_Handle *h = NULL;
int yaffsfs_do_write(int fd, const void *vbuf, unsigned int nbyte, int isPwrite, int offset)
{
yaffsfs_Handle *h = NULL;
- nWritten = yaffs_WriteDataToFile(obj,buf,pos,nToWrite,writeThrough);
+ nWritten = yaffs_wr_file(obj,buf,pos,nToWrite,write_trhrough);
off_t yaffs_lseek(int fd, off_t offset, int whence)
{
yaffsfs_Handle *h = NULL;
off_t yaffs_lseek(int fd, off_t offset, int whence)
{
yaffsfs_Handle *h = NULL;
- yaffs_Object *olddir = NULL;
- yaffs_Object *newdir = NULL;
- yaffs_Object *obj = NULL;
+ yaffs_obj_t *olddir = NULL;
+ yaffs_obj_t *newdir = NULL;
+ yaffs_obj_t *obj = NULL;
/*
* It is a directory, check that it is not being renamed to
* being its own decendent.
* Do this by tracing from the new directory back to the root, checking for obj
*/
/*
* It is a directory, check that it is not being renamed to
* being its own decendent.
* Do this by tracing from the new directory back to the root, checking for obj
*/
- if(renameAllowed)
- result = yaffs_RenameObject(olddir,oldname,newdir,newname);
+ if(rename_allowed)
+ result = yaffs_rename_obj(olddir,oldname,newdir,newname);
buf->st_blocks = (buf->st_size + buf->st_blksize -1)/buf->st_blksize;
#if CONFIG_YAFFS_WINCE
buf->yst_wince_atime[0] = obj->win_atime[0];
buf->st_blocks = (buf->st_size + buf->st_blksize -1)/buf->st_blksize;
#if CONFIG_YAFFS_WINCE
buf->yst_wince_atime[0] = obj->win_atime[0];
static int yaffs_do_setxattr(const YCHAR *path, const char *name, const void *data, int size, int flags, int follow)
{
static int yaffs_do_setxattr(const YCHAR *path, const char *name, const void *data, int size, int flags, int follow)
{
- retVal = yaffs_SetXAttribute(obj,name,data,size,flags);
+ retVal = yaffs_set_xattrib(obj,name,data,size,flags);
int yaffs_fsetxattr(int fd, const char *name, const void *data, int size, int flags)
{
int yaffs_fsetxattr(int fd, const char *name, const void *data, int size, int flags)
{
- retVal = yaffs_SetXAttribute(obj,name,data,size,flags);
+ retVal = yaffs_set_xattrib(obj,name,data,size,flags);
static int yaffs_do_getxattr(const YCHAR *path, const char *name, void *data, int size, int follow)
{
static int yaffs_do_getxattr(const YCHAR *path, const char *name, void *data, int size, int follow)
{
- retVal = yaffs_GetXAttribute(obj,name,data,size);
+ retVal = yaffs_get_xattrib(obj,name,data,size);
int yaffs_fgetxattr(int fd, const char *name, void *data, int size)
{
int yaffs_fgetxattr(int fd, const char *name, void *data, int size)
{
- retVal = yaffs_GetXAttribute(obj,name,data,size);
+ retVal = yaffs_get_xattrib(obj,name,data,size);
static int yaffs_do_listxattr(const YCHAR *path, char *data, int size, int follow)
{
static int yaffs_do_listxattr(const YCHAR *path, char *data, int size, int follow)
{
#ifdef CONFIG_YAFFS_WINCE
int yaffs_get_wince_times(int fd, unsigned *wctime, unsigned *watime, unsigned *wmtime)
{
#ifdef CONFIG_YAFFS_WINCE
int yaffs_get_wince_times(int fd, unsigned *wctime, unsigned *watime, unsigned *wmtime)
{
yaffsfs_SetError(-EINVAL);
else
retVal = yaffsfs_DoChMod(obj,mode);
yaffsfs_SetError(-EINVAL);
else
retVal = yaffsfs_DoChMod(obj,mode);
yaffsfs_SetError(-EINVAL);
else
retVal = yaffsfs_DoChMod(obj,mode);
yaffsfs_SetError(-EINVAL);
else
retVal = yaffsfs_DoChMod(obj,mode);
if(parent && yaffs_strnlen(name,5) == 0){
/* Trying to make the root itself */
yaffsfs_SetError(-EEXIST);
if(parent && yaffs_strnlen(name,5) == 0){
/* Trying to make the root itself */
yaffsfs_SetError(-EEXIST);
- dir = yaffs_MknodDirectory(parent,name,mode,0,0);
+ dir = yaffs_create_dir(parent,name,mode,0,0);
yaffsfs_SetError(-EEXIST); /* the name already exists */
else
yaffsfs_SetError(-ENOSPC); /* just assume no space */
yaffsfs_SetError(-EEXIST); /* the name already exists */
else
yaffsfs_SetError(-ENOSPC); /* just assume no space */
- if(dev && dev->isMounted){
- retVal = yaffs_GetNumberOfFreeChunks(dev);
- retVal *= dev->nDataBytesPerChunk;
+ if(dev && dev->is_mounted){
+ retVal = yaffs_get_n_free_chunks(dev);
+ retVal *= dev->data_bytes_per_chunk;
- if(dev && dev->isMounted){
- retVal = (dev->param.endBlock - dev->param.startBlock + 1) - dev->param.nReservedBlocks;
- retVal *= dev->param.nChunksPerBlock;
- retVal *= dev->nDataBytesPerChunk;
+ if(dev && dev->is_mounted){
+ retVal = (dev->param.end_block - dev->param.start_block + 1) - dev->param.n_reserved_blocks;
+ retVal *= dev->param.chunks_per_block;
+ retVal *= dev->data_bytes_per_chunk;
- if(dev && dev->isMounted) {
- int nObjects = dev->nObjects;
- if(nObjects > dev->nHardLinks)
- retVal = nObjects - dev->nHardLinks;
+ if(dev && dev->is_mounted) {
+ int n_obj = dev->n_obj;
+ if(n_obj > dev->n_hardlinks)
+ retVal = n_obj - dev->n_hardlinks;
__u32 magic;
yaffs_dirent de; /* directory entry being used by this dsc */
YCHAR name[NAME_MAX+1]; /* name of directory being searched */
__u32 magic;
yaffs_dirent de; /* directory entry being used by this dsc */
YCHAR name[NAME_MAX+1]; /* name of directory being searched */
- yaffs_Object *dirObj; /* ptr to directory being searched */
- yaffs_Object *nextReturn; /* obj to be returned by next readddir */
+ yaffs_obj_t *dirObj; /* ptr to directory being searched */
+ yaffs_obj_t *nextReturn; /* obj to be returned by next readddir */
- dsc->nextReturn = ylist_entry(dsc->dirObj->variant.directoryVariant.children.next,
- yaffs_Object,siblings);
+ dsc->nextReturn = ylist_entry(dsc->dirObj->variant.dir_variant.children.next,
+ yaffs_obj_t,siblings);
yaffsfs_DirectorySearchContext *dsc = NULL;
yaffsfs_Lock();
obj = yaffsfs_FindObject(NULL,dirname,0,1);
yaffsfs_DirectorySearchContext *dsc = NULL;
yaffsfs_Lock();
obj = yaffsfs_FindObject(NULL,dirname,0,1);
if(yaffs_strnlen(dsc->de.d_name,NAME_MAX+1) == 0)
{
/* this should not happen! */
if(yaffs_strnlen(dsc->de.d_name,NAME_MAX+1) == 0)
{
/* this should not happen! */
YCHAR *name;
int retVal= -1;
int mode = 0; /* ignore for now */
yaffsfs_Lock();
parent = yaffsfs_FindDirectory(NULL,newpath,&name,0);
YCHAR *name;
int retVal= -1;
int mode = 0; /* ignore for now */
yaffsfs_Lock();
parent = yaffsfs_FindDirectory(NULL,newpath,&name,0);
- obj = yaffs_MknodSymLink(parent,name,mode,0,0,oldpath);
+ obj = yaffs_create_symlink(parent,name,mode,0,0,oldpath);
int yaffs_link(const YCHAR *oldpath, const YCHAR *newpath)
{
/* Creates a link called newpath to existing oldpath */
int yaffs_link(const YCHAR *oldpath, const YCHAR *newpath)
{
/* Creates a link called newpath to existing oldpath */
obj = yaffsfs_FindObject(NULL,path,0,1);
obj = yaffsfs_FindObject(NULL,path,0,1);
- "nPageWrites.......... %d\n"
- "nPageReads........... %d\n"
- "nBlockErasures....... %d\n"
- "nGCCopies............ %d\n"
+ "n_page_writes.......... %d\n"
+ "n_page_reads........... %d\n"
+ "n_erasures....... %d\n"
+ "n_gc_copies............ %d\n"