ILD

fuse soft link to hard link support
2024-12-12
前一篇文章,设计了用于fuse的数据结构。https://linuxdev.cc/article/a0iby1.html struct inode { struct hlist_node hash; unsigned refcnt; uint64_t ino; struct

ETXTBSY is dropped
2024-12-20
以前,尝试修改正在运行的程序的可执行文件,将报错,返回,ETXTBSY 26 Text file busy现在,这个限制已经去掉了。比如把cat拷贝出来,执行,然后,清空它。~$ cp `which cat` .~$ ./cat然后在另外一个终端,清空cat,发现没有报错。~$ > cat回到执行c

Linux ACL - Access Control Lists
2024-12-25
Linux支持POSIX ACL。Linux常规的file mode,支持user/group/other 3种权限控制。它的缺点,对于非user和group的other,权限都是一样的。通过ACL可以设置特定user或特定group的访问权限。在文件共享需要灵活设置权限时,ACL就派上了用场。AC

libfuse splice support
2025-2-12
libfuse支持splice,来实现文件读写时,fuse内核模块和fuse server的零拷贝支持。只有读写涉及到大缓存,才需要零拷贝。其它的消息如unlink等,显然不需要splice。fuse还支持passthrough,passthrough模式和splice不一样。passthrough

fuse direct io mode
2025-2-12
使用fuse实现一个控制接口文件,先写入命令,然后读取结果。读取的时候发现一直返回0。控制命令如下:fd = open(NAS_MNT "/album/control", O_RDWR);write(fd, "reload\n", 7);lseek(fd, 0, SEEK_SET);ret = re

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

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

child sub reaper
2025-5-12
在平台上做进程管理,之前一直以为需要是init进程,因为orphane进程的父进程会变成1号进程。但是今天在我的fedora上,在后台执行一个gedit进程,然后shell退出,发现gedit的父进程竟然是systemd。于是搜索了一下,发现Linux有一个child sub reaper机

signal mask and synchronous I/O multiplexing
2025-5-19
当信号处理碰到IO复用模型,有许多需要考虑的问题。比如我们的程序,需要CTRL+C的时候,优雅的退出进程。我们在信号处理函数设置一个标记,然后在主循环里面,检测到此标记的时候退出循环。#include #include #include #i

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