FSFlushQuota

Syntax

#include <cafe/fs.h>

FSStatus FSFlushQuota(
                FSClient                        *client,
                FSCmdBlock                      *block,
                const char                      *path,
                FSRetFlag                       errHandling
                );
FSStatus FSFlushQuotaAsync(
                FSClient                        *client,
                FSCmdBlock                      *block,
                const char                      *path,
                FSRetFlag                       errHandling,
                const FSAsyncParams             *asyncParams
                );

Parameters

client Pointer to the client buffer.
block Command block.
path Path specifying the quota. Its length must be less than FS_MAX_ARGPATH_SIZE.
errHandling Auto error handling flag. Only the indicated errors are returned.
asyncParams Notification parameters for an asynchronous call (Async API only).

Return Values

Sync API : Return values / Async API: Callback return values

FS_STATUS_OK Successfully completed.
FS_STATUS_CANCELED The command was canceled.
FS_STATUS_NOT_FOUND Target not found.
FS_STATUS_UNSUPPORTED_CMD The associated file system does not support this function.
FS_STATUS_MEDIA_NOT_READY (Only for manually mounted devices.) Media is not present.
FS_STATUS_MEDIA_ERROR (Only for manually mounted devices.) Media is in some inaccessible condition.
FS_STATUS_DATA_CORRUPTED (Only for manually mounted devices.) The data is corrupted beyond repair. The volume must be reformatted.
FS_STATUS_WRITE_PROTECTED (Only for manually mounted devices.) Media is write protected.

Async API: Immediate return values

FS_STATUS_OK Successfully issued request.
FS_STATUS_FATAL_ERROR The argument is invalid.

Description

Flushes the quota designated by path. A quota is a type of directory that has an upper data size limit. The updated data can be flushed for each quota unit. Application save data is created as a quota.

The file system supports the journaling feature. All operations by the FS API are temporarily recorded to journaling blocks by the journaling feature. All operations in the quota become effective immediately by calling this function.

Both a sync and async style API are provided. To use the async API, set the user callback and parameter in asyncParams. For more information, see FSAsyncParams.

This function is only for file systems supporting the journaling feature. On other read-only file systems, this function returns the error FS_STATUS_UNSUPPORTED_CMD. On other read/write file system, this function returns the error FS_STATUS_OK.

Flush frequency warning message

When FSFlushQuota is called frequently, a warning message and a list of callers (number of times, lower 32-bits of title id and group id) are dumped to the console.

00:00:35:153: Warning: wfs volume 1 (29760 MB) has been flushed 10 times within a minute by following titles.  
00:00:35:153:           1 times by 0x00000000-0x00000000 (System)
00:00:35:153:           1 times by 0x100000f7-0x00000400 (System)
00:00:35:153:           8 times by 0x11000000-0x00010000 (Application)

The threshold is 10 times per 1 minute. The count includes FSFlushQuota by system.

When the warning message is dumped, ensure that the application follows the guidelines with regards to access frequency. Though a message is dumped, it does not indicate that the application does not follow guidelines.

For more information, see the chapter "File System" in the Wii U Guidelines on your local Nintendo developer support group website.

This warning message is disabled in production mode.

Do Not Call From

FSFlushQuota

Thread that displays graphics Do not call this function from a thread that displays graphics. This function may block indefinitely in error cases and the application must be able to display appropriate messages.
Thread that handles system messages Do not call this function from a thread that handles system messages. This function may block indefinitely in error cases and the application must be able to handle system events such as shutdown.
Callbacks Do not call this function from any callback function.
Interrupt handler Do not call this function from any interrupt handler.
Exception handler Do not call this function from any exception handler.

FSFlushQuotaAsync

None.

Revision History

2014/09/16 Added "Thread that displays graphics" and "Thread that handles system messages" to "Do not call from".
2014/02/20 Added description of flush frequency message.
2013/05/23 Added FS_STATUS_DATA_CORRUPTED to return values.
2013/05/20 Added FS_STATUS_WRITE_PROTECTED to return values.
2013/05/08 Automated cleanup pass.
2013/01/10 Added "Callback" to "Do not call from".
2012/07/20 Readability cleanup.
2012/02/27 Initial version.


CONFIDENTIAL