#include "errno.h"
#include "compiler.h"
#include "sys/statfs.h"
#include "sys/types.h"
浏览源代码.
|
| #define | FSMAP_WOW_ENTRY(_l, _name, _mop, _is_mtd_support, _is_bdfs) |
| |
| #define | FSMAP_SCATTER_ENTRY(_l, _name, _mop, _is_mtd_support, _is_bdfs) |
| |
| #define | FSMAP_ENTRY(_l, _name, _mop, _is_mtd_support, _is_bdfs) |
| |
◆ FSMAP_ENTRY
| #define FSMAP_ENTRY |
( |
|
_l, |
|
|
|
_name, |
|
|
|
_mop, |
|
|
|
_is_mtd_support, |
|
|
|
_is_bdfs |
|
) |
| |
值:
{ \
_name, \
&_mop, \
_is_mtd_support, \
_is_bdfs \
}
#define LOS_HAL_TABLE_ENTRY(name)
Definition los_tables.h:127
◆ FSMAP_SCATTER_ENTRY
| #define FSMAP_SCATTER_ENTRY |
( |
|
_l, |
|
|
|
_name, |
|
|
|
_mop, |
|
|
|
_is_mtd_support, |
|
|
|
_is_bdfs |
|
) |
| |
值:
{ \
_name, \
&_mop, \
_is_mtd_support, \
_is_bdfs \
}
#define LOS_HAL_TABLE_SCATTER_ENTRY(name)
Definition los_tables.h:121
◆ FSMAP_WOW_ENTRY
| #define FSMAP_WOW_ENTRY |
( |
|
_l, |
|
|
|
_name, |
|
|
|
_mop, |
|
|
|
_is_mtd_support, |
|
|
|
_is_bdfs |
|
) |
| |
值:
{ \
_name, \
&_mop, \
_is_mtd_support, \
_is_bdfs \
}
#define LOS_HAL_TABLE_WOW_ENTRY(name)
Definition los_tables.h:115
◆ MOUNT_STATE
◆ mount_status
| 枚举值 |
|---|
| STAT_UNMOUNTED | |
| STAT_MOUNTED | |
◆ chattr()
| int chattr |
( |
const char * |
path, |
|
|
mode_t |
mode |
|
) |
| |
- Description:
- The chattr() function shall change the mode of file named by the pathname pointed to by the path argument.
- 注意
-
Now only fat filesystem support this function.
- 返回值
-
| #0 | On success. |
| #-1 | On failure with errno set. |
- Errors
-
EINVAL: The path is a null pointer or points to an empty string.
-
ENAMETOOLONG: The length of a component of a pathname is longer than {NAME_MAX}.
-
ENOENT: A component of the path does not exist.
-
EPERM: The entry represented by the path is a mount point.
-
ENOSYS: The file system doesn't support this function.
-
EACCES: It is a read-only file system.
-
ENOMEM: Out of memory.
-
EIO: A hard error occurred in the low level disk I/O layer or the physical drive cannot work.
-
ENODEV: The device is not existed.
- Dependency:
-
- 参见
- None
- 自从
- Huawei LiteOS V100R001C00
◆ format()
| int format |
( |
const char * |
dev, |
|
|
int |
sectors, |
|
|
int |
option |
|
) |
| |
|
extern |
formatting sd card
- Description:
- formatting sd card.
- 注意
-
The prefix of the parameter dev must be "/dev", and the length must be less than the value defined by PATH_MAX. There are four kind of format option: FMT_FAT16, FMT_FAT32, FMT_ANY, FMT_ERASE. If users input anything else, the default format option is FMT_ANY. Format option is decided by the number of clusters. Choosing the wrong option will cause error of format. The detailed information of (FAT16,FAT32) is ff.h.
- 参数
-
| dev | [IN] Type #const char* path of the block device to format, which must be a really existing block device node. |
| sectors | [IN] Type #int number of sectors per cluster. |
| option | [IN] Type #int option of format. |
- 返回值
-
| #0 | Format success. |
| #-1 | Format failed. |
- Dependency:
-
unistd.h: the header file that contains the API declaration.
- 参见
- 自从
- Huawei LiteOS V100R001C00
◆ fscheck()
| FAR int fscheck |
( |
FAR const char * |
path | ) |
|
@check the three latest files in path
- Description:
- The fscheck() function check the latest three files in path and subdirectories. The function will fix the FAT when the file size info of directory is not matched with FAT.
- 注意
-
This function only support for FAT32.
- 参数
-
| path | [IN] Type #const char * The path of the directory to be checked. |
- 返回值
-
| #0 | truncate success. |
| #-1 | truncate failed. |
- Dependency:
-
fs.h: the header file that contains the API declaration.
- 参见
- 自从
- Huawei LiteOS V200R001C00
◆ getlabel()
| int getlabel |
( |
const char * |
target, |
|
|
char * |
label |
|
) |
| |
list directory contents.
- Description:
- Get the volume label of the FAT partition.
- 注意
-
The function support FAT filesystem only.
-
The label must allocated more than 11 charactors space first
- 参数
-
| target | [IN] Type #const char* The file pathname. |
| label | [OUT] Type #const char* The string pointer transform the label massge back. |
- 返回值
-
| #int | Point the status which is successed or failed. |
- Dependency:
-
fs.h: the header file that contains the API declaration.
◆ LOS_BcacheSyncByName()
| INT32 LOS_BcacheSyncByName |
( |
const CHAR * |
name | ) |
|
|
extern |
- Description:
- The LOS_BcacheSyncByName() function shall sync all the data in the cache corresponding to the disk name to the disk.
- 参数
-
| name | [IN] name of the disk |
- 注意
-
Now only fat filesystem support this function.
- 返回值
-
| #0 | On success. |
| INT32 | On failure. |
- Dependency:
-
- 参见
- None
- 自从
- Huawei LiteOS V200R002C10
◆ LOS_GetBlockExpireInterval()
Obtain the max expire interval for block.
- Description:
- This API is used to obtain the max expire interval for block.
- 注意
- None.
- 返回值
-
| UINT32 | The expire interval for the block, in milliseconds. |
- Dependency:
-
- 参见
- LOS_SetBlockExpireInterval
- 自从
- Huawei LiteOS 206.1.0
◆ LOS_GetDirtyRatioByName()
| INT32 LOS_GetDirtyRatioByName |
( |
const CHAR * |
name | ) |
|
|
extern |
- Description:
- The LOS_GetDirtyRatioByName() function shall return the percentage of dirty blocks in the cache corresponding to the disk name.
- 参数
-
| name | [IN] name of the disk |
- 注意
-
Now only fat filesystem support this function.
- 返回值
-
| INT32 | the percentage of dirty blocks. |
| #-1 | On failure. |
- Dependency:
-
- 参见
- None
- 自从
- Huawei LiteOS V200R002C10
◆ los_set_systime_status()
| int los_set_systime_status |
( |
BOOL |
b_status | ) |
|
|
extern |
set current system time is valid or invalid for FAT file system.
- Description:
- The function is used for setting current system time is valid or invalid for FAT file system. The value can be set as FAT_SYSTEM_TIME_ENABLE/FAT_SYSTEM_TIME_DISABLE.
- 注意
-
When the system time is valid, it should set FAT_SYSTEM_TIME_ENABLE.
-
When the system time is invalid, it should set FAT_SYSTEM_TIME_DISABLE.
- 参数
-
| b_status | [IN] Type BOOL system time status. |
- 返回值
-
| #0 | set status success |
| #-22 | Invalid argument |
- Dependency:
-
fs.h: the header file that contains the API declaration.
- 参见
- 自从
- Huawei LiteOS V200R001C00
◆ LOS_SetBlockExpireInterval()
| VOID LOS_SetBlockExpireInterval |
( |
UINT32 |
interval | ) |
|
|
extern |
- Description:
- The LOS_SetBlockExpireInterval() function shall set the max expire interval for block. If the expire interval of blocks is reached, the current block will be synchronized
- 参数
-
| interval | [IN] the expire interval for the block |
- 注意
-
- 返回值
-
- Dependency:
-
- 参见
- LOS_SetBlockExpireInterval
- 自从
- Huawei LiteOS V200R006C00
◆ los_vfs_init()
| void los_vfs_init |
( |
void |
| ) |
|
Initializes the vfs filesystem
- Description:
- This API is used to initializes the vfs filesystem
- 注意
-
Called only once, multiple calls will cause file system error.
- 参数
-
- 返回值
-
- Dependency:
-
fs.h: the header file that contains the API declaration.
- 参见
- NULL
- 自从
- Huawei LiteOS V100R001C00
◆ ls()
| void ls |
( |
const char * |
pathname | ) |
|
|
extern |
list directory contents.
- Description:
- List information about the FILEs (the current directory by default).
- 注意
-
The total length of parameter pathname must be less than the value defined by PATH_MAX.
- 参数
-
| pathname | [IN] Type #const char* The file pathname. |
- 返回值
-
- Dependency:
-
fs.h: the header file that contains the API declaration.
- 参见
- ls
- 自从
- Huawei LiteOS V100R001C00
◆ rindex()
| char * rindex |
( |
const char * |
s, |
|
|
int |
c |
|
) |
| |
|
extern |
locate character in string.
- Description:
- The API function returns a pointer to the last occurrence of the character c in the string s.
- 注意
-
The parameter s must point a valid string, which end with the terminating null byte.
- 参数
-
| s | [IN] Type #const char* A pointer to string. |
| c | [IN] Type #int The character. |
- 返回值
-
| #char* | a pointer to the matched character or NULL if the character is not found. |
- Dependency:
-
fs.h: the header file that contains the API declaration.
- 参见
- rindex
- 自从
- Huawei LiteOS V100R001C00
◆ set_label()
| void set_label |
( |
const char * |
name | ) |
|
|
extern |
- Description:
- The set_label() function shall set the value of a global variable, the value will be used to set the label of SD card in format().
- 参数
-
| name | [IN] label to set, the length must be less than 12 |
- 注意
-
The function must be called before format().
- 返回值
-
- Dependency:
-
- 参见
- format
- 自从
- Huawei LiteOS V100R001C00