Thu Dec 31 08:47:15 1998 Norbert Warmuth <nwarmuth@privat.circular.de>
* sfs.c (sfs_nothingisopen): Assume for now it's always save to free this filesystem and delete temporary files. This needs further investigation. * tar.c: deleted unused empty struct tar_super. Thu Dec 31 08:40:44 1998 Norbert Warmuth <nwarmuth@privat.circular.de> * direntry.c: Split fd_usage into fd_usage and ino_usage. fd_usage was used for external and internal reference count. This was wrong because we can free resources taken up by the vfs as soon as the external reference count (now fd_usage) is zero. The internal reference count (ino_usage) mustn't matter because the vfs has to clean up itself in the correct order.
Этот коммит содержится в:
родитель
40fd24d781
Коммит
e4c8a9d060
@ -1,3 +1,20 @@
|
||||
Thu Dec 31 08:47:15 1998 Norbert Warmuth <nwarmuth@privat.circular.de>
|
||||
|
||||
* sfs.c (sfs_nothingisopen): Assume for now it's always save to free
|
||||
this filesystem and delete temporary files. This needs further
|
||||
investigation.
|
||||
|
||||
* tar.c: deleted unused empty struct tar_super.
|
||||
|
||||
Thu Dec 31 08:40:44 1998 Norbert Warmuth <nwarmuth@privat.circular.de>
|
||||
|
||||
* direntry.c: Split fd_usage into fd_usage and ino_usage. fd_usage
|
||||
was used for external and internal reference count. This was wrong
|
||||
because we can free resources taken up by the vfs as soon as the
|
||||
external reference count (now fd_usage) is zero. The internal
|
||||
reference count (ino_usage) mustn't matter because the vfs has to
|
||||
clean up itself in the correct order.
|
||||
|
||||
Fri Dec 25 21:48:51 1998 Norbert Warmuth <nwarmuth@privat.circular.de>
|
||||
|
||||
* direntry.c (vfs_s_new_inode): Moved initialization of st_ino
|
||||
|
@ -49,7 +49,7 @@ vfs_s_inode *vfs_s_new_inode (vfs *me, vfs_s_super *super, struct stat *initstat
|
||||
ino->st.st_ino = MEDATA->inode_counter++;
|
||||
ino->st.st_dev = MEDATA->rdev;
|
||||
|
||||
super->fd_usage++;
|
||||
super->ino_usage++;
|
||||
total_inodes++;
|
||||
|
||||
CALL(init_inode) (me, ino);
|
||||
@ -96,7 +96,7 @@ void vfs_s_free_inode (vfs *me, vfs_s_inode *ino)
|
||||
free(ino->localname);
|
||||
}
|
||||
total_inodes--;
|
||||
ino->super->fd_usage--;
|
||||
ino->super->ino_usage--;
|
||||
free(ino);
|
||||
} else ino->st.st_nlink--;
|
||||
}
|
||||
@ -350,6 +350,7 @@ vfs_s_super *vfs_s_new_super (vfs *me)
|
||||
super->root = NULL;
|
||||
super->name = NULL;
|
||||
super->fd_usage = 0;
|
||||
super->ino_usage = 0;
|
||||
super->me = me;
|
||||
return super;
|
||||
}
|
||||
@ -372,8 +373,8 @@ void vfs_s_free_super (vfs *me, vfs_s_super *super)
|
||||
|
||||
#if 1
|
||||
/* We currently leak small ammount of memory, sometimes. Fix it if you can. */
|
||||
if (super->fd_usage)
|
||||
message_1s1d (1, " Direntry warning ", "Super fd_usage is %d, memory leak", super->fd_usage);
|
||||
if (super->ino_usage)
|
||||
message_1s1d (1, " Direntry warning ", "Super ino_usage is %d, memory leak", super->ino_usage);
|
||||
|
||||
if (super->want_stale)
|
||||
message_1s( 1, " Direntry warning ", "Super has want_stale set" );
|
||||
@ -873,6 +874,7 @@ char *vfs_s_getlocalcopy (vfs *me, char *path)
|
||||
|
||||
if (!ino->localname)
|
||||
ino->localname = mc_def_getlocalcopy (me, buf);
|
||||
/* FIXME: fd_usage++ missing */
|
||||
return ino->localname;
|
||||
}
|
||||
|
||||
|
@ -266,7 +266,9 @@ static void sfs_fill_names (vfs *me, void (*func)(char *))
|
||||
|
||||
static int sfs_nothingisopen (vfsid id)
|
||||
{
|
||||
return 0;
|
||||
/* FIXME: Investigate whether have to guard this like in
|
||||
the other VFSs (see fd_usage in extfs) -- Norbert */
|
||||
return 1;
|
||||
}
|
||||
|
||||
static char *sfs_getlocalcopy (vfs *me, char *path)
|
||||
|
@ -67,11 +67,6 @@ static void tar_free_archive (vfs *me, vfs_s_super *archive)
|
||||
mc_close(archive->u.tar.fd);
|
||||
}
|
||||
|
||||
struct tar_super {
|
||||
};
|
||||
|
||||
#define SUPER_DATA ((struct tar_super *) super->data)
|
||||
|
||||
/* As we open one archive at a time, it is safe to have this static */
|
||||
static int current_tar_position = 0;
|
||||
|
||||
|
@ -75,7 +75,8 @@ typedef struct vfs_s_super {
|
||||
vfs *me;
|
||||
vfs_s_inode *root;
|
||||
char *name; /* My name, whatever it means */
|
||||
int fd_usage; /* Usage count of this superblock */
|
||||
int fd_usage; /* Number of open files */
|
||||
int ino_usage; /* Usage count of this superblock */
|
||||
int want_stale; /* If set, we do not flush cache properly */
|
||||
|
||||
union {
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user