46 struct Vnode *device = NULL;
53 if (strncmp(dev,
"/dev", DEV_NAME_SIZE) != 0) {
55 PRINTK(
" format <dev_vnodename> <sectors> <option> <label>\n");
56 PRINTK(
" dev_vnodename : the name of dev\n");
57 PRINTK(
" sectors : Size of allocation unit in unit of byte or sector, ");
58 PRINTK(
"0 instead of default size\n");
59 PRINTK(
" options : Index of filesystem. 1 for FAT filesystem, 2 for FAT32 filesystem, ");
60 PRINTK(
"7 for any, 8 for erase\n");
61 PRINTK(
" label : The volume of device. It will be emptyed when this parameter is null\n");
63 PRINTK(
" format /dev/mmcblk0 128 2\n");
70 if (err == -ENOENT || err == -ENOSYS) {
85#ifdef LOSCFG_FS_FAT_VIRTUAL_PARTITION
86 else if (err >= VIRERR_BASE) {
int fatfs_mkfs(struct Vnode *device, int sectors, int option)
vnode并不包含文件名,因为 vnode和文件名是 1:N 的关系
int VnodeHold(void)
拿锁,封装互斥量
int VnodeLookup(const char *path, struct Vnode **vnode, uint32_t flags)
通过路径查询vnode节点