fs/: Change some *err() message to *info() messages if what was a *dbg() message does not indicate and error condition.

This commit is contained in:
Gregory Nutt 2016-06-11 17:14:02 -06:00
parent be80a0b99c
commit ad2f7b0119
21 changed files with 173 additions and 156 deletions

View File

@ -84,7 +84,7 @@ int close_blockdriver(FAR struct inode *inode)
if (!INODE_IS_BLOCK(inode)) if (!INODE_IS_BLOCK(inode))
{ {
ferr("inode is not a block driver\n"); ferr("ERROR: inode is not a block driver\n");
ret = -ENOTBLK; ret = -ENOTBLK;
goto errout; goto errout;
} }

View File

@ -96,7 +96,7 @@ int find_blockdriver(FAR const char *pathname, int mountflags, FAR struct inode
inode = inode_find(pathname, NULL); inode = inode_find(pathname, NULL);
if (!inode) if (!inode)
{ {
ferr("Failed to find %s\n", pathname); ferr("ERROR: Failed to find %s\n", pathname);
ret = -ENOENT; ret = -ENOENT;
goto errout; goto errout;
} }
@ -105,7 +105,7 @@ int find_blockdriver(FAR const char *pathname, int mountflags, FAR struct inode
if (!INODE_IS_BLOCK(inode)) if (!INODE_IS_BLOCK(inode))
{ {
ferr("%s is not a block driver\n", pathname); ferr("ERROR: %s is not a block driver\n", pathname);
ret = -ENOTBLK; ret = -ENOTBLK;
goto errout_with_inode; goto errout_with_inode;
} }
@ -115,7 +115,7 @@ int find_blockdriver(FAR const char *pathname, int mountflags, FAR struct inode
if (!inode->u.i_bops || !inode->u.i_bops->read || if (!inode->u.i_bops || !inode->u.i_bops->read ||
(!inode->u.i_bops->write && (mountflags & MS_RDONLY) == 0)) (!inode->u.i_bops->write && (mountflags & MS_RDONLY) == 0))
{ {
ferr("%s does not support requested access\n", pathname); ferr("ERROR: %s does not support requested access\n", pathname);
ret = -EACCES; ret = -EACCES;
goto errout_with_inode; goto errout_with_inode;
} }

View File

@ -96,7 +96,7 @@ int open_blockdriver(FAR const char *pathname, int mountflags,
ret = find_blockdriver(pathname, mountflags, &inode); ret = find_blockdriver(pathname, mountflags, &inode);
if (ret < 0) if (ret < 0)
{ {
ferr("Failed to file %s block driver\n", pathname); ferr("ERROR: Failed to file %s block driver\n", pathname);
goto errout; goto errout;
} }
@ -110,7 +110,7 @@ int open_blockdriver(FAR const char *pathname, int mountflags,
ret = inode->u.i_bops->open(inode); ret = inode->u.i_bops->open(inode);
if (ret < 0) if (ret < 0)
{ {
ferr("%s driver open failed\n", pathname); ferr("ERROR: %s driver open failed\n", pathname);
goto errout_with_inode; goto errout_with_inode;
} }
} }

View File

@ -473,7 +473,7 @@ mkfatfs_tryfat12(FAR struct fat_format_s *fmt, FAR struct fat_var_s *var,
if (config->fc_nclusters + 2 > maxnclusters) if (config->fc_nclusters + 2 > maxnclusters)
{ {
ferr("Too many clusters for FAT12: %d > %d\n", ferr("ERROR: Too many clusters for FAT12: %d > %d\n",
config->fc_nclusters, maxnclusters - 2); config->fc_nclusters, maxnclusters - 2);
return -ENFILE; return -ENFILE;
@ -550,7 +550,7 @@ mkfatfs_tryfat16(FAR struct fat_format_s *fmt, FAR struct fat_var_s *var,
if ((config->fc_nclusters + 2 > maxnclusters) || if ((config->fc_nclusters + 2 > maxnclusters) ||
(config->fc_nclusters < FAT_MINCLUST16)) (config->fc_nclusters < FAT_MINCLUST16))
{ {
ferr("Too few or too many clusters for FAT16: %d < %d < %d\n", ferr("ERROR: Too few or too many clusters for FAT16: %d < %d < %d\n",
FAT_MINCLUST16, config->fc_nclusters, maxnclusters - 2); FAT_MINCLUST16, config->fc_nclusters, maxnclusters - 2);
return -ENFILE; return -ENFILE;
@ -622,7 +622,7 @@ mkfatfs_tryfat32(FAR struct fat_format_s *fmt, FAR struct fat_var_s *var,
if ((config->fc_nclusters + 3 > maxnclusters) || if ((config->fc_nclusters + 3 > maxnclusters) ||
(config->fc_nclusters < FAT_MINCLUST32)) (config->fc_nclusters < FAT_MINCLUST32))
{ {
ferr("Too few or too many clusters for FAT32: %d < %d < %d\n", ferr("ERROR: Too few or too many clusters for FAT32: %d < %d < %d\n",
FAT_MINCLUST32, config->fc_nclusters, maxnclusters - 3); FAT_MINCLUST32, config->fc_nclusters, maxnclusters - 3);
return -ENFILE; return -ENFILE;
@ -696,7 +696,7 @@ mkfatfs_clustersearch(FAR struct fat_format_s *fmt, FAR struct fat_var_s *var)
if (fmt->ff_rsvdseccount < 2) if (fmt->ff_rsvdseccount < 2)
{ {
ferr("At least 2 reserved sectors needed by FAT32\n"); ferr("ERROR: At least 2 reserved sectors needed by FAT32\n");
fatconfig32.fc_rsvdseccount = 2; fatconfig32.fc_rsvdseccount = 2;
} }
else else
@ -756,7 +756,7 @@ mkfatfs_clustersearch(FAR struct fat_format_s *fmt, FAR struct fat_var_s *var)
if (mkfatfs_tryfat12(fmt, var, &fatconfig12) != 0) if (mkfatfs_tryfat12(fmt, var, &fatconfig12) != 0)
{ {
ferr("Cannot format FAT12 at %u sectors/cluster\n", ferr("ERROR: Cannot format FAT12 at %u sectors/cluster\n",
1 << fmt->ff_clustshift); 1 << fmt->ff_clustshift);
fatconfig12.fc_nfatsects = 0; fatconfig12.fc_nfatsects = 0;
@ -772,7 +772,7 @@ mkfatfs_clustersearch(FAR struct fat_format_s *fmt, FAR struct fat_var_s *var)
if (mkfatfs_tryfat16(fmt, var, &fatconfig16) != 0) if (mkfatfs_tryfat16(fmt, var, &fatconfig16) != 0)
{ {
ferr("Cannot format FAT16 at %u sectors/cluster\n", ferr("ERROR: Cannot format FAT16 at %u sectors/cluster\n",
1 << fmt->ff_clustshift); 1 << fmt->ff_clustshift);
fatconfig16.fc_nfatsects = 0; fatconfig16.fc_nfatsects = 0;
@ -828,7 +828,7 @@ mkfatfs_clustersearch(FAR struct fat_format_s *fmt, FAR struct fat_var_s *var)
if (mkfatfs_tryfat32(fmt, var, &fatconfig32) != 0) if (mkfatfs_tryfat32(fmt, var, &fatconfig32) != 0)
{ {
ferr("Cannot format FAT32 at %u sectors/cluster\n", ferr("ERROR: Cannot format FAT32 at %u sectors/cluster\n",
1 << fmt->ff_clustshift); 1 << fmt->ff_clustshift);
fatconfig32.fc_nfatsects = 0; fatconfig32.fc_nfatsects = 0;
@ -940,7 +940,7 @@ int mkfatfs_configfatfs(FAR struct fat_format_s *fmt,
if (fmt->ff_backupboot <= 1 || fmt->ff_backupboot >= fmt->ff_rsvdseccount) if (fmt->ff_backupboot <= 1 || fmt->ff_backupboot >= fmt->ff_rsvdseccount)
{ {
ferr("Invalid backup boot sector: %d\n", fmt->ff_backupboot); ferr("ERROR: Invalid backup boot sector: %d\n", fmt->ff_backupboot);
fmt->ff_backupboot = 0; fmt->ff_backupboot = 0;
} }
@ -974,21 +974,21 @@ int mkfatfs_configfatfs(FAR struct fat_format_s *fmt,
/* Describe the configured filesystem */ /* Describe the configured filesystem */
#ifdef CONFIG_DEBUG_FEATURES #ifdef CONFIG_DEBUG_FEATURES
ferr("Sector size: %d bytes\n", var->fv_sectorsize); finfo("Sector size: %d bytes\n", var->fv_sectorsize);
ferr("Number of sectors: %d sectors\n", fmt->ff_nsectors); finfo("Number of sectors: %d sectors\n", fmt->ff_nsectors);
ferr("FAT size: %d bits\n", var->fv_fattype); finfo("FAT size: %d bits\n", var->fv_fattype);
ferr("Number FATs: %d\n", fmt->ff_nfats); finfo("Number FATs: %d\n", fmt->ff_nfats);
ferr("Sectors per cluster: %d sectors\n", 1 << fmt->ff_clustshift); finfo("Sectors per cluster: %d sectors\n", 1 << fmt->ff_clustshift);
ferr("FS size: %d sectors\n", var->fv_nfatsects); finfo("FS size: %d sectors\n", var->fv_nfatsects);
ferr(" %d clusters\n", var->fv_nclusters); finfo(" %d clusters\n", var->fv_nclusters);
if (var->fv_fattype != 32) if (var->fv_fattype != 32)
{ {
ferr("Root directory slots: %d\n", fmt->ff_rootdirentries); finfo("Root directory slots: %d\n", fmt->ff_rootdirentries);
} }
ferr("Volume ID: %08x\n", fmt->ff_volumeid); finfo("Volume ID: %08x\n", fmt->ff_volumeid);
ferr("Volume Label: \"%c%c%c%c%c%c%c%c%c%c%c\"\n", finfo("Volume Label: \"%c%c%c%c%c%c%c%c%c%c%c\"\n",
fmt->ff_volumelabel[0], fmt->ff_volumelabel[1], fmt->ff_volumelabel[2], fmt->ff_volumelabel[0], fmt->ff_volumelabel[1], fmt->ff_volumelabel[2],
fmt->ff_volumelabel[3], fmt->ff_volumelabel[4], fmt->ff_volumelabel[5], fmt->ff_volumelabel[3], fmt->ff_volumelabel[4], fmt->ff_volumelabel[5],
fmt->ff_volumelabel[6], fmt->ff_volumelabel[7], fmt->ff_volumelabel[8], fmt->ff_volumelabel[6], fmt->ff_volumelabel[7], fmt->ff_volumelabel[8],

View File

@ -624,7 +624,7 @@ fat_read_restart:
if (ret == -EFAULT && !force_indirect) if (ret == -EFAULT && !force_indirect)
{ {
ferr("DMA: read alignment error, restarting indirect\n"); ferr("ERROR: DMA read alignment error, restarting indirect\n");
force_indirect = true; force_indirect = true;
goto fat_read_restart; goto fat_read_restart;
} }
@ -884,7 +884,7 @@ fat_write_restart:
if (ret == -EFAULT && !force_indirect) if (ret == -EFAULT && !force_indirect)
{ {
ferr("DMA: write alignment error, restarting indirect\n"); ferr("ERROR: DMA write alignment error, restarting indirect\n");
force_indirect = true; force_indirect = true;
goto fat_write_restart; goto fat_write_restart;
} }

View File

@ -623,7 +623,7 @@ int fat_mount(struct fat_mountpt_s *fs, bool writeable)
if (i > 3) if (i > 3)
{ {
ferr("No valid MBR\n"); ferr("ERROR: No valid MBR\n");
ret = -EINVAL; ret = -EINVAL;
goto errout_with_buffer; goto errout_with_buffer;
} }
@ -644,22 +644,22 @@ int fat_mount(struct fat_mountpt_s *fs, bool writeable)
/* We did it! */ /* We did it! */
ferr("FAT%d:\n", fs->fs_type == 0 ? 12 : fs->fs_type == 1 ? 16 : 32); finfo("FAT%d:\n", fs->fs_type == 0 ? 12 : fs->fs_type == 1 ? 16 : 32);
ferr("\tHW sector size: %d\n", fs->fs_hwsectorsize); finfo("\tHW sector size: %d\n", fs->fs_hwsectorsize);
ferr("\t sectors: %d\n", fs->fs_hwnsectors); finfo("\t sectors: %d\n", fs->fs_hwnsectors);
ferr("\tFAT reserved: %d\n", fs->fs_fatresvdseccount); finfo("\tFAT reserved: %d\n", fs->fs_fatresvdseccount);
ferr("\t sectors: %d\n", fs->fs_fattotsec); finfo("\t sectors: %d\n", fs->fs_fattotsec);
ferr("\t start sector: %d\n", fs->fs_fatbase); finfo("\t start sector: %d\n", fs->fs_fatbase);
ferr("\t root sector: %d\n", fs->fs_rootbase); finfo("\t root sector: %d\n", fs->fs_rootbase);
ferr("\t root entries: %d\n", fs->fs_rootentcnt); finfo("\t root entries: %d\n", fs->fs_rootentcnt);
ferr("\t data sector: %d\n", fs->fs_database); finfo("\t data sector: %d\n", fs->fs_database);
ferr("\t FSINFO sector: %d\n", fs->fs_fsinfo); finfo("\t FSINFO sector: %d\n", fs->fs_fsinfo);
ferr("\t Num FATs: %d\n", fs->fs_fatnumfats); finfo("\t Num FATs: %d\n", fs->fs_fatnumfats);
ferr("\t FAT sectors: %d\n", fs->fs_nfatsects); finfo("\t FAT sectors: %d\n", fs->fs_nfatsects);
ferr("\t sectors/cluster: %d\n", fs->fs_fatsecperclus); finfo("\t sectors/cluster: %d\n", fs->fs_fatsecperclus);
ferr("\t max clusters: %d\n", fs->fs_nclusters); finfo("\t max clusters: %d\n", fs->fs_nclusters);
ferr("\tFSI free count %d\n", fs->fs_fsifreecount); finfo("\tFSI free count %d\n", fs->fs_fsifreecount);
ferr("\t next free %d\n", fs->fs_fsinextfree); finfo("\t next free %d\n", fs->fs_fsinextfree);
return OK; return OK;

View File

@ -135,14 +135,14 @@ FAR void *mmap(FAR void *start, size_t length, int prot, int flags,
if (prot == PROT_NONE || if (prot == PROT_NONE ||
(flags & (MAP_PRIVATE | MAP_FIXED | MAP_ANONYMOUS | MAP_DENYWRITE)) != 0) (flags & (MAP_PRIVATE | MAP_FIXED | MAP_ANONYMOUS | MAP_DENYWRITE)) != 0)
{ {
ferr("Unsupported options, prot=%x flags=%04x\n", prot, flags); ferr("ERROR: Unsupported options, prot=%x flags=%04x\n", prot, flags);
set_errno(ENOSYS); set_errno(ENOSYS);
return MAP_FAILED; return MAP_FAILED;
} }
if (length == 0 || (flags & MAP_SHARED) == 0) if (length == 0 || (flags & MAP_SHARED) == 0)
{ {
ferr("Invalid options, lengt=%d flags=%04x\n", length, flags); ferr("ERROR: Invalid options, lengt=%d flags=%04x\n", length, flags);
set_errno(EINVAL); set_errno(EINVAL);
return MAP_FAILED; return MAP_FAILED;
} }
@ -163,7 +163,7 @@ FAR void *mmap(FAR void *start, size_t length, int prot, int flags,
#ifdef CONFIG_FS_RAMMAP #ifdef CONFIG_FS_RAMMAP
return rammap(fd, length, offset); return rammap(fd, length, offset);
#else #else
ferr("ioctl(FIOC_MMAP) failed: %d\n", get_errno()); ferr("ERROR: ioctl(FIOC_MMAP) failed: %d\n", get_errno());
return MAP_FAILED; return MAP_FAILED;
#endif #endif
} }

View File

@ -143,7 +143,7 @@ int munmap(FAR void *start, size_t length)
if (!curr) if (!curr)
{ {
ferr("Region not found\n"); ferr("ERROR: Region not found\n");
errcode = EINVAL; errcode = EINVAL;
goto errout_with_semaphore; goto errout_with_semaphore;
} }
@ -158,7 +158,7 @@ int munmap(FAR void *start, size_t length)
offset = start - curr->addr; offset = start - curr->addr;
if (offset + length < curr->length) if (offset + length < curr->length)
{ {
ferr("Cannot umap without unmapping to the end\n"); ferr("ERROR: Cannot umap without unmapping to the end\n");
errcode = ENOSYS; errcode = ENOSYS;
goto errout_with_semaphore; goto errout_with_semaphore;
} }

View File

@ -142,7 +142,7 @@ FAR void *rammap(int fd, size_t length, off_t offset)
alloc = (FAR uint8_t *)kumm_malloc(sizeof(struct fs_rammap_s) + length); alloc = (FAR uint8_t *)kumm_malloc(sizeof(struct fs_rammap_s) + length);
if (!alloc) if (!alloc)
{ {
ferr("Region allocation failed, length: %d\n", (int)length); ferr("ERROR: Region allocation failed, length: %d\n", (int)length);
errcode = ENOMEM; errcode = ENOMEM;
goto errout; goto errout;
} }
@ -164,7 +164,7 @@ FAR void *rammap(int fd, size_t length, off_t offset)
* the correct response. * the correct response.
*/ */
ferr("Seek to position %d failed\n", (int)offset); ferr("ERROR: Seek to position %d failed\n", (int)offset);
errcode = EINVAL; errcode = EINVAL;
goto errout_with_region; goto errout_with_region;
} }
@ -190,7 +190,8 @@ FAR void *rammap(int fd, size_t length, off_t offset)
* destroy the errno value. * destroy the errno value.
*/ */
ferr("Read failed: offset=%d errno=%d\n", (int)offset, errcode); ferr("ERROR: Read failed: offset=%d errno=%d\n",
(int)offset, errcode);
#ifdef CONFIG_DEBUG_FS #ifdef CONFIG_DEBUG_FS
goto errout_with_region; goto errout_with_region;
#else #else

View File

@ -204,7 +204,7 @@ static void automount_mount(FAR struct automounter_state_s *priv)
* try to unmount again because the mount might be stale. * try to unmount again because the mount might be stale.
*/ */
ferr("WARNING: Mountpoint %s already exists\n", lower->mountpoint); fwarn("WARNING: Mountpoint %s already exists\n", lower->mountpoint);
ret = automount_unmount(priv); ret = automount_unmount(priv);
if (ret < 0) if (ret < 0)
{ {

View File

@ -103,7 +103,7 @@ static inline int nfs_pathsegment(FAR const char **path, FAR char *buffer,
} }
else if (nbytes >= NAME_MAX) else if (nbytes >= NAME_MAX)
{ {
ferr("File name segment is too long: %d\n", *path); ferr("ERROR: File name segment is too long: %d\n", *path);
return EFBIG; return EFBIG;
} }
else else
@ -277,7 +277,7 @@ int nfs_lookup(struct nfsmount *nmp, FAR const char *filename,
namelen = strlen(filename); namelen = strlen(filename);
if (namelen > NAME_MAX) if (namelen > NAME_MAX)
{ {
ferr("Length of the string is too big: %d\n", namelen); ferr("ERROR: Length of the string is too long: %d\n", namelen);
return E2BIG; return E2BIG;
} }
@ -427,7 +427,7 @@ int nfs_findnode(struct nfsmount *nmp, FAR const char *relpath,
{ {
/* The filename segment contains is too long. */ /* The filename segment contains is too long. */
ferr("nfs_pathsegment of \"%s\" failed after \"%s\": %d\n", ferr("ERROR: nfs_pathsegment of \"%s\" failed after \"%s\": %d\n",
relpath, buffer, error); relpath, buffer, error);
return error; return error;
} }
@ -437,7 +437,7 @@ int nfs_findnode(struct nfsmount *nmp, FAR const char *relpath,
error = nfs_lookup(nmp, buffer, fhandle, obj_attributes, dir_attributes); error = nfs_lookup(nmp, buffer, fhandle, obj_attributes, dir_attributes);
if (error != OK) if (error != OK)
{ {
ferr("nfs_lookup of \"%s\" failed at \"%s\": %d\n", ferr("ERROR: nfs_lookup of \"%s\" failed at \"%s\": %d\n",
relpath, buffer, error); relpath, buffer, error);
return error; return error;
} }
@ -521,7 +521,7 @@ int nfs_finddir(struct nfsmount *nmp, FAR const char *relpath,
{ {
/* The filename segment contains is too long. */ /* The filename segment contains is too long. */
ferr("nfs_pathsegment of \"%s\" failed after \"%s\": %d\n", ferr("ERROR: nfs_pathsegment of \"%s\" failed after \"%s\": %d\n",
relpath, filename, error); relpath, filename, error);
return error; return error;
} }
@ -545,7 +545,7 @@ int nfs_finddir(struct nfsmount *nmp, FAR const char *relpath,
error = nfs_lookup(nmp, filename, fhandle, attributes, NULL); error = nfs_lookup(nmp, filename, fhandle, attributes, NULL);
if (error != OK) if (error != OK)
{ {
ferr("nfs_lookup of \"%s\" failed at \"%s\": %d\n", ferr("ERROR: fs_lookup of \"%s\" failed at \"%s\": %d\n",
relpath, filename, error); relpath, filename, error);
return error; return error;
} }

View File

@ -357,7 +357,7 @@ static int nfs_filecreate(FAR struct nfsmount *nmp, struct nfsnode *np,
tmp = *ptr; /* handle_follows */ tmp = *ptr; /* handle_follows */
if (!tmp) if (!tmp)
{ {
ferr("WARNING: no file attributes\n"); fwarn"WARNING: no file attributes\n");
} }
else else
{ {
@ -790,7 +790,7 @@ static ssize_t nfs_read(FAR struct file *filep, char *buffer, size_t buflen)
error = nfs_checkmount(nmp); error = nfs_checkmount(nmp);
if (error != OK) if (error != OK)
{ {
ferr("nfs_checkmount failed: %d\n", error); ferr("ERROR: nfs_checkmount failed: %d\n", error);
goto errout_with_semaphore; goto errout_with_semaphore;
} }
@ -966,7 +966,7 @@ static ssize_t nfs_write(FAR struct file *filep, const char *buffer,
error = nfs_checkmount(nmp); error = nfs_checkmount(nmp);
if (error != OK) if (error != OK)
{ {
ferr("nfs_checkmount failed: %d\n", error); ferr("ERROR: nfs_checkmount failed: %d\n", error);
goto errout_with_semaphore; goto errout_with_semaphore;
} }
@ -1449,7 +1449,7 @@ static int nfs_readdir(struct inode *mountpt, struct fs_dirent_s *dir)
error = nfs_lookup(nmp, dir->fd_dir.d_name, &fhandle, &obj_attributes, NULL); error = nfs_lookup(nmp, dir->fd_dir.d_name, &fhandle, &obj_attributes, NULL);
if (error != OK) if (error != OK)
{ {
ferr("nfs_lookup failed: %d\n", error); ferr("ERROR: nfs_lookup failed: %d\n", error);
goto errout_with_semaphore; goto errout_with_semaphore;
} }

View File

@ -554,7 +554,7 @@ int rpcclnt_connect(struct rpcclnt *rpc)
error = psock_connect(rpc->rc_so, saddr, sizeof(*saddr)); error = psock_connect(rpc->rc_so, saddr, sizeof(*saddr));
if (error) if (error)
{ {
ferr("psock_connect NFS port returns %d\n", error); ferr("ERROR: psock_connect NFS port returns %d\n", error);
goto bad; goto bad;
} }
@ -766,11 +766,11 @@ int rpcclnt_request(FAR struct rpcclnt *rpc, int procnum, int prog,
switch (tmp) switch (tmp)
{ {
case RPC_MISMATCH: case RPC_MISMATCH:
ferr("RPC_MSGDENIED: RPC_MISMATCH error\n"); ferr(ERROR: RPC_MSGDENIED: RPC_MISMATCH error\n");
return EOPNOTSUPP; return EOPNOTSUPP;
case RPC_AUTHERR: case RPC_AUTHERR:
ferr("RPC_MSGDENIED: RPC_AUTHERR error\n"); ferr("ERROR: RPC_MSGDENIED: RPC_AUTHERR error\n");
return EACCES; return EACCES;
default: default:
@ -789,12 +789,12 @@ int rpcclnt_request(FAR struct rpcclnt *rpc, int procnum, int prog,
} }
else if (tmp == RPC_PROGMISMATCH) else if (tmp == RPC_PROGMISMATCH)
{ {
ferr("RPC_MSGACCEPTED: RPC_PROGMISMATCH error\n"); ferr("ERROR: RPC_MSGACCEPTED: RPC_PROGMISMATCH error\n");
return EOPNOTSUPP; return EOPNOTSUPP;
} }
else if (tmp > 5) else if (tmp > 5)
{ {
ferr("ERROR: Other RPC type: %d\n", tmp); ferr("ERROR: Unsupported RPC type: %d\n", tmp);
return EOPNOTSUPP; return EOPNOTSUPP;
} }

View File

@ -147,11 +147,11 @@ int nxffs_blockstats(FAR struct nxffs_volume_s *volume,
} }
} }
ferr("Number blocks: %d\n", stats->nblocks); finfo("Number blocks: %d\n", stats->nblocks);
ferr(" Good blocks: %d\n", stats->ngood); finfo(" Good blocks: %d\n", stats->ngood);
ferr(" Bad blocks: %d\n", stats->nbad); finfo(" Bad blocks: %d\n", stats->nbad);
ferr(" Unformatted blocks: %d\n", stats->nunformat); finfo(" Unformatted blocks: %d\n", stats->nunformat);
ferr(" Corrupt blocks: %d\n", stats->ncorrupt); finfo(" Corrupt blocks: %d\n", stats->ncorrupt);
#else #else
for (ioblock = 0; ioblock < volume->nblocks; ioblock++) for (ioblock = 0; ioblock < volume->nblocks; ioblock++)
@ -221,12 +221,12 @@ int nxffs_blockstats(FAR struct nxffs_volume_s *volume,
} }
} }
ferr("Number blocks: %d\n", stats->nblocks); finfo("Number blocks: %d\n", stats->nblocks);
ferr(" Good blocks: %d\n", stats->ngood); finfo(" Good blocks: %d\n", stats->ngood);
ferr(" Bad blocks: %d\n", stats->nbad); finfo(" Bad blocks: %d\n", stats->nbad);
ferr(" Unformatted blocks: %d\n", stats->nunformat); finfo(" Unformatted blocks: %d\n", stats->nunformat);
ferr(" Corrupt blocks: %d\n", stats->ncorrupt); finfo(" Corrupt blocks: %d\n", stats->ncorrupt);
ferr(" Unreadable blocks: %d\n", stats->nbadread); finfo(" Unreadable blocks: %d\n", stats->nbadread);
#endif #endif
return OK; return OK;

View File

@ -274,7 +274,7 @@ int nxffs_initialize(FAR struct mtd_dev_s *mtd)
/* We may need to format the volume. Try that before giving up. */ /* We may need to format the volume. Try that before giving up. */
ferr("WARNING: Failed to calculate file system limits: %d\n", -ret); fwarn("WARNING: Failed to calculate file system limits: %d\n", -ret);
ret = nxffs_reformat(volume); ret = nxffs_reformat(volume);
if (ret < 0) if (ret < 0)
{ {

View File

@ -169,7 +169,7 @@ static int romfs_open(FAR struct file *filep, FAR const char *relpath,
ret = romfs_checkmount(rm); ret = romfs_checkmount(rm);
if (ret != OK) if (ret != OK)
{ {
ferr("romfs_checkmount failed: %d\n", ret); ferr("ERROR: romfs_checkmount failed: %d\n", ret);
goto errout_with_semaphore; goto errout_with_semaphore;
} }
@ -179,7 +179,7 @@ static int romfs_open(FAR struct file *filep, FAR const char *relpath,
if ((oflags & O_WRONLY) != 0 || (oflags & O_RDONLY) == 0) if ((oflags & O_WRONLY) != 0 || (oflags & O_RDONLY) == 0)
{ {
ferr("Only O_RDONLY supported\n"); ferr("ERROR: Only O_RDONLY supported\n");
ret = -EACCES; ret = -EACCES;
goto errout_with_semaphore; goto errout_with_semaphore;
} }
@ -193,7 +193,7 @@ static int romfs_open(FAR struct file *filep, FAR const char *relpath,
ret = romfs_finddirentry(rm, &dirinfo, relpath); ret = romfs_finddirentry(rm, &dirinfo, relpath);
if (ret < 0) if (ret < 0)
{ {
ferr("Failed to find directory directory entry for '%s': %d\n", ferr("ERROR: Failed to find directory directory entry for '%s': %d\n",
relpath, ret); relpath, ret);
goto errout_with_semaphore; goto errout_with_semaphore;
} }
@ -207,7 +207,7 @@ static int romfs_open(FAR struct file *filep, FAR const char *relpath,
/* It is a directory */ /* It is a directory */
ret = -EISDIR; ret = -EISDIR;
ferr("'%s' is a directory\n", relpath); ferr("ERROR: '%s' is a directory\n", relpath);
goto errout_with_semaphore; goto errout_with_semaphore;
} }
@ -222,7 +222,7 @@ static int romfs_open(FAR struct file *filep, FAR const char *relpath,
rf = (FAR struct romfs_file_s *)kmm_zalloc(sizeof(struct romfs_file_s)); rf = (FAR struct romfs_file_s *)kmm_zalloc(sizeof(struct romfs_file_s));
if (!rf) if (!rf)
{ {
ferr("Failed to allocate private data\n", ret); ferr("ERROR: Failed to allocate private data\n", ret);
ret = -ENOMEM; ret = -ENOMEM;
goto errout_with_semaphore; goto errout_with_semaphore;
} }
@ -239,7 +239,7 @@ static int romfs_open(FAR struct file *filep, FAR const char *relpath,
&rf->rf_startoffset); &rf->rf_startoffset);
if (ret < 0) if (ret < 0)
{ {
ferr("Failed to locate start of file data: %d\n", ret); ferr("ERROR: Failed to locate start of file data: %d\n", ret);
goto errout_with_semaphore; goto errout_with_semaphore;
} }
@ -248,7 +248,7 @@ static int romfs_open(FAR struct file *filep, FAR const char *relpath,
ret = romfs_fileconfigure(rm, rf); ret = romfs_fileconfigure(rm, rf);
if (ret < 0) if (ret < 0)
{ {
ferr("Failed configure buffering: %d\n", ret); ferr("ERROR: Failed configure buffering: %d\n", ret);
goto errout_with_semaphore; goto errout_with_semaphore;
} }
@ -359,7 +359,7 @@ static ssize_t romfs_read(FAR struct file *filep, FAR char *buffer,
ret = romfs_checkmount(rm); ret = romfs_checkmount(rm);
if (ret != OK) if (ret != OK)
{ {
ferr("romfs_checkmount failed: %d\n", ret); ferr("ERROR: romfs_checkmount failed: %d\n", ret);
goto errout_with_semaphore; goto errout_with_semaphore;
} }
@ -408,7 +408,7 @@ static ssize_t romfs_read(FAR struct file *filep, FAR char *buffer,
ret = romfs_hwread(rm, userbuffer, sector, nsectors); ret = romfs_hwread(rm, userbuffer, sector, nsectors);
if (ret < 0) if (ret < 0)
{ {
ferr("romfs_hwread failed: %d\n", ret); ferr("ERROR: romfs_hwread failed: %d\n", ret);
goto errout_with_semaphore; goto errout_with_semaphore;
} }
@ -426,7 +426,7 @@ static ssize_t romfs_read(FAR struct file *filep, FAR char *buffer,
ret = romfs_filecacheread(rm, rf, sector); ret = romfs_filecacheread(rm, rf, sector);
if (ret < 0) if (ret < 0)
{ {
ferr("romfs_filecacheread failed: %d\n", ret); ferr("ERROR: romfs_filecacheread failed: %d\n", ret);
goto errout_with_semaphore; goto errout_with_semaphore;
} }
@ -511,7 +511,7 @@ static off_t romfs_seek(FAR struct file *filep, off_t offset, int whence)
break; break;
default: default:
ferr("Whence is invalid: %d\n", whence); ferr("ERROR: Whence is invalid: %d\n", whence);
return -EINVAL; return -EINVAL;
} }
@ -521,7 +521,7 @@ static off_t romfs_seek(FAR struct file *filep, off_t offset, int whence)
ret = romfs_checkmount(rm); ret = romfs_checkmount(rm);
if (ret != OK) if (ret != OK)
{ {
ferr("romfs_checkmount failed: %d\n", ret); ferr("ERROR: romfs_checkmount failed: %d\n", ret);
goto errout_with_semaphore; goto errout_with_semaphore;
} }
@ -582,7 +582,7 @@ static int romfs_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
return OK; return OK;
} }
ferr("Invalid cmd: %d \n", cmd); ferr("ERROR: Invalid cmd: %d \n", cmd);
return -ENOTTY; return -ENOTTY;
} }
@ -618,7 +618,7 @@ static int romfs_dup(FAR const struct file *oldp, FAR struct file *newp)
ret = romfs_checkmount(rm); ret = romfs_checkmount(rm);
if (ret != OK) if (ret != OK)
{ {
ferr("romfs_checkmount failed: %d\n", ret); ferr("ERROR: romfs_checkmount failed: %d\n", ret);
goto errout_with_semaphore; goto errout_with_semaphore;
} }
@ -633,7 +633,7 @@ static int romfs_dup(FAR const struct file *oldp, FAR struct file *newp)
newrf = (FAR struct romfs_file_s *)kmm_malloc(sizeof(struct romfs_file_s)); newrf = (FAR struct romfs_file_s *)kmm_malloc(sizeof(struct romfs_file_s));
if (!newrf) if (!newrf)
{ {
ferr("Failed to allocate private data\n", ret); ferr("ERROR: Failed to allocate private data\n", ret);
ret = -ENOMEM; ret = -ENOMEM;
goto errout_with_semaphore; goto errout_with_semaphore;
} }
@ -649,7 +649,7 @@ static int romfs_dup(FAR const struct file *oldp, FAR struct file *newp)
if (ret < 0) if (ret < 0)
{ {
kmm_free(newrf); kmm_free(newrf);
ferr("Failed configure buffering: %d\n", ret); ferr("ERROR: Failed configure buffering: %d\n", ret);
goto errout_with_semaphore; goto errout_with_semaphore;
} }
@ -707,7 +707,7 @@ static int romfs_opendir(FAR struct inode *mountpt, FAR const char *relpath,
ret = romfs_checkmount(rm); ret = romfs_checkmount(rm);
if (ret != OK) if (ret != OK)
{ {
ferr("romfs_checkmount failed: %d\n", ret); ferr("ERROR: romfs_checkmount failed: %d\n", ret);
goto errout_with_semaphore; goto errout_with_semaphore;
} }
@ -716,7 +716,7 @@ static int romfs_opendir(FAR struct inode *mountpt, FAR const char *relpath,
ret = romfs_finddirentry(rm, &dirinfo, relpath); ret = romfs_finddirentry(rm, &dirinfo, relpath);
if (ret < 0) if (ret < 0)
{ {
ferr("Failed to find directory '%s': %d\n", relpath, ret); ferr("ERROR: Failed to find directory '%s': %d\n", relpath, ret);
goto errout_with_semaphore; goto errout_with_semaphore;
} }
@ -726,7 +726,7 @@ static int romfs_opendir(FAR struct inode *mountpt, FAR const char *relpath,
{ {
/* The entry is not a directory */ /* The entry is not a directory */
ferr("'%s' is not a directory: %d\n", relpath); ferr("ERROR: '%s' is not a directory: %d\n", relpath);
ret = -ENOTDIR; ret = -ENOTDIR;
goto errout_with_semaphore; goto errout_with_semaphore;
} }
@ -775,7 +775,7 @@ static int romfs_readdir(FAR struct inode *mountpt,
ret = romfs_checkmount(rm); ret = romfs_checkmount(rm);
if (ret != OK) if (ret != OK)
{ {
ferr("romfs_checkmount failed: %d\n", ret); ferr("ERROR: omfs_checkmount failed: %d\n", ret);
goto errout_with_semaphore; goto errout_with_semaphore;
} }
@ -791,7 +791,7 @@ static int romfs_readdir(FAR struct inode *mountpt,
* special error -ENOENT * special error -ENOENT
*/ */
ferr("End of directory\n"); finfo("End of directory\n");
ret = -ENOENT; ret = -ENOENT;
goto errout_with_semaphore; goto errout_with_semaphore;
} }
@ -802,7 +802,7 @@ static int romfs_readdir(FAR struct inode *mountpt,
&next, &info, &size); &next, &info, &size);
if (ret < 0) if (ret < 0)
{ {
ferr("romfs_parsedirentry failed: %d\n", ret); ferr("ERROR: romfs_parsedirentry failed: %d\n", ret);
goto errout_with_semaphore; goto errout_with_semaphore;
} }
@ -811,7 +811,7 @@ static int romfs_readdir(FAR struct inode *mountpt,
ret = romfs_parsefilename(rm, dir->u.romfs.fr_curroffset, dir->fd_dir.d_name); ret = romfs_parsefilename(rm, dir->u.romfs.fr_curroffset, dir->fd_dir.d_name);
if (ret < 0) if (ret < 0)
{ {
ferr("romfs_parsefilename failed: %d\n", ret); ferr("ERROR: romfs_parsefilename failed: %d\n", ret);
goto errout_with_semaphore; goto errout_with_semaphore;
} }
@ -897,14 +897,14 @@ static int romfs_bind(FAR struct inode *blkdriver, FAR const void *data,
if (!blkdriver || !blkdriver->u.i_bops) if (!blkdriver || !blkdriver->u.i_bops)
{ {
ferr("No block driver/ops\n"); ferr("ERROR: No block driver/ops\n");
return -ENODEV; return -ENODEV;
} }
if (blkdriver->u.i_bops->open && if (blkdriver->u.i_bops->open &&
blkdriver->u.i_bops->open(blkdriver) != OK) blkdriver->u.i_bops->open(blkdriver) != OK)
{ {
ferr("No open method\n"); ferr("ERROR: No open method\n");
return -ENODEV; return -ENODEV;
} }
@ -913,7 +913,7 @@ static int romfs_bind(FAR struct inode *blkdriver, FAR const void *data,
rm = (FAR struct romfs_mountpt_s *)kmm_zalloc(sizeof(struct romfs_mountpt_s)); rm = (FAR struct romfs_mountpt_s *)kmm_zalloc(sizeof(struct romfs_mountpt_s));
if (!rm) if (!rm)
{ {
ferr("Failed to allocate mountpoint structure\n"); ferr("ERROR: Failed to allocate mountpoint structure\n");
return -ENOMEM; return -ENOMEM;
} }
@ -930,7 +930,7 @@ static int romfs_bind(FAR struct inode *blkdriver, FAR const void *data,
ret = romfs_hwconfigure(rm); ret = romfs_hwconfigure(rm);
if (ret < 0) if (ret < 0)
{ {
ferr("romfs_hwconfigure failed: %d\n", ret); ferr("ERROR: romfs_hwconfigure failed: %d\n", ret);
goto errout_with_sem; goto errout_with_sem;
} }
@ -941,7 +941,7 @@ static int romfs_bind(FAR struct inode *blkdriver, FAR const void *data,
ret = romfs_fsconfigure(rm); ret = romfs_fsconfigure(rm);
if (ret < 0) if (ret < 0)
{ {
ferr("romfs_fsconfigure failed: %d\n", ret); ferr("ERROR: romfs_fsconfigure failed: %d\n", ret);
goto errout_with_buffer; goto errout_with_buffer;
} }
@ -993,7 +993,7 @@ static int romfs_unbind(FAR void *handle, FAR struct inode **blkdriver,
{ {
/* We cannot unmount now.. there are open files */ /* We cannot unmount now.. there are open files */
ferr("There are open files\n"); fwarn("WARNING: There are open files\n");
/* This implementation currently only supports unmounting if there are /* This implementation currently only supports unmounting if there are
* no open file references. * no open file references.
@ -1072,7 +1072,7 @@ static int romfs_statfs(FAR struct inode *mountpt, FAR struct statfs *buf)
ret = romfs_checkmount(rm); ret = romfs_checkmount(rm);
if (ret < 0) if (ret < 0)
{ {
ferr("romfs_checkmount failed: %d\n", ret); ferr("ERROR: romfs_checkmount failed: %d\n", ret);
goto errout_with_semaphore; goto errout_with_semaphore;
} }
@ -1130,7 +1130,7 @@ static int romfs_stat(FAR struct inode *mountpt, FAR const char *relpath,
ret = romfs_checkmount(rm); ret = romfs_checkmount(rm);
if (ret != OK) if (ret != OK)
{ {
ferr("romfs_checkmount failed: %d\n", ret); ferr("ERROR: romfs_checkmount failed: %d\n", ret);
goto errout_with_semaphore; goto errout_with_semaphore;
} }

View File

@ -467,7 +467,7 @@ int romfs_filecacheread(struct romfs_mountpt_s *rm, struct romfs_file_s *rf,
ret = romfs_hwread(rm, rf->rf_buffer, sector, 1); ret = romfs_hwread(rm, rf->rf_buffer, sector, 1);
if (ret < 0) if (ret < 0)
{ {
ferr("romfs_hwread failed: %d\n", ret); ferr("ERROR: romfs_hwread failed: %d\n", ret);
return ret; return ret;
} }
} }

View File

@ -505,7 +505,8 @@ static ssize_t smartfs_read(FAR struct file *filep, char *buffer, size_t buflen)
ret = FS_IOCTL(fs, BIOC_READSECT, (unsigned long) &readwrite); ret = FS_IOCTL(fs, BIOC_READSECT, (unsigned long) &readwrite);
if (ret < 0) if (ret < 0)
{ {
ferr("Error %d reading sector %d data\n", ret, sf->currsector); ferr("ERROR: Error %d reading sector %d data\n",
ret, sf->currsector);
goto errout_with_semaphore; goto errout_with_semaphore;
} }
@ -614,7 +615,8 @@ static int smartfs_sync_internal(struct smartfs_mountpt_s *fs,
ret = FS_IOCTL(fs, BIOC_WRITESECT, (unsigned long) &readwrite); ret = FS_IOCTL(fs, BIOC_WRITESECT, (unsigned long) &readwrite);
if (ret < 0) if (ret < 0)
{ {
ferr("Error %d writing used bytes for sector %d\n", ret, sf->currsector); ferr("ERROR: Error %d writing used bytes for sector %d\n",
ret, sf->currsector);
goto errout; goto errout;
} }
@ -639,7 +641,8 @@ static int smartfs_sync_internal(struct smartfs_mountpt_s *fs,
ret = FS_IOCTL(fs, BIOC_READSECT, (unsigned long) &readwrite); ret = FS_IOCTL(fs, BIOC_READSECT, (unsigned long) &readwrite);
if (ret < 0) if (ret < 0)
{ {
ferr("Error %d reading sector %d data\n", ret, sf->currsector); ferr("ERROR: Error %d reading sector %d data\n",
ret, sf->currsector);
goto errout; goto errout;
} }
@ -661,7 +664,8 @@ static int smartfs_sync_internal(struct smartfs_mountpt_s *fs,
ret = FS_IOCTL(fs, BIOC_WRITESECT, (unsigned long) &readwrite); ret = FS_IOCTL(fs, BIOC_WRITESECT, (unsigned long) &readwrite);
if (ret < 0) if (ret < 0)
{ {
ferr("Error %d writing used bytes for sector %d\n", ret, sf->currsector); ferr("ERROR: Error %d writing used bytes for sector %d\n",
ret, sf->currsector);
goto errout; goto errout;
} }
@ -766,7 +770,8 @@ static ssize_t smartfs_write(FAR struct file *filep, const char *buffer,
ret = FS_IOCTL(fs, BIOC_WRITESECT, (unsigned long) &readwrite); ret = FS_IOCTL(fs, BIOC_WRITESECT, (unsigned long) &readwrite);
if (ret < 0) if (ret < 0)
{ {
ferr("Error %d writing sector %d data\n", ret, sf->currsector); ferr("ERROR: Error %d writing sector %d data\n",
et, sf->currsector);
goto errout_with_semaphore; goto errout_with_semaphore;
} }
@ -793,7 +798,8 @@ static ssize_t smartfs_write(FAR struct file *filep, const char *buffer,
ret = FS_IOCTL(fs, BIOC_READSECT, (unsigned long) &readwrite); ret = FS_IOCTL(fs, BIOC_READSECT, (unsigned long) &readwrite);
if (ret < 0) if (ret < 0)
{ {
ferr("Error %d reading sector %d header\n", ret, sf->currsector); ferr("ERROR: Error %d reading sector %d header\n",
ret, sf->currsector);
goto errout_with_semaphore; goto errout_with_semaphore;
} }
@ -841,7 +847,8 @@ static ssize_t smartfs_write(FAR struct file *filep, const char *buffer,
ret = FS_IOCTL(fs, BIOC_WRITESECT, (unsigned long) &readwrite); ret = FS_IOCTL(fs, BIOC_WRITESECT, (unsigned long) &readwrite);
if (ret < 0) if (ret < 0)
{ {
ferr("Error %d writing sector %d data\n", ret, sf->currsector); ferr("ERROR: Error %d writing sector %d data\n",
ret, sf->currsector);
goto errout_with_semaphore; goto errout_with_semaphore;
} }
} }
@ -867,7 +874,7 @@ static ssize_t smartfs_write(FAR struct file *filep, const char *buffer,
ret = FS_IOCTL(fs, BIOC_ALLOCSECT, 0xFFFF); ret = FS_IOCTL(fs, BIOC_ALLOCSECT, 0xFFFF);
if (ret < 0) if (ret < 0)
{ {
ferr("Error %d allocating new sector\n", ret); ferr("ERROR: Error %d allocating new sector\n", ret);
goto errout_with_semaphore; goto errout_with_semaphore;
} }
@ -892,7 +899,7 @@ static ssize_t smartfs_write(FAR struct file *filep, const char *buffer,
{ {
/* Error allocating logical sector! */ /* Error allocating logical sector! */
ferr("Error - duplicate logical sector %d\n", sf->currsector); ferr("ERROR: Duplicate logical sector %d\n", sf->currsector);
} }
sf->bflags = SMARTFS_BFLAG_DIRTY; sf->bflags = SMARTFS_BFLAG_DIRTY;
@ -922,7 +929,7 @@ static ssize_t smartfs_write(FAR struct file *filep, const char *buffer,
ret = FS_IOCTL(fs, BIOC_ALLOCSECT, 0xFFFF); ret = FS_IOCTL(fs, BIOC_ALLOCSECT, 0xFFFF);
if (ret < 0) if (ret < 0)
{ {
ferr("Error %d allocating new sector\n", ret); ferr("ERROR: Error %d allocating new sector\n", ret);
goto errout_with_semaphore; goto errout_with_semaphore;
} }
@ -937,7 +944,7 @@ static ssize_t smartfs_write(FAR struct file *filep, const char *buffer,
ret = FS_IOCTL(fs, BIOC_WRITESECT, (unsigned long) &readwrite); ret = FS_IOCTL(fs, BIOC_WRITESECT, (unsigned long) &readwrite);
if (ret < 0) if (ret < 0)
{ {
ferr("Error %d writing next sector\n", ret); ferr("ERROR: Error %d writing next sector\n", ret);
goto errout_with_semaphore; goto errout_with_semaphore;
} }
@ -949,7 +956,7 @@ static ssize_t smartfs_write(FAR struct file *filep, const char *buffer,
{ {
/* Error allocating logical sector! */ /* Error allocating logical sector! */
ferr("Error - duplicate logical sector %d\n", sf->currsector); ferr("ERROR: Duplicate logical sector %d\n", sf->currsector);
} }
sf->currsector = SMARTFS_NEXTSECTOR(header); sf->currsector = SMARTFS_NEXTSECTOR(header);
@ -1078,7 +1085,8 @@ static off_t smartfs_seek_internal(struct smartfs_mountpt_s *fs,
ret = FS_IOCTL(fs, BIOC_READSECT, (unsigned long) &readwrite); ret = FS_IOCTL(fs, BIOC_READSECT, (unsigned long) &readwrite);
if (ret < 0) if (ret < 0)
{ {
ferr("Error %d reading sector %d header\n", ret, sf->currsector); ferr("ERROR: Error %d reading sector %d header\n",
ret, sf->currsector);
goto errout; goto errout;
} }
@ -1103,7 +1111,8 @@ static off_t smartfs_seek_internal(struct smartfs_mountpt_s *fs,
ret = FS_IOCTL(fs, BIOC_READSECT, (unsigned long) &readwrite); ret = FS_IOCTL(fs, BIOC_READSECT, (unsigned long) &readwrite);
if (ret < 0) if (ret < 0)
{ {
ferr("Error %d reading sector %d header\n", ret, sf->currsector); ferr("ERROR: Error %d reading sector %d header\n",
ret, sf->currsector);
goto errout; goto errout;
} }
} }
@ -1933,7 +1942,8 @@ int smartfs_rename(struct inode *mountpt, const char *oldrelpath,
ret = FS_IOCTL(fs, BIOC_READSECT, (unsigned long) &readwrite); ret = FS_IOCTL(fs, BIOC_READSECT, (unsigned long) &readwrite);
if (ret < 0) if (ret < 0)
{ {
ferr("Error %d reading sector %d data\n", ret, oldentry.dsector); ferr("ERROR: Error %d reading sector %d data\n",
ret, oldentry.dsector);
goto errout_with_semaphore; goto errout_with_semaphore;
} }
@ -2005,7 +2015,8 @@ int smartfs_rename(struct inode *mountpt, const char *oldrelpath,
ret = FS_IOCTL(fs, BIOC_READSECT, (unsigned long) &readwrite); ret = FS_IOCTL(fs, BIOC_READSECT, (unsigned long) &readwrite);
if (ret < 0) if (ret < 0)
{ {
ferr("Error %d reading sector %d data\n", ret, oldentry.dsector); ferr("ERROR: Error %d reading sector %d data\n",
ret, oldentry.dsector);
goto errout_with_semaphore; goto errout_with_semaphore;
} }
@ -2024,7 +2035,8 @@ int smartfs_rename(struct inode *mountpt, const char *oldrelpath,
ret = FS_IOCTL(fs, BIOC_WRITESECT, (unsigned long) &readwrite); ret = FS_IOCTL(fs, BIOC_WRITESECT, (unsigned long) &readwrite);
if (ret < 0) if (ret < 0)
{ {
ferr("Error %d writing flag bytes for sector %d\n", ret, readwrite.logsector); ferr("ERROR: Error %d writing flag bytes for sector %d\n",
ret, readwrite.logsector);
goto errout_with_semaphore; goto errout_with_semaphore;
} }
} }

View File

@ -231,7 +231,7 @@ int smartfs_mount(struct smartfs_mountpt_s *fs, bool writeable)
ret = FS_IOCTL(fs, BIOC_GETFORMAT, (unsigned long) &fs->fs_llformat); ret = FS_IOCTL(fs, BIOC_GETFORMAT, (unsigned long) &fs->fs_llformat);
if (ret != OK) if (ret != OK)
{ {
ferr("Error getting device low level format: %d\n", ret); ferr("ERROR: Error getting device low level format: %d\n", ret);
goto errout; goto errout;
} }
@ -239,7 +239,7 @@ int smartfs_mount(struct smartfs_mountpt_s *fs, bool writeable)
if (!(fs->fs_llformat.flags & SMART_FMT_ISFORMATTED)) if (!(fs->fs_llformat.flags & SMART_FMT_ISFORMATTED))
{ {
ferr("No low-level format found\n"); ferr("ERROR: No low-level format found\n");
ret = -ENODEV; ret = -ENODEV;
goto errout; goto errout;
} }
@ -311,16 +311,16 @@ int smartfs_mount(struct smartfs_mountpt_s *fs, bool writeable)
fs->fs_mounted = TRUE; fs->fs_mounted = TRUE;
ferr("SMARTFS:\n"); finfo("SMARTFS:\n");
ferr("\t Sector size: %d\n", fs->fs_llformat.sectorsize); finfo("\t Sector size: %d\n", fs->fs_llformat.sectorsize);
ferr("\t Bytes/sector %d\n", fs->fs_llformat.availbytes); finfo("\t Bytes/sector %d\n", fs->fs_llformat.availbytes);
ferr("\t Num sectors: %d\n", fs->fs_llformat.nsectors); finfo("\t Num sectors: %d\n", fs->fs_llformat.nsectors);
ferr("\t Free sectors: %d\n", fs->fs_llformat.nfreesectors); finfo("\t Free sectors: %d\n", fs->fs_llformat.nfreesectors);
ferr("\t Max filename: %d\n", CONFIG_SMARTFS_MAXNAMLEN); finfo("\t Max filename: %d\n", CONFIG_SMARTFS_MAXNAMLEN);
#ifdef CONFIG_SMARTFS_MULTI_ROOT_DIRS #ifdef CONFIG_SMARTFS_MULTI_ROOT_DIRS
ferr("\t RootDirEntries: %d\n", fs->fs_llformat.nrootdirentries); finfo("\t RootDirEntries: %d\n", fs->fs_llformat.nrootdirentries);
#endif #endif
ferr("\t RootDirSector: %d\n", fs->fs_rootsector); finfo("\t RootDirSector: %d\n", fs->fs_rootsector);
errout: errout:
return ret; return ret;
@ -695,10 +695,12 @@ int smartfs_finddirentry(struct smartfs_mountpt_s *fs,
/* Read the next sector of the file */ /* Read the next sector of the file */
readwrite.logsector = dirsector; readwrite.logsector = dirsector;
ret = FS_IOCTL(fs, BIOC_READSECT, (unsigned long) &readwrite); ret = FS_IOCTL(fs, BIOC_READSECT,
(unsigned long) &readwrite);
if (ret < 0) if (ret < 0)
{ {
ferr("Error in sector chain at %d!\n", dirsector); ferr("ERROR: Error in sector chain at %d!\n",
dirsector);
break; break;
} }
@ -937,7 +939,7 @@ int smartfs_createentry(FAR struct smartfs_mountpt_s *fs,
ret = FS_IOCTL(fs, BIOC_WRITESECT, (unsigned long) &readwrite); ret = FS_IOCTL(fs, BIOC_WRITESECT, (unsigned long) &readwrite);
if (ret < 0) if (ret < 0)
{ {
ferr("Error chaining sector %d\n", nextsector); ferr("ERROR: Error chaining sector %d\n", nextsector);
goto errout; goto errout;
} }
} }
@ -1014,7 +1016,7 @@ int smartfs_createentry(FAR struct smartfs_mountpt_s *fs,
ret = FS_IOCTL(fs, BIOC_WRITESECT, (unsigned long) &readwrite); ret = FS_IOCTL(fs, BIOC_WRITESECT, (unsigned long) &readwrite);
if (ret < 0) if (ret < 0)
{ {
ferr("Error %d setting new sector type for sector %d\n", ferr("ERROR: Error %d setting new sector type for sector %d\n",
ret, nextsector); ret, nextsector);
goto errout; goto errout;
} }
@ -1129,7 +1131,7 @@ int smartfs_deleteentry(struct smartfs_mountpt_s *fs,
ret = FS_IOCTL(fs, BIOC_READSECT, (unsigned long) &readwrite); ret = FS_IOCTL(fs, BIOC_READSECT, (unsigned long) &readwrite);
if (ret < 0) if (ret < 0)
{ {
ferr("Error reading sector %d\n", nextsector); ferr("ERROR: Error reading sector %d\n", nextsector);
break; break;
} }
@ -1148,7 +1150,8 @@ int smartfs_deleteentry(struct smartfs_mountpt_s *fs,
ret = FS_IOCTL(fs, BIOC_READSECT, (unsigned long) &readwrite); ret = FS_IOCTL(fs, BIOC_READSECT, (unsigned long) &readwrite);
if (ret < 0) if (ret < 0)
{ {
ferr("Error reading directory info at sector %d\n", entry->dsector); ferr("ERROR: Error reading directory info at sector %d\n",
entry->dsector);
goto errout; goto errout;
} }
@ -1177,7 +1180,8 @@ int smartfs_deleteentry(struct smartfs_mountpt_s *fs,
ret = FS_IOCTL(fs, BIOC_WRITESECT, (unsigned long) &readwrite); ret = FS_IOCTL(fs, BIOC_WRITESECT, (unsigned long) &readwrite);
if (ret < 0) if (ret < 0)
{ {
ferr("Error marking entry inactive at sector %d\n", entry->dsector); ferr("ERROR: Error marking entry inactive at sector %d\n",
entry->dsector);
goto errout; goto errout;
} }
@ -1242,7 +1246,7 @@ int smartfs_deleteentry(struct smartfs_mountpt_s *fs,
ret = FS_IOCTL(fs, BIOC_READSECT, (unsigned long) &readwrite); ret = FS_IOCTL(fs, BIOC_READSECT, (unsigned long) &readwrite);
if (ret < 0) if (ret < 0)
{ {
ferr("Error reading sector %d\n", nextsector); ferr("ERROR: Error reading sector %d\n", nextsector);
break; break;
} }
@ -1259,7 +1263,7 @@ int smartfs_deleteentry(struct smartfs_mountpt_s *fs,
ret = FS_IOCTL(fs, BIOC_WRITESECT, (unsigned long) &readwrite); ret = FS_IOCTL(fs, BIOC_WRITESECT, (unsigned long) &readwrite);
if (ret < 0) if (ret < 0)
{ {
ferr("Error unchaining sector (%d)\n", nextsector); ferr("ERROR: Error unchaining sector (%d)\n", nextsector);
goto errout; goto errout;
} }
@ -1268,7 +1272,7 @@ int smartfs_deleteentry(struct smartfs_mountpt_s *fs,
ret = FS_IOCTL(fs, BIOC_FREESECT, (unsigned long) entry->dsector); ret = FS_IOCTL(fs, BIOC_FREESECT, (unsigned long) entry->dsector);
if (ret < 0) if (ret < 0)
{ {
ferr("Error freeing sector %d\n", entry->dsector); ferr("ERROR: Error freeing sector %d\n", entry->dsector);
goto errout; goto errout;
} }
@ -1327,7 +1331,7 @@ int smartfs_countdirentries(struct smartfs_mountpt_s *fs,
ret = FS_IOCTL(fs, BIOC_READSECT, (unsigned long) &readwrite); ret = FS_IOCTL(fs, BIOC_READSECT, (unsigned long) &readwrite);
if (ret < 0) if (ret < 0)
{ {
ferr("Error reading sector %d\n", nextsector); ferr("ERROR: Error reading sector %d\n", nextsector);
break; break;
} }
@ -1336,7 +1340,7 @@ int smartfs_countdirentries(struct smartfs_mountpt_s *fs,
header = (struct smartfs_chain_header_s *) fs->fs_rwbuffer; header = (struct smartfs_chain_header_s *) fs->fs_rwbuffer;
if (header->type != SMARTFS_SECTOR_TYPE_DIR) if (header->type != SMARTFS_SECTOR_TYPE_DIR)
{ {
ferr("Sector %d is not a DIR sector!\n", nextsector); ferr("ERROR: Sector %d is not a DIR sector!\n", nextsector);
goto errout; goto errout;
} }
@ -1411,7 +1415,7 @@ int smartfs_truncatefile(struct smartfs_mountpt_s *fs,
ret = FS_IOCTL(fs, BIOC_READSECT, (unsigned long) &readwrite); ret = FS_IOCTL(fs, BIOC_READSECT, (unsigned long) &readwrite);
if (ret < 0) if (ret < 0)
{ {
ferr("Error reading sector %d header\n", nextsector); ferr("ERROR: Error reading sector %d header\n", nextsector);
goto errout; goto errout;
} }
@ -1447,7 +1451,7 @@ int smartfs_truncatefile(struct smartfs_mountpt_s *fs,
ret = FS_IOCTL(fs, BIOC_WRITESECT, (unsigned long) &readwrite); ret = FS_IOCTL(fs, BIOC_WRITESECT, (unsigned long) &readwrite);
if (ret < 0) if (ret < 0)
{ {
ferr("Error blanking 1st sector (%d) of file\n", nextsector); ferr("ERROR: Error blanking 1st sector (%d) of file\n", nextsector);
goto errout; goto errout;
} }
@ -1463,7 +1467,7 @@ int smartfs_truncatefile(struct smartfs_mountpt_s *fs,
ret = FS_IOCTL(fs, BIOC_FREESECT, (unsigned long) nextsector); ret = FS_IOCTL(fs, BIOC_FREESECT, (unsigned long) nextsector);
if (ret < 0) if (ret < 0)
{ {
ferr("Error freeing sector %d\n", nextsector); ferr("ERROR: Error freeing sector %d\n", nextsector);
goto errout; goto errout;
} }
} }

View File

@ -1727,7 +1727,7 @@ static int tmpfs_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
return OK; return OK;
} }
ferr("Invalid cmd: %d\n", cmd); ferr("ERROR: Invalid cmd: %d\n", cmd);
return -ENOTTY; return -ENOTTY;
} }

View File

@ -190,12 +190,12 @@ int epoll_wait(int epfd, FAR struct epoll_event *evs, int maxevents,
{ {
if (rc < 0) if (rc < 0)
{ {
ferr("%08x poll fail: %d for %d, %d msecs\n", ferr("ERROR: %08x poll fail: %d for %d, %d msecs\n",
epfd, rc, eph->occupied, timeout); epfd, rc, eph->occupied, timeout);
for (i = 0; i < eph->occupied; i++) for (i = 0; i < eph->occupied; i++)
{ {
ferr("%02d: fd=%d\n", i, eph->evs[i].data.fd); ferr(" %02d: fd=%d\n", i, eph->evs[i].data.fd);
} }
} }