mirror of
https://github.com/apache/nuttx.git
synced 2026-09-20 12:58:29 +08:00
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:
+14
-4
@@ -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
File diff suppressed because it is too large
Load Diff
@@ -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 */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user