Linux inode引用计数器如何工作?
我知道如果一个进程使用一个文件,inode->I_count.counter将递增 我制作了一个简单的C程序,在不关闭文件的情况下打开一个文件(无限等待循环),并且这个I_计数没有增加,这正常吗Linux inode引用计数器如何工作?,linux,kernel,inode,vfs,Linux,Kernel,Inode,Vfs,我知道如果一个进程使用一个文件,inode->I_count.counter将递增 我制作了一个简单的C程序,在不关闭文件的情况下打开一个文件(无限等待循环),并且这个I_计数没有增加,这正常吗 int main(){ FILE *file1 = NULL; file1 = fopen("file1", "r"); while(1) sleep(1); if (file1)
int main(){
FILE *file1 = NULL;
file1 = fopen("file1", "r");
while(1)
sleep(1);
if (file1)
fclose(file1);
return 0;
}