Warning: The magic method Math_Captcha::__wakeup() must have public visibility in /home/wwwroot/blog.gotocoding.com/wp-content/plugins/wp-math-captcha/wp-math-captcha.php on line 87

Warning: Cannot modify header information - headers already sent by (output started at /home/wwwroot/blog.gotocoding.com/wp-content/plugins/wp-math-captcha/wp-math-captcha.php:87) in /home/wwwroot/blog.gotocoding.com/wp-content/plugins/wp-math-captcha/includes/class-cookie-session.php on line 46

Warning: Cannot modify header information - headers already sent by (output started at /home/wwwroot/blog.gotocoding.com/wp-content/plugins/wp-math-captcha/wp-math-captcha.php:87) in /home/wwwroot/blog.gotocoding.com/wp-content/plugins/wp-math-captcha/includes/class-cookie-session.php on line 49

Warning: Cannot modify header information - headers already sent by (output started at /home/wwwroot/blog.gotocoding.com/wp-content/plugins/wp-math-captcha/wp-math-captcha.php:87) in /home/wwwroot/blog.gotocoding.com/wp-content/plugins/wp-math-captcha/includes/class-cookie-session.php on line 49

Warning: Cannot modify header information - headers already sent by (output started at /home/wwwroot/blog.gotocoding.com/wp-content/plugins/wp-math-captcha/wp-math-captcha.php:87) in /home/wwwroot/blog.gotocoding.com/wp-content/plugins/wp-math-captcha/includes/class-cookie-session.php on line 49

Warning: Cannot modify header information - headers already sent by (output started at /home/wwwroot/blog.gotocoding.com/wp-content/plugins/wp-math-captcha/wp-math-captcha.php:87) in /home/wwwroot/blog.gotocoding.com/wp-content/plugins/wp-math-captcha/includes/class-cookie-session.php on line 49

Warning: Cannot modify header information - headers already sent by (output started at /home/wwwroot/blog.gotocoding.com/wp-content/plugins/wp-math-captcha/wp-math-captcha.php:87) in /home/wwwroot/blog.gotocoding.com/wp-content/plugins/wp-math-captcha/includes/class-cookie-session.php on line 49

Warning: Undefined array key "action" in /home/wwwroot/blog.gotocoding.com/wp-content/plugins/wp-recentcomments/core.php on line 7

Warning: Undefined array key "action" in /home/wwwroot/blog.gotocoding.com/wp-content/plugins/wp-recentcomments/core.php on line 12
关于linux0.12文件系统目录大小的一个发现 | 重归混沌的BLOG

关于linux0.12文件系统目录大小的一个发现

今天看到empty_dir函数发现他并不是比较i_size==32来判断是否为空,而是去读所有的块来判断是否为空,然后就觉得很奇怪,不过总觉得事出必有因,翻来覆去的找了一下,终于有了点发现,去看了一下add_entry和sys_rmdir这两个函数终于发现了一个事实!那就是目录文件的大小只会增大不会减小。下面是实验的截图:

在这个实验里我们可以看到当我建立了test2 test3 test4四个文件后

test1目录变成了80,但是我删除这3个目录项后,test1目录并没有减少,这就说明了,在empty_dir中为什么linus遍历来确定目录是不是为空了!不知道这算不算是一个小bug,还是minix1.0的文件系统中本就是如此!

发表评论

+ 46 = forty seven