* vfs/ftpfs.c (ftpfs_dir_uptodate): Remove.
(init_ftpfs): Adjust the code to reflect the removal of `ftpfs_dir_uptodate'. * vfs/fish.c (fish_dir_uptodate): Remove. (init_fish): Adjust the code to reflect the removal of `fish_dir_uptodate'. * vfs/direntry.c (vfs_s_dir_uptodate): New function. (vfs_s_init_class): Initialize the `dir_uptodate' field of vfs_s_subclass.
Этот коммит содержится в:
родитель
979282dc40
Коммит
c9f1b97869
@ -1,3 +1,15 @@
|
||||
2006-02-23 Pavel Tsekov <ptsekov@gmx.net>
|
||||
|
||||
* ftpfs.c (ftpfs_dir_uptodate): Remove.
|
||||
(init_ftpfs): Adjust the code to reflect the removal of
|
||||
`ftpfs_dir_uptodate'.
|
||||
* fish.c (fish_dir_uptodate): Remove.
|
||||
(init_fish): Adjust the code to reflect the removal of
|
||||
`fish_dir_uptodate'.
|
||||
* direntry.c (vfs_s_dir_uptodate): New function.
|
||||
(vfs_s_init_class): Initialize the `dir_uptodate' field of
|
||||
vfs_s_subclass.
|
||||
|
||||
2006-02-17 Pavel Tsekov <ptsekov@gmx.net>
|
||||
|
||||
* ftpfs.c (ftpfs_dir_load): Do not return error on empty directory
|
||||
|
@ -1111,6 +1111,22 @@ vfs_s_free (vfsid id)
|
||||
vfs_s_free_super (((struct vfs_s_super *)id)->me, (struct vfs_s_super *)id);
|
||||
}
|
||||
|
||||
static int
|
||||
vfs_s_dir_uptodate (struct vfs_class *me, struct vfs_s_inode *ino)
|
||||
{
|
||||
struct timeval tim;
|
||||
|
||||
if (MEDATA->flush) {
|
||||
MEDATA->flush = 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
gettimeofday(&tim, NULL);
|
||||
if (tim.tv_sec < ino->timestamp.tv_sec)
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Initialize one of our subclasses - fill common functions */
|
||||
void
|
||||
vfs_s_init_class (struct vfs_class *vclass, struct vfs_s_subclass *sub)
|
||||
@ -1144,6 +1160,7 @@ vfs_s_init_class (struct vfs_class *vclass, struct vfs_s_subclass *sub)
|
||||
sub->find_entry = vfs_s_find_entry_tree;
|
||||
}
|
||||
vclass->setctl = vfs_s_setctl;
|
||||
sub->dir_uptodate = vfs_s_dir_uptodate;
|
||||
}
|
||||
|
||||
/* ----------- Utility functions for networked filesystems -------------- */
|
||||
|
16
vfs/fish.c
16
vfs/fish.c
@ -353,21 +353,6 @@ fish_archive_same (struct vfs_class *me, struct vfs_s_super *super,
|
||||
return flags;
|
||||
}
|
||||
|
||||
static int
|
||||
fish_dir_uptodate(struct vfs_class *me, struct vfs_s_inode *ino)
|
||||
{
|
||||
struct timeval tim;
|
||||
|
||||
gettimeofday(&tim, NULL);
|
||||
if (MEDATA->flush) {
|
||||
MEDATA->flush = 0;
|
||||
return 0;
|
||||
}
|
||||
if (tim.tv_sec < ino->timestamp.tv_sec)
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
fish_dir_load(struct vfs_class *me, struct vfs_s_inode *dir, char *remote_path)
|
||||
{
|
||||
@ -925,7 +910,6 @@ init_fish (void)
|
||||
fish_subclass.free_archive = fish_free_archive;
|
||||
fish_subclass.fh_open = fish_fh_open;
|
||||
fish_subclass.dir_load = fish_dir_load;
|
||||
fish_subclass.dir_uptodate = fish_dir_uptodate;
|
||||
fish_subclass.file_store = fish_file_store;
|
||||
fish_subclass.linear_start = fish_linear_start;
|
||||
fish_subclass.linear_read = fish_linear_read;
|
||||
|
16
vfs/ftpfs.c
16
vfs/ftpfs.c
@ -819,21 +819,6 @@ ftpfs_archive_same (struct vfs_class *me, struct vfs_s_super *super,
|
||||
return port;
|
||||
}
|
||||
|
||||
static int
|
||||
ftpfs_dir_uptodate(struct vfs_class *me, struct vfs_s_inode *ino)
|
||||
{
|
||||
struct timeval tim;
|
||||
|
||||
if (MEDATA->flush) {
|
||||
MEDATA->flush = 0;
|
||||
return 0;
|
||||
}
|
||||
gettimeofday(&tim, NULL);
|
||||
if (tim.tv_sec < ino->timestamp.tv_sec)
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* The returned directory should always contain a trailing slash */
|
||||
static char *
|
||||
ftpfs_get_current_directory (struct vfs_class *me, struct vfs_s_super *super)
|
||||
@ -2000,7 +1985,6 @@ init_ftpfs (void)
|
||||
ftpfs_subclass.fh_open = ftpfs_fh_open;
|
||||
ftpfs_subclass.fh_close = ftpfs_fh_close;
|
||||
ftpfs_subclass.dir_load = ftpfs_dir_load;
|
||||
ftpfs_subclass.dir_uptodate = ftpfs_dir_uptodate;
|
||||
ftpfs_subclass.file_store = ftpfs_file_store;
|
||||
ftpfs_subclass.linear_start = ftpfs_linear_start;
|
||||
ftpfs_subclass.linear_read = ftpfs_linear_read;
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user