mirror of
https://github.com/DragonOS-Community/DragonOS.git
synced 2025-06-19 17:26:31 +00:00
🆕 fat32_create
This commit is contained in:
@ -105,7 +105,7 @@ struct vfs_dir_entry_t *vfs_path_walk(const char *path, uint64_t flags)
|
||||
// 貌似这里不需要memset,因为空间会被覆盖
|
||||
// memset(dentry->name, 0, tmp_path_len+1);
|
||||
|
||||
memcpy(dentry->name, (void*)tmp_path, tmp_path_len);
|
||||
memcpy(dentry->name, (void *)tmp_path, tmp_path_len);
|
||||
dentry->name[tmp_path_len] = '\0';
|
||||
kdebug("tmp_path_len=%d, dentry->name= %s", tmp_path_len, dentry->name);
|
||||
dentry->name_length = tmp_path_len;
|
||||
@ -232,8 +232,7 @@ uint64_t sys_mkdir(struct pt_regs *regs)
|
||||
{
|
||||
// 目录中已有对应的文件夹
|
||||
kwarn("Dir '%s' aleardy exists.", path);
|
||||
kdebug("name = %s", vfs_path_walk((const char *)path, 0)->name)
|
||||
return -EEXIST;
|
||||
kdebug("name = %s", vfs_path_walk((const char *)path, 0)->name) return -EEXIST;
|
||||
}
|
||||
|
||||
struct vfs_dir_entry_t *subdir_dentry = (struct vfs_dir_entry_t *)kmalloc(sizeof(struct vfs_dir_entry_t), 0);
|
||||
|
@ -12,6 +12,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <common/glib.h>
|
||||
#include <common/fcntl.h>
|
||||
|
||||
struct vfs_superblock_t *vfs_root_sb = NULL;
|
||||
|
||||
@ -109,11 +110,11 @@ struct vfs_inode_operations_t
|
||||
{
|
||||
/**
|
||||
* @brief 创建新的文件
|
||||
* @param inode 要被创建的文件的inode结构体
|
||||
* @param parent_dEntry 父目录的dentry
|
||||
* @param parent_inode 父目录的inode结构体
|
||||
* @param dest_dEntry 新文件的dentry
|
||||
* @param mode 创建模式
|
||||
*/
|
||||
long (*create)(struct vfs_index_node_t *inode, struct vfs_dir_entry_t *parent_dEntry, int mode);
|
||||
long (*create)(struct vfs_index_node_t *parent_inode, struct vfs_dir_entry_t *dest_dEntry, int mode);
|
||||
/**
|
||||
* @brief 在文件系统中查找指定的目录项
|
||||
* @param parent_inode 父目录项(在这个目录下查找)
|
||||
|
Reference in New Issue
Block a user