
filesystem
天麓
很懒的码农
展开
-
不同的进程是否能够共享fd
如果不同的进程(线程)是父子关系,而且共享fd,则他们可以共享fd。否则无法共享fd,因为他们属于不同的进程空间,不同的进程的进程空间互相隔离。不同的进程可以访问/proc/pid_id/fd看到别的进程的句柄...原创 2021-03-04 06:26:51 · 1334 阅读 · 1 评论 -
文件系统学习4 文件open read write等操作
系统调用接口const struct file_operations ext2_file_operations = { .llseek = generic_file_llseek, .read = do_sync_read, .write = do_sync_write, .aio_read = generic_file_a...原创 2017-12-02 23:12:59 · 725 阅读 · 0 评论 -
微视linux tmpfs文件系统
linux内核tmpfs/shmem浅析https://blog.youkuaiyun.com/ctthuangcheng/article/details/8916065原创 2020-05-01 21:47:28 · 222 阅读 · 0 评论 -
慢慢欣赏linux ext3文件系统 获取日志块
void journal_commit_transaction(journal_t *journal){ err = journal_submit_data_buffers(journal, commit_transaction, write_op);//先刷数据 while (commit_transaction->t_buffers) { descriptor ...原创 2020-04-12 21:51:43 · 191 阅读 · 0 评论 -
文件系统学习2 inode
参考 Linux的inode的理解 http://www.linuxidc.com/Linux/2014-09/106457.htm原创 2017-11-28 07:36:54 · 500 阅读 · 0 评论 -
慢慢欣赏linux ext3文件系统 直接块和间接块
一个村,一片地用于集资建房。前面12个人申请,由于没规划好,直接申请了平房 |_|_|_|_|_|_|_。第13个人申请的时候,发现地皮不太够用了,就盖一梯一户的房子。|_|_|_|_|_|_|_|_假设n=sizeof(block)/sizeof(pointer)第12+n+1个人申请的时候,就盖1梯n户的房子。|_|_|_|_|_|_||_|_|_|_|_|_||...原创 2020-03-20 22:14:26 · 432 阅读 · 0 评论 -
慢慢欣赏linux ext3文件系统 理解buffer_head域成员b_size
对通用日志层JBD的理解http://blog.chinaunix.net/uid-7494944-id-3833306.htmljournal block device (jbd)源代码分析——ext3日志机制分析http://bbs.chinaunix.net/thread-1922346-1-1.htmlLINUX 文件系统JBD ----深入理解Fsynchttps://w...原创 2019-06-02 22:02:16 · 465 阅读 · 0 评论 -
微视linux 文件系统之打开文件create模式
struct file *do_last(struct nameidata *nd, struct path *path, int open_flag, int acc_mode, int mode, const char *pathname){ struct dentry *dir = nd->path.dentry; /* just plain ope...原创 2020-02-23 11:38:52 · 321 阅读 · 0 评论 -
微视linux 文件系统之打开文件返回只读
struct file *do_last(struct nameidata *nd, struct path *path, int open_flag, int acc_mode, int mode, const char *pathname){ if (!(open_flag & O_CREAT)) { error = do_lookup(nd, &...原创 2020-02-22 18:52:57 · 286 阅读 · 0 评论 -
从文件系统的角度理解硬链接和软连接
linux创建VFS虚拟文件系统对象,具体的文件系统通过多态的方法实现。硬链接对应实实在在的文件,必须指向实际存在的文件,不能跨越分区原创 2017-05-25 20:06:05 · 354 阅读 · 0 评论 -
微视linux 根文件系统之三 内核解压缩
设备树解析,获取initrd基地址和大小void __init early_init_dt_check_for_initrd(unsigned long node){ unsigned long start, end, len; __be32 *prop; pr_debug("Looking for initrd properties... "); prop = of_get_...原创 2019-10-20 12:01:14 · 354 阅读 · 0 评论 -
微视linux 根文件系统之二 bootloader(以uboot为例)的准备
初始化linux内核镜像结构static int bootm_start(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]){ memset((void *)&images, 0, sizeof(images)); images.verify = env_get_yesno("verify");...原创 2019-10-20 11:48:11 · 307 阅读 · 1 评论 -
微视linux 根文件系统之一 虚拟根文件系统的创建
void __init mnt_init(void){ init_rootfs(); =>int __init init_rootfs(void) { err = register_filesystem(&rootfs_fs_type); static struct file_system_type rootfs_fs_type = { .name = ...原创 2019-06-09 16:01:04 · 207 阅读 · 0 评论