* direntry.c (vfs_s_setctl): Implement VFS_SETCTL_FLUSH.
* ftpfs.c: Remove ftpfs_flushdir. Use MEDATA->flush. * fish.c: Use MEDATA->flush.
Этот коммит содержится в:
родитель
0636e2ed73
Коммит
7c4fc715da
@ -1,5 +1,9 @@
|
|||||||
2003-10-16 Pavel Roskin <proski@gnu.org>
|
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.
|
* direntry.c (vfs_s_setctl): Add support to VFS_SETCTL_LOGFILE.
|
||||||
* ftpfs.c (ftpfs_set_debug): Remove.
|
* 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:
|
case VFS_SETCTL_LOGFILE:
|
||||||
MEDATA->logfile = fopen ((char *) arg, "w");
|
MEDATA->logfile = fopen ((char *) arg, "w");
|
||||||
return 1;
|
return 1;
|
||||||
|
case VFS_SETCTL_FLUSH:
|
||||||
|
MEDATA->flush = 1;
|
||||||
|
return 1;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -67,11 +67,6 @@
|
|||||||
#define TRANSIENT 4 /* transient negative completion */
|
#define TRANSIENT 4 /* transient negative completion */
|
||||||
#define ERROR 5 /* permanent 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: */
|
/* command wait_flag: */
|
||||||
#define NONE 0x00
|
#define NONE 0x00
|
||||||
#define WAIT_REPLY 0x01
|
#define WAIT_REPLY 0x01
|
||||||
@ -343,8 +338,8 @@ dir_uptodate(struct vfs_class *me, struct vfs_s_inode *ino)
|
|||||||
struct timeval tim;
|
struct timeval tim;
|
||||||
|
|
||||||
gettimeofday(&tim, NULL);
|
gettimeofday(&tim, NULL);
|
||||||
if (force_expiration) {
|
if (MEDATA->flush) {
|
||||||
force_expiration = 0;
|
MEDATA->flush = 0;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
if (tim.tv_sec < ino->timestamp.tv_sec)
|
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 */
|
/* source routing host */
|
||||||
extern int source_route;
|
extern int source_route;
|
||||||
|
|
||||||
/* If true, the directory cache is forced to reload */
|
|
||||||
static int force_expiration = 0;
|
|
||||||
|
|
||||||
#ifdef FIXME_LATER_ALIGATOR
|
#ifdef FIXME_LATER_ALIGATOR
|
||||||
static struct linklist *connections_list;
|
static struct linklist *connections_list;
|
||||||
#endif
|
#endif
|
||||||
@ -827,19 +824,13 @@ archive_same(struct vfs_class *me, struct vfs_s_super *super, char *archive_name
|
|||||||
return port;
|
return port;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
|
||||||
ftpfs_flushdir (void)
|
|
||||||
{
|
|
||||||
force_expiration = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int
|
static int
|
||||||
dir_uptodate(struct vfs_class *me, struct vfs_s_inode *ino)
|
dir_uptodate(struct vfs_class *me, struct vfs_s_inode *ino)
|
||||||
{
|
{
|
||||||
struct timeval tim;
|
struct timeval tim;
|
||||||
|
|
||||||
if (force_expiration) {
|
if (MEDATA->flush) {
|
||||||
force_expiration = 0;
|
MEDATA->flush = 0;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
gettimeofday(&tim, NULL);
|
gettimeofday(&tim, NULL);
|
||||||
|
@ -142,10 +142,7 @@ void vfs_fill_names (void (*)(char *));
|
|||||||
char *vfs_translate_url (const char *);
|
char *vfs_translate_url (const char *);
|
||||||
|
|
||||||
#ifdef USE_NETCODE
|
#ifdef USE_NETCODE
|
||||||
void ftpfs_flushdir (void);
|
|
||||||
extern int use_netrc;
|
extern int use_netrc;
|
||||||
#else
|
|
||||||
# define ftpfs_flushdir()
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Only the routines outside of the VFS module need the emulation macros */
|
/* Only the routines outside of the VFS module need the emulation macros */
|
||||||
@ -229,6 +226,7 @@ enum {
|
|||||||
VFS_SETCTL_FORGET,
|
VFS_SETCTL_FORGET,
|
||||||
VFS_SETCTL_RUN,
|
VFS_SETCTL_RUN,
|
||||||
VFS_SETCTL_LOGFILE,
|
VFS_SETCTL_LOGFILE,
|
||||||
|
VFS_SETCTL_FLUSH, /* invalidate directory cache */
|
||||||
|
|
||||||
/* Setting this makes vfs layer give out potentially incorrect data,
|
/* Setting this makes vfs layer give out potentially incorrect data,
|
||||||
but it also makes some operations much faster. Use with caution. */
|
but it also makes some operations much faster. Use with caution. */
|
||||||
|
@ -119,6 +119,7 @@ struct vfs_s_subclass {
|
|||||||
int inode_counter;
|
int inode_counter;
|
||||||
dev_t rdev;
|
dev_t rdev;
|
||||||
FILE *logfile;
|
FILE *logfile;
|
||||||
|
int flush; /* if set to 1, invalidate directory cache */
|
||||||
|
|
||||||
int (*init_inode) (struct vfs_class *me, struct vfs_s_inode *ino); /* optional */
|
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 */
|
void (*free_inode) (struct vfs_class *me, struct vfs_s_inode *ino); /* optional */
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user