Cosmetic changes to debug output
This commit is contained in:
parent
0d8ac38e59
commit
7fad495e1d
|
@ -185,6 +185,6 @@ int nxffs_validblock(struct nxffs_volume_s *volume, off_t *block)
|
|||
* valid blocks left in the volume.
|
||||
*/
|
||||
|
||||
fdbg("No valid block found\n");
|
||||
fdbg("ERROR: No valid block found\n");
|
||||
return -ENOSPC;
|
||||
}
|
||||
|
|
|
@ -291,7 +291,7 @@ int nxffs_initialize(FAR struct mtd_dev_s *mtd)
|
|||
|
||||
/* Get statistics on the re-formatted volume */
|
||||
|
||||
#if defined(CONFIG_DEBUG) && defined(CONFIG_DEBUG_FS)
|
||||
#if defined(CONFIG_NXFFS_SCAN_VOLUME) && defined(CONFIG_DEBUG) && defined(CONFIG_DEBUG_FS)
|
||||
ret = nxffs_blockstats(volume, &stats);
|
||||
if (ret < 0)
|
||||
{
|
||||
|
|
|
@ -169,7 +169,7 @@ static int nxffs_rdentry(FAR struct nxffs_volume_s *volume, off_t offset,
|
|||
crc = crc32part((FAR const uint8_t *)entry->name, namlen, crc);
|
||||
if (crc != ecrc)
|
||||
{
|
||||
fdbg("CRC entry: %08x CRC calculated: %08x\n", ecrc, crc);
|
||||
fdbg("ERROR: CRC entry: %08x CRC calculated: %08x\n", ecrc, crc);
|
||||
ret = -EIO;
|
||||
goto errout_with_name;
|
||||
}
|
||||
|
|
|
@ -118,7 +118,7 @@ int nxffs_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
|
|||
|
||||
if (volume->ofiles)
|
||||
{
|
||||
fdbg("Open files\n");
|
||||
fdbg("ERROR: Open files\n");
|
||||
ret = -EBUSY;
|
||||
goto errout_with_semaphore;
|
||||
}
|
||||
|
|
|
@ -437,7 +437,7 @@ static inline int nxffs_wropen(FAR struct nxffs_volume_s *volume,
|
|||
* Limitation: Files cannot be open both for reading and writing.
|
||||
*/
|
||||
|
||||
fdbg("File is open for reading\n");
|
||||
fdbg("ERROR: File is open for reading\n");
|
||||
ret = -ENOSYS;
|
||||
goto errout_with_exclsem;
|
||||
}
|
||||
|
@ -448,7 +448,7 @@ static inline int nxffs_wropen(FAR struct nxffs_volume_s *volume,
|
|||
|
||||
else if ((oflags & (O_CREAT|O_EXCL)) == (O_CREAT|O_EXCL))
|
||||
{
|
||||
fdbg("File exists, can't create O_EXCL\n");
|
||||
fdbg("ERROR: File exists, can't create O_EXCL\n");
|
||||
ret = -EEXIST;
|
||||
goto errout_with_exclsem;
|
||||
}
|
||||
|
@ -474,7 +474,7 @@ static inline int nxffs_wropen(FAR struct nxffs_volume_s *volume,
|
|||
|
||||
else
|
||||
{
|
||||
fdbg("File %s exists and we were not asked to truncate it\n");
|
||||
fdbg("ERROR: File %s exists and we were not asked to truncate it\n");
|
||||
ret = -ENOSYS;
|
||||
goto errout_with_exclsem;
|
||||
}
|
||||
|
@ -486,7 +486,7 @@ static inline int nxffs_wropen(FAR struct nxffs_volume_s *volume,
|
|||
|
||||
if ((oflags & O_CREAT) == 0)
|
||||
{
|
||||
fdbg("Not asked to create the file\n");
|
||||
fdbg("ERROR: Not asked to create the file\n");
|
||||
ret = -ENOENT;
|
||||
goto errout_with_exclsem;
|
||||
}
|
||||
|
@ -496,7 +496,7 @@ static inline int nxffs_wropen(FAR struct nxffs_volume_s *volume,
|
|||
namlen = strlen(name);
|
||||
if (namlen > CONFIG_NXFFS_MAXNAMLEN)
|
||||
{
|
||||
fdbg("Name is too long: %d\n", namlen);
|
||||
fdbg("ERROR: Name is too long: %d\n", namlen);
|
||||
ret = -EINVAL;
|
||||
goto errout_with_exclsem;
|
||||
}
|
||||
|
@ -726,7 +726,7 @@ static inline int nxffs_rdopen(FAR struct nxffs_volume_s *volume,
|
|||
|
||||
if ((ofile->oflags & O_WROK) != 0)
|
||||
{
|
||||
fdbg("File is open for writing\n");
|
||||
fdbg("ERROR: File is open for writing\n");
|
||||
ret = -ENOSYS;
|
||||
goto errout_with_exclsem;
|
||||
}
|
||||
|
@ -734,7 +734,7 @@ static inline int nxffs_rdopen(FAR struct nxffs_volume_s *volume,
|
|||
/* Just increment the reference count on the ofile */
|
||||
|
||||
ofile->crefs++;
|
||||
fdbg("crefs: %d\n", ofile->crefs);
|
||||
fvdbg("crefs: %d\n", ofile->crefs);
|
||||
}
|
||||
|
||||
/* The file has not yet been opened.
|
||||
|
@ -1036,7 +1036,7 @@ int nxffs_open(FAR struct file *filep, FAR const char *relpath,
|
|||
{
|
||||
case 0:
|
||||
default:
|
||||
fdbg("One of O_WRONLY/O_RDONLY must be provided\n");
|
||||
fdbg("ERROR: One of O_WRONLY/O_RDONLY must be provided\n");
|
||||
return -EINVAL;
|
||||
|
||||
case O_WROK:
|
||||
|
@ -1048,7 +1048,7 @@ int nxffs_open(FAR struct file *filep, FAR const char *relpath,
|
|||
break;
|
||||
|
||||
case O_WROK|O_RDOK:
|
||||
fdbg("O_RDWR is not supported\n");
|
||||
fdbg("ERROR: O_RDWR is not supported\n");
|
||||
return -ENOSYS;
|
||||
}
|
||||
|
||||
|
|
|
@ -1423,7 +1423,7 @@ start_pack:
|
|||
* with uncorrectable bit errors.
|
||||
*/
|
||||
|
||||
/* Pack each I/O block */
|
||||
/* Read each I/O block */
|
||||
|
||||
for (i = 0, block = pack.block0, pack.iobuffer = volume->pack;
|
||||
i < volume->blkper;
|
||||
|
@ -1441,7 +1441,7 @@ start_pack:
|
|||
}
|
||||
}
|
||||
|
||||
/* Now ack each I/O block */
|
||||
/* Now pack each I/O block */
|
||||
|
||||
for (i = 0, block = pack.block0, pack.iobuffer = volume->pack;
|
||||
i < volume->blkper;
|
||||
|
|
|
@ -193,7 +193,7 @@ ssize_t nxffs_read(FAR struct file *filep, FAR char *buffer, size_t buflen)
|
|||
|
||||
if ((ofile->oflags & O_RDOK) == 0)
|
||||
{
|
||||
fdbg("File not open for read access\n");
|
||||
fdbg("ERROR: File not open for read access\n");
|
||||
ret = -EACCES;
|
||||
goto errout_with_semaphore;
|
||||
}
|
||||
|
@ -445,7 +445,7 @@ int nxffs_rdblkhdr(FAR struct nxffs_volume_s *volume, off_t offset,
|
|||
|
||||
if ((uint32_t)doffset + (uint32_t)dlen > (uint32_t)volume->geo.blocksize)
|
||||
{
|
||||
fdbg("Data length=%d is unreasonable at offset=%d\n", dlen, doffset);
|
||||
fdbg("ERROR: Data length=%d is unreasonable at offset=%d\n", dlen, doffset);
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
|
|
|
@ -204,7 +204,9 @@ static int nxffs_badblocks(FAR struct nxffs_volume_s *volume)
|
|||
good = false;
|
||||
}
|
||||
|
||||
/* Check that block data is erased */
|
||||
/* This is a properly formatted, good NXFFS block. Check that the
|
||||
* block data payload is erased.
|
||||
*/
|
||||
|
||||
else
|
||||
{
|
||||
|
@ -215,7 +217,7 @@ static int nxffs_badblocks(FAR struct nxffs_volume_s *volume)
|
|||
|
||||
/* If the block is bad, attempt to re-write the block header
|
||||
* indicating a bad block (of course, if the block has failed,
|
||||
* this may not be possible, depending upon failure modes.
|
||||
* this may not be possible, depending upon failure modes).
|
||||
*/
|
||||
|
||||
if (!good)
|
||||
|
|
|
@ -101,8 +101,10 @@ int nxffs_statfs(FAR struct inode *mountpt, FAR struct statfs *buf)
|
|||
goto errout;
|
||||
}
|
||||
|
||||
/* Fill in the statfs info */
|
||||
#warning "Need f_bfree, f_bavail, f_files, f_ffree calculation"
|
||||
/* Fill in the statfs info
|
||||
*
|
||||
* REVISIT: Need f_bfree, f_bavail, f_files, f_ffree calculation
|
||||
*/
|
||||
|
||||
memset(buf, 0, sizeof(struct statfs));
|
||||
buf->f_type = NXFFS_MAGIC;
|
||||
|
@ -160,7 +162,7 @@ int nxffs_stat(FAR struct inode *mountpt, FAR const char *relpath,
|
|||
ret = nxffs_findinode(volume, relpath, &entry);
|
||||
if (ret < 0)
|
||||
{
|
||||
fdbg("Inode '%s' not found: %d\n", -ret);
|
||||
fdbg("ERROR: Inode '%s' not found: %d\n", -ret);
|
||||
goto errout_with_semaphore;
|
||||
}
|
||||
|
||||
|
|
|
@ -102,7 +102,7 @@ int nxffs_rminode(FAR struct nxffs_volume_s *volume, FAR const char *name)
|
|||
{
|
||||
/* We can't remove the inode if it is open */
|
||||
|
||||
fdbg("Inode '%s' is open\n", name);
|
||||
fdbg("ERROR: Inode '%s' is open\n", name);
|
||||
ret = -EBUSY;
|
||||
goto errout;
|
||||
}
|
||||
|
@ -112,7 +112,7 @@ int nxffs_rminode(FAR struct nxffs_volume_s *volume, FAR const char *name)
|
|||
ret = nxffs_findinode(volume, name, &entry);
|
||||
if (ret < 0)
|
||||
{
|
||||
fdbg("Inode '%s' not found\n", name);
|
||||
fdbg("ERROR: Inode '%s' not found\n", name);
|
||||
goto errout;
|
||||
}
|
||||
|
||||
|
|
|
@ -483,7 +483,7 @@ ssize_t nxffs_write(FAR struct file *filep, FAR const char *buffer, size_t bufle
|
|||
|
||||
if ((wrfile->ofile.oflags & O_WROK) == 0)
|
||||
{
|
||||
fdbg("File not open for write access\n");
|
||||
fdbg("ERROR: File not open for write access\n");
|
||||
ret = -EACCES;
|
||||
goto errout_with_semaphore;
|
||||
}
|
||||
|
@ -623,7 +623,7 @@ int nxffs_wrreserve(FAR struct nxffs_volume_s *volume, size_t size)
|
|||
{
|
||||
/* Return -ENOSPC to indicate that the volume is full */
|
||||
|
||||
fdbg("No space in last block\n");
|
||||
fdbg("ERROR: No space in last block\n");
|
||||
return -ENOSPC;
|
||||
}
|
||||
|
||||
|
@ -635,9 +635,10 @@ int nxffs_wrreserve(FAR struct nxffs_volume_s *volume, size_t size)
|
|||
ret = nxffs_validblock(volume, &volume->ioblock);
|
||||
if (ret < 0)
|
||||
{
|
||||
fdbg("No more valid blocks\n");
|
||||
fdbg("ERROR: No more valid blocks\n");
|
||||
return ret;
|
||||
}
|
||||
|
||||
volume->iooffset = SIZEOF_NXFFS_BLOCK_HDR;
|
||||
}
|
||||
|
||||
|
@ -769,7 +770,7 @@ int nxffs_wrverify(FAR struct nxffs_volume_s *volume, size_t size)
|
|||
ret = nxffs_validblock(volume, &volume->ioblock);
|
||||
if (ret < 0)
|
||||
{
|
||||
fdbg("No more valid blocks\n");
|
||||
fdbg("ERROR: No more valid blocks\n");
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -781,7 +782,7 @@ int nxffs_wrverify(FAR struct nxffs_volume_s *volume, size_t size)
|
|||
* the object.
|
||||
*/
|
||||
|
||||
fdbg("Not enough memory left to hold the file header\n");
|
||||
fdbg("ERROR: Not enough memory left to hold the file header\n");
|
||||
return -ENOSPC;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue