ILD

kernel file operation data struct and api
2025-2-20
本文学习如何在内核进行文件的读写等操作。内核结构体本文又引入路径、文件相关的结构体如下:struct filename这个结构体是内核的路径的一种表示。内核提供接口将路径字符串转换成这个结构体。struct filename *getname(const char __user * filename

shared mounts
2025-2-20
之前查看一个mount命令的manual手册的时候,有了解shared mounts的概念,但是并不是清除是咋回事。LWN有一篇很好的文章,介绍的很清楚:Mount namespaces and shared subtreeshttps://lwn.net/Articles/689856/share

overlayfs (1)
2025-3-16
overlayfs是一种stackable文件系统。本文阅读6.12.1内核overlay源码,来学习stackable文件系统。overlayfs的源码如下,总共大概只有1.3万行$ wc -l fs/overlayfs/* 1299 fs/overlayfs/copy_up.c 1421 f

fallocate and hole
2025-3-19
我们通常了解过sparse filefallcoatefallocate - preallocate or deallocate space to a file删除空间是一个杀手锏,可以像内存一样动态的分配和释放空间。像数据库文件等存储动态数据的文件,都需要可以删除文件的空间。int falloca

stddef.h
2025-3-20
最近开发时,代码使用offsetof宏,编译报错:error: implicit declaration of function ‘offsetof’note: ‘offsetof’ is defined in header ‘’; did you forget to ‘#inc

overlayfs(2)
2025-3-23
前一篇,分析了overlayfs的初始化过程。本篇对overlayfs的具体运行进行分析。super operationsoverlayfs的super operations,定义在fs/overlay/super.cstatic const struct super_operations ovl_

tar preserve nanoseconds timestamps
2025-3-25
今天用tar解压的时候,发现文件的modify time,只精确到秒。$ stat linux-6.12.y/Makefile File: linux-6.12.y/Makefile Size: 68794 Blocks: 136 IO Block: 4096

Copyright © linuxdev.cc 2017-2024. Some Rights Reserved.