* gc.c (vfs_ncs_getid): Merge with vfs_getid().
Этот коммит содержится в:
родитель
6ffd35bf07
Коммит
fc9bf6040f
@ -1,5 +1,7 @@
|
|||||||
2003-11-26 Pavel Roskin <proski@gnu.org>
|
2003-11-26 Pavel Roskin <proski@gnu.org>
|
||||||
|
|
||||||
|
* gc.c (vfs_ncs_getid): Merge with vfs_getid().
|
||||||
|
|
||||||
* gc.c: Eliminate all code for timestamping parent filesystems.
|
* gc.c: Eliminate all code for timestamping parent filesystems.
|
||||||
It's broken and undocumented. Adjust all dependencies.
|
It's broken and undocumented. Adjust all dependencies.
|
||||||
|
|
||||||
|
36
vfs/gc.c
36
vfs/gc.c
@ -109,30 +109,20 @@ vfs_rmstamp (struct vfs_class *v, vfsid id)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Wrapper around getid methods */
|
/* Find VFS id for given directory name */
|
||||||
vfsid
|
vfsid
|
||||||
vfs_getid (struct vfs_class *vclass, const char *path)
|
vfs_getid (struct vfs_class *vclass, const char *dir)
|
||||||
{
|
{
|
||||||
|
char *dir1;
|
||||||
vfsid id = NULL;
|
vfsid id = NULL;
|
||||||
|
|
||||||
if (vclass->getid)
|
/* append slash if needed */
|
||||||
id = (*vclass->getid) (vclass, path);
|
|
||||||
|
|
||||||
return id;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* Same as vfs_getid, but append slash to the path if needed */
|
|
||||||
vfsid
|
|
||||||
vfs_ncs_getid (struct vfs_class *nvfs, const char *dir)
|
|
||||||
{
|
|
||||||
vfsid nvfsid;
|
|
||||||
char *dir1;
|
|
||||||
|
|
||||||
dir1 = concat_dir_and_file (dir, "");
|
dir1 = concat_dir_and_file (dir, "");
|
||||||
nvfsid = vfs_getid (nvfs, dir1);
|
if (vclass->getid)
|
||||||
|
id = (*vclass->getid) (vclass, dir1);
|
||||||
|
|
||||||
g_free (dir1);
|
g_free (dir1);
|
||||||
return nvfsid;
|
return id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -143,7 +133,7 @@ vfs_stamp_path (char *path)
|
|||||||
vfsid id;
|
vfsid id;
|
||||||
|
|
||||||
vfs = vfs_get_class (path);
|
vfs = vfs_get_class (path);
|
||||||
id = vfs_ncs_getid (vfs, path);
|
id = vfs_getid (vfs, path);
|
||||||
vfs_addstamp (vfs, id);
|
vfs_addstamp (vfs, id);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -166,7 +156,7 @@ vfs_stamp_create (struct vfs_class *oldvfs, vfsid oldvfsid)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
nvfs = vfs_get_class (vfs_get_current_dir ());
|
nvfs = vfs_get_class (vfs_get_current_dir ());
|
||||||
nvfsid = vfs_ncs_getid (nvfs, vfs_get_current_dir ());
|
nvfsid = vfs_getid (nvfs, vfs_get_current_dir ());
|
||||||
vfs_rmstamp (nvfs, nvfsid);
|
vfs_rmstamp (nvfs, nvfsid);
|
||||||
|
|
||||||
if ((nvfs == oldvfs && nvfsid == oldvfsid) || oldvfsid == NULL) {
|
if ((nvfs == oldvfs && nvfsid == oldvfsid) || oldvfsid == NULL) {
|
||||||
@ -175,7 +165,7 @@ vfs_stamp_create (struct vfs_class *oldvfs, vfsid oldvfsid)
|
|||||||
|
|
||||||
if (get_current_type () == view_listing) {
|
if (get_current_type () == view_listing) {
|
||||||
n2vfs = vfs_get_class (current_panel->cwd);
|
n2vfs = vfs_get_class (current_panel->cwd);
|
||||||
n2vfsid = vfs_ncs_getid (n2vfs, current_panel->cwd);
|
n2vfsid = vfs_getid (n2vfs, current_panel->cwd);
|
||||||
if (n2vfs == oldvfs && n2vfsid == oldvfsid)
|
if (n2vfs == oldvfs && n2vfsid == oldvfsid)
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
@ -185,7 +175,7 @@ vfs_stamp_create (struct vfs_class *oldvfs, vfsid oldvfsid)
|
|||||||
|
|
||||||
if (get_other_type () == view_listing) {
|
if (get_other_type () == view_listing) {
|
||||||
n3vfs = vfs_get_class (other_panel->cwd);
|
n3vfs = vfs_get_class (other_panel->cwd);
|
||||||
n3vfsid = vfs_ncs_getid (n3vfs, other_panel->cwd);
|
n3vfsid = vfs_getid (n3vfs, other_panel->cwd);
|
||||||
if (n3vfs == oldvfs && n3vfsid == oldvfsid)
|
if (n3vfs == oldvfs && n3vfsid == oldvfsid)
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
@ -285,7 +275,7 @@ vfs_release_path (const char *dir)
|
|||||||
vfsid oldvfsid;
|
vfsid oldvfsid;
|
||||||
|
|
||||||
oldvfs = vfs_get_class (dir);
|
oldvfs = vfs_get_class (dir);
|
||||||
oldvfsid = vfs_ncs_getid (oldvfs, dir);
|
oldvfsid = vfs_getid (oldvfs, dir);
|
||||||
vfs_stamp_create (oldvfs, oldvfsid);
|
vfs_stamp_create (oldvfs, oldvfsid);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
7
vfs/gc.h
7
vfs/gc.h
@ -10,16 +10,15 @@ struct vfs_stamping {
|
|||||||
|
|
||||||
extern int vfs_timeout;
|
extern int vfs_timeout;
|
||||||
|
|
||||||
void vfs_stamp (struct vfs_class *v, vfsid id);
|
void vfs_stamp (struct vfs_class *vclass, vfsid id);
|
||||||
void vfs_rmstamp (struct vfs_class *v, vfsid id);
|
void vfs_rmstamp (struct vfs_class *vclass, vfsid id);
|
||||||
void vfs_stamp_create (struct vfs_class *vclass, vfsid id);
|
void vfs_stamp_create (struct vfs_class *vclass, vfsid id);
|
||||||
void vfs_add_current_stamps (void);
|
void vfs_add_current_stamps (void);
|
||||||
void vfs_timeout_handler (void);
|
void vfs_timeout_handler (void);
|
||||||
void vfs_expire (int now);
|
void vfs_expire (int now);
|
||||||
int vfs_timeouts (void);
|
int vfs_timeouts (void);
|
||||||
void vfs_release_path (const char *dir);
|
void vfs_release_path (const char *dir);
|
||||||
vfsid vfs_getid (struct vfs_class *vclass, const char *path);
|
vfsid vfs_getid (struct vfs_class *vclass, const char *dir);
|
||||||
vfsid vfs_ncs_getid (struct vfs_class *nvfs, const char *dir);
|
|
||||||
void vfs_gc_done (void);
|
void vfs_gc_done (void);
|
||||||
|
|
||||||
#endif /* __GC_H */
|
#endif /* __GC_H */
|
||||||
|
@ -684,7 +684,7 @@ mc_chdir (const char *path)
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
old_vfsid = vfs_ncs_getid (current_vfs, current_dir);
|
old_vfsid = vfs_getid (current_vfs, current_dir);
|
||||||
old_vfs = current_vfs;
|
old_vfs = current_vfs;
|
||||||
|
|
||||||
/* Actually change directory */
|
/* Actually change directory */
|
||||||
|
Загрузка…
Ссылка в новой задаче
Block a user