WS63 SDK 文档 7021f4f@fbb_ws63
ws63 和 ws63e 解决方案的 SDK 文档
载入中...
搜索中...
未找到
los_fs.h 文件参考
#include "errno.h"
#include "compiler.h"
#include "sys/statfs.h"
#include "sys/types.h"
los_fs.h 的引用(Include)关系图:
此图展示该文件直接或间接的被哪些文件引用了:

浏览源代码.

结构体

struct  fsmap_t
 

宏定义

#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)
 

类型定义

typedef enum mount_status MOUNT_STATE
 

枚举

enum  mount_status { STAT_UNMOUNTED = 0 , STAT_MOUNTED }
 

函数

void los_vfs_init (void)
 Initializes the vfs filesystem
 
void ls (const char *pathname)
 list directory contents.
 
char * rindex (const char *s, int c)
 locate character in string.
 
int getlabel (const char *target, char *label)
 list directory contents.
 
void set_label (const char *name)
 
int format (const char *dev, int sectors, int option)
 formatting sd card
 
int los_set_systime_status (BOOL b_status)
 set current system time is valid or invalid for FAT file system.
 
FAR int fscheck (FAR const char *path)
 
int chattr (const char *path, mode_t mode)
 
INT32 LOS_BcacheSyncByName (const CHAR *name)
 
INT32 LOS_GetDirtyRatioByName (const CHAR *name)
 
VOID LOS_SetBlockExpireInterval (UINT32 interval)
 
UINT32 LOS_GetBlockExpireInterval (VOID)
 Obtain the max expire interval for block.
 

宏定义说明

◆ FSMAP_ENTRY

#define FSMAP_ENTRY (   _l,
  _name,
  _mop,
  _is_mtd_support,
  _is_bdfs 
)
值:
struct fsmap_t _l LOS_HAL_TABLE_ENTRY(fsmap) = \
{ \
_name, \
&_mop, \
_is_mtd_support, \
_is_bdfs \
}
#define LOS_HAL_TABLE_ENTRY(name)
Definition los_tables.h:127
Definition los_fs.h:54

◆ 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 
)
值:
struct fsmap_t _l LOS_HAL_TABLE_WOW_ENTRY(fsmap) = \
{ \
_name, \
&_mop, \
_is_mtd_support, \
_is_bdfs \
}
#define LOS_HAL_TABLE_WOW_ENTRY(name)
Definition los_tables.h:115

类型定义说明

◆ MOUNT_STATE

typedef enum mount_status 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.
返回值
#0On success.
#-1On 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:
  • fs.h
参见
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.
返回值
#0Format success.
#-1Format 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.
返回值
#0truncate success.
#-1truncate 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.
返回值
#intPoint 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.
返回值
#0On success.
INT32On failure.
Dependency:
  • fs.h
参见
None
自从
Huawei LiteOS V200R002C10

◆ LOS_GetBlockExpireInterval()

UINT32 LOS_GetBlockExpireInterval ( VOID  )
extern

Obtain the max expire interval for block.

Description:
This API is used to obtain the max expire interval for block.
注意
None.
返回值
UINT32The expire interval for the block, in milliseconds.
Dependency:
  • fs.h
参见
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.
返回值
INT32the percentage of dirty blocks.
#-1On failure.
Dependency:
  • fs.h
参见
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.
返回值
#0set status success
#-22Invalid 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
注意
  • None
返回值
VOIDNone.
Dependency:
  • fs.h
参见
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.
参数
none
返回值
none
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.
返回值
<ul>None.</ul>
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().
返回值
#voidNone.
Dependency:
  • fs.h
参见
format
自从
Huawei LiteOS V100R001C00