Finish logic to update open writer after packing

git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@3568 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
patacongo
2011-05-05 23:31:44 +00:00
parent 71bd9ca54e
commit 97da40cebb
3 changed files with 367 additions and 130 deletions
+14 -4
View File
@@ -108,7 +108,7 @@ int nxffs_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
goto errout;
}
/* Only a reformat command is supported */
/* Only a reformat and optimize commands are supported */
if (cmd == FIOC_REFORMAT)
{
@@ -126,12 +126,22 @@ int nxffs_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
/* Re-format the volume -- all is lost */
ret = nxffs_reformat(volume);
goto errout_with_semaphore;
}
/* No other commands supported */
else if (cmd == FIOC_OPTIMIZE)
{
fvdbg("Optimize command\n");
ret = -ENOTTY;
/* Pack the volume */
ret = nxffs_pack(volume);
}
else
{
/* No other commands supported */
ret = -ENOTTY;
}
errout_with_semaphore:
sem_post(&volume->exclsem);
+350 -126
View File
File diff suppressed because it is too large Load Diff
+3
View File
@@ -97,6 +97,9 @@
#define FIOC_REFORMAT _FIOC(0x0002) /* IN: None
* OUT: None
*/
#define FIOC_OPTIMIZE _FIOC(0x0003) /* IN: None
* OUT: None
*/
/* NuttX file system ioctl definitions */