Re: Speeding up VFS - no more mc_stat("..")



Hi!

This is the third part of the Pavel's patch that speeds up VFS.
".." now is not accepted to the directory list even if VFS layer
returned this one.

> If there is no        
> ".." in the directory list, then a fake ".." is added.  However, mc will       
> no longer go up the hierarchy to find the size of the ".." directory.          
>                                                                               
> So, it you have an account of a system foo and your home directory is bar,     
> then going to /#sh:foo/home/bar/subdir won't cause mc to get the listing       
> of all users under /home.

--
Regards,
Andrew V. Samoilov.

--- src/dir.c	Tue Jan 29 17:18:19 2002
+++ src/dir.c	Thu Jun 20 12:10:21 2002
@@ -378,6 +378,8 @@ handle_dirent (dir_list *list, char *fil
 {
     if (dp->d_name [0] == '.' && dp->d_name [1] == 0)
 	return 0;
+    if (dp->d_name [0] == '.' && dp->d_name [1] == '.' && dp->d_name [2] == 0)
+	return 0;
     if (!show_dot_files){
 	if (dp->d_name [0] == '.'){
 	    if (!(dp->d_name [1] == 0))
@@ -431,6 +433,8 @@ handle_path (dir_list *list, char *path,
 	     int *stalled_link)
 {
     if (path [0] == '.' && path [1] == 0)
+	return 0;
+    if (path [0] == '.' && path [1] == '.' && path [2] == 0)
 	return 0;
     if (mc_lstat (path, buf1) == -1)
         return 0;




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]