更新日期: 2022/06/01 来源: https://gitee.com/weharmony/kernel_liteos_a_note
disk.h 文件参考

浏览源代码.

结构体

struct  _los_disk_
 
struct  _los_part_
 
struct  partition_info
 
struct  disk_divide_info
 

类型定义

typedef enum _disk_status_ disk_status_e
 
typedef struct _los_disk_ los_disk
 
typedef struct _los_part_ los_part
 

枚举

enum  _disk_status_ { STAT_UNUSED , STAT_INUSED , STAT_UNREADY }
 

函数

INT32 los_disk_init (const CHAR *diskName, const struct block_operations *bops, VOID *priv, INT32 diskID, VOID *info)
 Disk driver initialization. 更多...
 
INT32 los_disk_deinit (INT32 diskID)
 Destroy a disk driver. 更多...
 
INT32 los_disk_read (INT32 drvID, VOID *buf, UINT64 sector, UINT32 count, BOOL useRead)
 Read data from disk driver. 更多...
 
INT32 los_disk_write (INT32 drvID, const VOID *buf, UINT64 sector, UINT32 count)
 Write data to a disk driver. 更多...
 
INT32 los_disk_ioctl (INT32 drvID, INT32 cmd, VOID *buf)
 Get information of disk driver. 更多...
 
INT32 los_disk_sync (INT32 drvID)
 Sync blib cache. 更多...
 
INT32 los_disk_set_bcache (INT32 drvID, UINT32 sectorPerBlock, UINT32 blockNum)
 Set blib cache for the disk driver. 更多...
 
INT32 los_part_read (INT32 pt, VOID *buf, UINT64 sector, UINT32 count, BOOL useRead)
 Read data from chosen partition. 更多...
 
INT32 los_part_write (INT32 pt, const VOID *buf, UINT64 sector, UINT32 count)
 Write data to chosen partition. 更多...
 
INT32 los_disk_cache_clear (INT32 drvID)
 Clear the bcache data 更多...
 
INT32 los_part_ioctl (INT32 pt, INT32 cmd, VOID *buf)
 Get information of chosen partition. 更多...
 
INT32 los_part_access (const CHAR *dev, mode_t mode)
 Decide the chosen partition is exist or not. 更多...
 
los_partlos_part_find (struct Vnode *blkDriver)
 Find disk partition. 更多...
 
los_diskget_disk (INT32 id)
 Find disk driver. 更多...
 
los_partget_part (INT32 id)
 Find disk partition. 更多...
 
VOID show_part (los_part *part)
 Print partition information. 更多...
 
INT32 add_mmc_partition (struct disk_divide_info *info, size_t sectorStart, size_t sectorCount)
 Add a new mmc partition. 更多...
 
INT32 los_alloc_diskid_byname (const CHAR *diskName)
 alloc a new UNUSED disk id. 更多...
 
INT32 los_get_diskid_byname (const CHAR *diskName)
 get the INUSED disk id. 更多...
 
los_disklos_get_mmcdisk_bytype (UINT8 type)
 

类型定义说明

◆ disk_status_e

◆ los_disk

typedef struct _los_disk_ los_disk

◆ los_part

typedef struct _los_part_ los_part

枚举类型说明

◆ _disk_status_

枚举值
STAT_UNUSED 
STAT_INUSED 
STAT_UNREADY 

在文件 disk.h170 行定义.

170 {
enum _disk_status_ disk_status_e
@ STAT_UNUSED
Definition: disk.h:171
@ STAT_INUSED
Definition: disk.h:172
@ STAT_UNREADY
Definition: disk.h:173

函数说明

◆ los_get_mmcdisk_bytype()

los_disk * los_get_mmcdisk_bytype ( UINT8  type)

在文件 disk.c226 行定义.

227{
228 const CHAR *mmcDevHead = "/dev/mmcblk";
229
230 for (INT32 diskId = 0; diskId < SYS_MAX_DISK; diskId++) {
231 los_disk *disk = get_disk(diskId);
232 if (disk == NULL) {
233 continue;
234 } else if ((disk->type == type) && (strncmp(disk->disk_name, mmcDevHead, strlen(mmcDevHead)) == 0)) {
235 return disk;
236 }
237 }
238 PRINT_ERR("Cannot find the mmc disk!\n");
239 return NULL;
240}
los_disk * get_disk(INT32 id)
Find disk driver.
Definition: disk.c:263
signed int INT32
Definition: los_typedef.h:60
char CHAR
Definition: los_typedef.h:63
CHAR * disk_name
Definition: disk.h:189
UINT8 type
Definition: disk.h:188
函数调用图:
这是这个函数的调用关系图: