{
int retVal = 0;
- int nameLength = yaffs_strnlen(name,YAFFS_MAX_NAME_LENGTH+1);
+ int nameLength = strnlen(name,YAFFS_MAX_NAME_LENGTH+1);
if(nameLength == 0){
yaffsfs_SetError(-ENOENT);
*/
if(path_length > 0 &&
yaffsfs_IsPathDivider(path[path_length-1])){
- alt_path = YMALLOC(path_length + 1);
+ alt_path = kmalloc(path_length + 1, 0);
if(!alt_path)
return -1;
strcpy(alt_path, path);
/* got to the end of the string */
return dir;
else{
- if(yaffs_strcmp(str,_Y(".")) == 0)
+ if(strcmp(str,_Y(".")) == 0)
{
/* Do nothing */
}
- else if(yaffs_strcmp(str,_Y("..")) == 0)
+ else if(strcmp(str,_Y("..")) == 0)
dir = dir->parent;
else{
dir = yaffs_find_by_name(dir,str);
yaffsfs_SetError(-ELOOP);
else if(!dir)
yaffsfs_SetError(-ENOENT);
- else if(yaffs_strncmp(name,_Y("."),2) == 0)
+ else if(strncmp(name,_Y("."),2) == 0)
yaffsfs_SetError(-EINVAL);
else if(!obj)
yaffsfs_SetError(-ENOENT);
} else if(oldLoop || newLoop) {
yaffsfs_SetError(-ELOOP);
rename_allowed = 0;
- } else if (olddir && oldname && yaffs_strncmp(oldname, _Y("."),2) == 0){
+ } else if (olddir && oldname && strncmp(oldname, _Y("."),2) == 0){
yaffsfs_SetError(-EINVAL);
rename_allowed = 0;
}else if(!olddir || !newdir || !obj) {
yaffsfs_Unlock();
if(alt_newpath)
- YFREE(alt_newpath);
+ kfree(alt_newpath);
return (result == YAFFS_FAIL) ? -1 : 0;
}
yaffsfs_SetError(-ELOOP);
else if(!parent)
yaffsfs_SetError(-ENOENT);
- else if(yaffs_strnlen(name,5) == 0){
+ else if(strnlen(name,5) == 0){
/* Trying to make the root itself */
yaffsfs_SetError(-EEXIST);
} else if(parent->my_dev->read_only)
yaffsfs_Unlock();
if(alt_path)
- YFREE(alt_path);
+ kfree(alt_path);
return retVal;
}
path = alt_path;
result = yaffsfs_DoUnlink(path,1);
if(alt_path)
- YFREE(alt_path);
+ kfree(alt_path);
return result;
}
return -1;
}
- T(YAFFS_TRACE_MOUNT,(TSTR("yaffs: Mounting %s" TENDSTR),path));
+ yaffs_trace(YAFFS_TRACE_MOUNT,"yaffs: Mounting %s",path);
if(yaffsfs_CheckPath(path) < 0){
yaffsfs_SetError(-ENAMETOOLONG);
yaffsfs_SetError(-ENOTDIR);
else {
- dsc = YMALLOC(sizeof(yaffsfs_DirectorySearchContext));
+ dsc = kmalloc(sizeof(yaffsfs_DirectorySearchContext), 0);
dir = (yaffs_DIR *)dsc;
if(dsc){
memset(dsc,0,sizeof(yaffsfs_DirectorySearchContext));
dsc->magic = YAFFS_MAGIC;
dsc->dirObj = obj;
- yaffs_strncpy(dsc->name,dirname,NAME_MAX);
+ strncpy(dsc->name,dirname,NAME_MAX);
INIT_LIST_HEAD(&dsc->others);
if(!search_contexts.next)
dsc->de.d_dont_use = (unsigned)dsc->nextReturn;
dsc->de.d_off = dsc->offset++;
yaffs_get_obj_name(dsc->nextReturn,dsc->de.d_name,NAME_MAX);
- if(yaffs_strnlen(dsc->de.d_name,NAME_MAX+1) == 0)
+ if(strnlen(dsc->de.d_name,NAME_MAX+1) == 0)
{
/* this should not happen! */
- yaffs_strcpy(dsc->de.d_name,_Y("zz"));
+ strcpy(dsc->de.d_name,_Y("zz"));
}
dsc->de.d_reclen = sizeof(struct yaffs_dirent);
retVal = &dsc->de;
yaffsfs_Lock();
dsc->magic = 0;
list_del(&dsc->others); /* unhook from list */
- YFREE(dsc);
+ kfree(dsc);
yaffsfs_Unlock();
return 0;
}
yaffsfs_SetError(-ENOTDIR);
else if(loop)
yaffsfs_SetError(-ELOOP);
- else if( !parent || yaffs_strnlen(name,5) < 1)
+ else if( !parent || strnlen(name,5) < 1)
yaffsfs_SetError(-ENOENT);
else if(parent->my_dev->read_only)
yaffsfs_SetError(-EROFS);
else {
YCHAR *alias = obj->variant.symlink_variant.alias;
memset(buf,0,bufsiz);
- yaffs_strncpy(buf,alias,bufsiz - 1);
+ strncpy(buf,alias,bufsiz - 1);
retVal = 0;
}
yaffsfs_Unlock();