0
我试图访问在linux/fs.h中定义的超级块对象。 但是如何初始化对象以便我们可以访问它的属性。 我发现alloc_super()用于初始化超级,但它是如何调用的?在系统调用中访问Linux内核的SuperBlock对象
#include <fcntl.h>
#include <unistd.h>
#include <stdio.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <errno.h>
#include <linux/fs.h>
int main(){
printf("hello there");
struct super_block *sb;
return 0;
}
'super_block'结构描述安装的文件系统。您需要引用该文件系统中的任何对象:inode,file或dentry;相应的'super_block'可以通过该对象的字段访问。 – Tsyvarev