发布时间:2020-10-05 23:30:50
参考原文http://blog.163.com/xujian900308@126/blog/static/126907615201191985817385/http://blog.163.com/xujian900308@126/blog/static/12690761520119198237958/VFS的实现,其主要思想是引入了一个通用的文件模型(common file model),这个模型的核心是四个对象类型,即超级.........【阅读全文】
发布时间:2020-10-05 23:29:06
参考<<深入分析Linux内核源码>>fs/pipe.c 管道文件系统pipefspipefs是一种简单的、虚拟的文件系统类型,因为它没有对应的物理设备,因此其安装时不需要块设备#define fs_initcall(fn)__define_initcall("5",fn,5)#define __define_initcall(level,fn,id) \static initcall_t __init.........【阅读全文】
发布时间:2020-10-05 23:26:29
fs/namespace.c SYSCALL_DEFINE5(mount, char __user *, dev_name, char __user *, dir_name, char __user *, type, unsigned long, flags, void __user *, data){ int retval; unsigned long data_page; unsigned long type_page; unsigned long dev_page; char *dir_.........【阅读全文】
发布时间:2020-10-05 23:24:52
fs/目录下的read_write.cSYSCALL_DEFINE3(write, unsigned int, fd, const char __user *, buf, size_t, count){ struct file *file; ssize_t ret = -EBADF; int fput_needed; file = fget_light(fd, &fput_ne.........【阅读全文】
发布时间:2020-10-05 23:23:01
fs/fcntl.c SYSCALL_DEFINE3(fcntl, unsigned int, fd, unsigned int, cmd, unsigned long, arg){struct file *filp;long err = -EBADF;filp = fget(fd);if (!filp)goto out;err = security_file_fcntl(filp, cmd, arg);if (err) {fput(filp);return err;}.........【阅读全文】