WS63 SDK 文档 7021f4f@fbb_ws63
ws63 和 ws63e 解决方案的 SDK 文档
载入中...
搜索中...
未找到
los_fs.h
浏览该文件的文档.
1/* ----------------------------------------------------------------------------
2 * Copyright (c) Huawei Technologies Co., Ltd. 2021-2021. All rights reserved.
3 * Description: LiteOS FS Headfile
4 * Author: Huawei LiteOS Team
5 * Create: 2021-07-16
6 * Redistribution and use in source and binary forms, with or without modification,
7 * are permitted provided that the following conditions are met:
8 * 1. Redistributions of source code must retain the above copyright notice, this list of
9 * conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright notice, this list
11 * of conditions and the following disclaimer in the documentation and/or other materials
12 * provided with the distribution.
13 * 3. Neither the name of the copyright holder nor the names of its contributors may be used
14 * to endorse or promote products derived from this software without specific prior written
15 * permission.
16 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
18 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
19 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
20 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
21 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
22 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
23 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
24 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
25 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
26 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 * --------------------------------------------------------------------------- */
28
29#ifndef _INCLUDE_LOS_FS_H
30#define _INCLUDE_LOS_FS_H
31
32#include "errno.h"
33#include "compiler.h"
34#include "sys/statfs.h"
35#include "sys/types.h"
36
37#ifdef __cplusplus
38extern "C" {
39#endif /* __cplusplus */
40
41#ifdef LOSCFG_FS_FAT_VIRTUAL_PARTITION
42#define _MAX_ENTRYLENGTH 16 /* MAX virtual partition name length */
43#define _MAX_VIRVOLUMES 5 /* MAX virtual partition number */
44typedef struct virtual_partition_info
45{
46 char *devpartpath; /* partition name need set virtual partition,e.g. /dev/mmcblk0p0 */
47 int virpartnum; /* virtual partition numbers, MAX number is 5 */
48 double virpartpercent[_MAX_VIRVOLUMES]; /* every virtual partition percent,e.g 0.6,0.3,0.1 */
49 char virpartname[_MAX_VIRVOLUMES][_MAX_ENTRYLENGTH + 1]; /* every virtual partition name, MAX length is 16 */
50} virpartinfo;
51#endif
52
53struct fsmap_t
54{
55 const char *fs_filesystemtype;
56 const struct mountpt_operations *fs_mops;
59};
60
61#define FSMAP_WOW_ENTRY(_l, _name, _mop, _is_mtd_support, _is_bdfs) \
62struct fsmap_t _l LOS_HAL_TABLE_WOW_ENTRY(fsmap) = \
63{ \
64 _name, \
65 &_mop, \
66 _is_mtd_support, \
67 _is_bdfs \
68}
69
70#define FSMAP_SCATTER_ENTRY(_l, _name, _mop, _is_mtd_support, _is_bdfs) \
71struct fsmap_t _l LOS_HAL_TABLE_SCATTER_ENTRY(fsmap) = \
72{ \
73 _name, \
74 &_mop, \
75 _is_mtd_support, \
76 _is_bdfs \
77}
78
79#define FSMAP_ENTRY(_l, _name, _mop, _is_mtd_support, _is_bdfs) \
80struct fsmap_t _l LOS_HAL_TABLE_ENTRY(fsmap) = \
81{ \
82 _name, \
83 &_mop, \
84 _is_mtd_support, \
85 _is_bdfs \
86}
87
93
115void los_vfs_init(void);
116
140extern void ls(const char *pathname);
141
165extern char *rindex(const char *s, int c);
166
189int getlabel(const char *target, char *label);
190
213extern void set_label(const char *name);
214
245extern int format(const char *dev, int sectors, int option);
246
273extern int los_set_systime_status(BOOL b_status);
274
300FAR int fscheck(FAR const char *path);
301
302#ifdef LOSCFG_FS_FAT_VIRTUAL_PARTITION
331extern int virstatfs(FAR const char *path, FAR struct statfs *buf);
332
364int los_set_virpartparam(virpartinfo virtualinfo);
365
366#endif
367
401int chattr(const char *path, mode_t mode);
402
425extern INT32 LOS_BcacheSyncByName(const CHAR *name);
426
451
452#ifdef LOSCFG_FS_FAT_CACHE_SYNC_THREAD
475extern VOID LOS_SetDirtyRatioThreshold(UINT32 dirtyRatio);
476
493extern UINT32 LOS_GetDirtyRatioThreshold(VOID);
494
516extern VOID LOS_SetSyncThreadInterval(UINT32 interval);
517
534extern UINT32 LOS_GetSyncThreadInterval(VOID);
535
561extern INT32 LOS_SetSyncThreadPrio(UINT32 prio, const CHAR *name);
562
563#endif
564
588
606
607#ifdef __cplusplus
608}
609#endif /* __cplusplus */
610
611#endif /* _INCLUDE_LOS_FS_H */
void set_label(const char *name)
int format(const char *dev, int sectors, int option)
formatting sd card
void ls(const char *pathname)
list directory contents.
UINT32 LOS_GetBlockExpireInterval(VOID)
Obtain the max expire interval for block.
int chattr(const char *path, mode_t mode)
mount_status
Definition los_fs.h:89
@ STAT_MOUNTED
Definition los_fs.h:91
@ STAT_UNMOUNTED
Definition los_fs.h:90
char * rindex(const char *s, int c)
locate character in string.
VOID LOS_SetBlockExpireInterval(UINT32 interval)
enum mount_status MOUNT_STATE
INT32 LOS_GetDirtyRatioByName(const CHAR *name)
int getlabel(const char *target, char *label)
list directory contents.
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)
void los_vfs_init(void)
Initializes the vfs filesystem
INT32 LOS_BcacheSyncByName(const CHAR *name)
signed int INT32
Definition los_typedef.h:55
#define VOID
Definition los_typedef.h:88
unsigned int UINT32
Definition los_typedef.h:52
char CHAR
Definition los_typedef.h:58
size_t BOOL
Definition los_typedef.h:83
Definition los_fs.h:54
const char * fs_filesystemtype
Definition los_fs.h:55
const struct mountpt_operations * fs_mops
Definition los_fs.h:56
const BOOL is_mtd_support
Definition los_fs.h:57
const BOOL is_bdfs
Definition los_fs.h:58