mirror of https://github.com/MidnightCommander/mc
* direntry.c (vfs_s_setctl): Implement VFS_SETCTL_FLUSH.
* ftpfs.c: Remove ftpfs_flushdir. Use MEDATA->flush. * fish.c: Use MEDATA->flush.
This commit is contained in:
parent
0636e2ed73
commit
7c4fc715da
|
@ -1,5 +1,9 @@
|
|||
2003-10-16 Pavel Roskin <proski@gnu.org>
|
||||
|
||||
* direntry.c (vfs_s_setctl): Implement VFS_SETCTL_FLUSH.
|
||||
* ftpfs.c: Remove ftpfs_flushdir. Use MEDATA->flush.
|
||||
* fish.c: Use MEDATA->flush.
|
||||
|
||||
* direntry.c (vfs_s_setctl): Add support to VFS_SETCTL_LOGFILE.
|
||||
* ftpfs.c (ftpfs_set_debug): Remove.
|
||||
|
||||
|
|
|
@ -1013,6 +1013,9 @@ vfs_s_setctl (struct vfs_class *me, char *path, int ctlop, void *arg)
|
|||
case VFS_SETCTL_LOGFILE:
|
||||
MEDATA->logfile = fopen ((char *) arg, "w");
|
||||
return 1;
|
||||
case VFS_SETCTL_FLUSH:
|
||||
MEDATA->flush = 1;
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -67,11 +67,6 @@
|
|||
#define TRANSIENT 4 /* transient negative completion */
|
||||
#define ERROR 5 /* permanent negative completion */
|
||||
|
||||
/* If true, the directory cache is forced to reload */
|
||||
static int force_expiration = 0;
|
||||
|
||||
/* FIXME: prev two variables should be killed */
|
||||
|
||||
/* command wait_flag: */
|
||||
#define NONE 0x00
|
||||
#define WAIT_REPLY 0x01
|
||||
|
@ -343,8 +338,8 @@ dir_uptodate(struct vfs_class *me, struct vfs_s_inode *ino)
|
|||
struct timeval tim;
|
||||
|
||||
gettimeofday(&tim, NULL);
|
||||
if (force_expiration) {
|
||||
force_expiration = 0;
|
||||
if (MEDATA->flush) {
|
||||
MEDATA->flush = 0;
|
||||
return 0;
|
||||
}
|
||||
if (tim.tv_sec < ino->timestamp.tv_sec)
|
||||
|
|
13
vfs/ftpfs.c
13
vfs/ftpfs.c
|
@ -131,9 +131,6 @@ int ftpfs_always_use_proxy;
|
|||
/* source routing host */
|
||||
extern int source_route;
|
||||
|
||||
/* If true, the directory cache is forced to reload */
|
||||
static int force_expiration = 0;
|
||||
|
||||
#ifdef FIXME_LATER_ALIGATOR
|
||||
static struct linklist *connections_list;
|
||||
#endif
|
||||
|
@ -827,19 +824,13 @@ archive_same(struct vfs_class *me, struct vfs_s_super *super, char *archive_name
|
|||
return port;
|
||||
}
|
||||
|
||||
void
|
||||
ftpfs_flushdir (void)
|
||||
{
|
||||
force_expiration = 1;
|
||||
}
|
||||
|
||||
static int
|
||||
dir_uptodate(struct vfs_class *me, struct vfs_s_inode *ino)
|
||||
{
|
||||
struct timeval tim;
|
||||
|
||||
if (force_expiration) {
|
||||
force_expiration = 0;
|
||||
if (MEDATA->flush) {
|
||||
MEDATA->flush = 0;
|
||||
return 0;
|
||||
}
|
||||
gettimeofday(&tim, NULL);
|
||||
|
|
|
@ -142,10 +142,7 @@ void vfs_fill_names (void (*)(char *));
|
|||
char *vfs_translate_url (const char *);
|
||||
|
||||
#ifdef USE_NETCODE
|
||||
void ftpfs_flushdir (void);
|
||||
extern int use_netrc;
|
||||
#else
|
||||
# define ftpfs_flushdir()
|
||||
#endif
|
||||
|
||||
/* Only the routines outside of the VFS module need the emulation macros */
|
||||
|
@ -229,6 +226,7 @@ enum {
|
|||
VFS_SETCTL_FORGET,
|
||||
VFS_SETCTL_RUN,
|
||||
VFS_SETCTL_LOGFILE,
|
||||
VFS_SETCTL_FLUSH, /* invalidate directory cache */
|
||||
|
||||
/* Setting this makes vfs layer give out potentially incorrect data,
|
||||
but it also makes some operations much faster. Use with caution. */
|
||||
|
|
|
@ -119,6 +119,7 @@ struct vfs_s_subclass {
|
|||
int inode_counter;
|
||||
dev_t rdev;
|
||||
FILE *logfile;
|
||||
int flush; /* if set to 1, invalidate directory cache */
|
||||
|
||||
int (*init_inode) (struct vfs_class *me, struct vfs_s_inode *ino); /* optional */
|
||||
void (*free_inode) (struct vfs_class *me, struct vfs_s_inode *ino); /* optional */
|
||||
|
|
Loading…
Reference in New Issue