Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion components/dfs/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ if RT_USING_SMART
default y
config RT_USING_DFS_PROCFS
bool "Enable proc file system"
default n
default y
Copy link

Copilot AI May 19, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Update for RT_USING_DFS_PROCFS default is appropriate; however, add an inline comment explaining that enabling procfs by default under smart is intentional to improve maintainability.

Copilot uses AI. Check for mistakes.
endif

config RT_USING_DFS_CROMFS
Expand All @@ -204,11 +204,13 @@ endif

config RT_USING_DFS_TMPFS
bool "Enable TMP file system"
default y if RT_USING_SMART
Copy link

Copilot AI May 19, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] For clarity, consider including a comment that details why TMPFS (and similarly MQUEUE on line 213) is conditionally enabled when using smart configurations.

Copilot uses AI. Check for mistakes.
default n

config RT_USING_DFS_MQUEUE
bool "Enable MQUEUE file system"
select RT_USING_DEV_BUS
default y if RT_USING_SMART
default n

if RT_USING_DFS_V1
Expand Down
2 changes: 2 additions & 0 deletions components/dfs/dfs_v2/filesystems/procfs/proc_net.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ static void *seq_next(struct dfs_seq_file *seq, void *data, off_t *index)
return NULL;
}

#if LWIP_ROUTE
Copy link

Copilot AI May 19, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Consider adding a comment explaining that the route_show function is conditionally compiled based on the LWIP_ROUTE flag to clarify its dependency for future maintainers.

Copilot uses AI. Check for mistakes.
static void route_show(const char *name, uint32_t ip_addr, uint32_t netmask, void *parameter)
{
struct dfs_seq_file *seq = (struct dfs_seq_file *)parameter;
Expand All @@ -66,6 +67,7 @@ static void route_show(const char *name, uint32_t ip_addr, uint32_t netmask, voi
dfs_seq_printf(seq, "%d ", 0);
dfs_seq_printf(seq, "%d\n", 0);
}
#endif

static int seq_show(struct dfs_seq_file *seq, void *data)
{
Expand Down
2 changes: 1 addition & 1 deletion components/dfs/dfs_v2/filesystems/procfs/procfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ static int dfs_procfs_stat(struct dfs_dentry *dentry, struct stat *st)
{
vnode = dentry->vnode;

st->st_dev = (dev_t)(dentry->mnt->dev_id);
st->st_dev = (dev_t)(rt_ubase_t)(dentry->mnt->dev_id);
st->st_ino = (ino_t)dfs_dentry_full_path_crc32(dentry);

st->st_gid = vnode->gid;
Expand Down
5 changes: 5 additions & 0 deletions components/drivers/core/mnt.c
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,11 @@ static int fstab_mnt_init(void)
msh_exec_script("fstab.sh", 16);
#endif

#ifdef RT_USING_DFS_PROCFS
mkdir("/proc", 0755);
dfs_mount(RT_NULL, "/proc", "procfs", 0, RT_NULL);
#endif

LOG_I("File system initialization done");

return 0;
Expand Down