VFS core: vfs_s_free_inode() function have global visibility

Signed-off-by: Slava Zanko <slavazanko@gmail.com>
This commit is contained in:
Slava Zanko 2011-07-20 00:36:05 +03:00
parent e2c326997f
commit d69d9b31f1
2 changed files with 32 additions and 29 deletions

View File

@ -109,35 +109,6 @@ vfs_s_entry_compare (const void *a, const void *b)
/* --------------------------------------------------------------------------------------------- */ /* --------------------------------------------------------------------------------------------- */
static void
vfs_s_free_inode (struct vfs_class *me, struct vfs_s_inode *ino)
{
if (ino == NULL)
vfs_die ("Don't pass NULL to me");
/* ==0 can happen if freshly created entry is deleted */
if (ino->st.st_nlink > 1)
{
ino->st.st_nlink--;
return;
}
while (ino->subdir != NULL)
vfs_s_free_entry (me, (struct vfs_s_entry *) ino->subdir->data);
CALL (free_inode) (me, ino);
g_free (ino->linkname);
if ((MEDATA->flags & VFS_S_USETMP) != 0 && ino->localname != NULL)
{
unlink (ino->localname);
g_free (ino->localname);
}
total_inodes--;
ino->super->ino_usage--;
g_free (ino);
}
/* --------------------------------------------------------------------------------------------- */
/* We were asked to create entries automagically */ /* We were asked to create entries automagically */
static struct vfs_s_entry * static struct vfs_s_entry *
@ -953,6 +924,36 @@ vfs_s_new_inode (struct vfs_class *me, struct vfs_s_super *super, struct stat *i
/* --------------------------------------------------------------------------------------------- */ /* --------------------------------------------------------------------------------------------- */
void
vfs_s_free_inode (struct vfs_class *me, struct vfs_s_inode *ino)
{
if (ino == NULL)
vfs_die ("Don't pass NULL to me");
/* ==0 can happen if freshly created entry is deleted */
if (ino->st.st_nlink > 1)
{
ino->st.st_nlink--;
return;
}
while (ino->subdir != NULL)
vfs_s_free_entry (me, (struct vfs_s_entry *) ino->subdir->data);
CALL (free_inode) (me, ino);
g_free (ino->linkname);
if ((MEDATA->flags & VFS_S_USETMP) != 0 && ino->localname != NULL)
{
unlink (ino->localname);
g_free (ino->localname);
}
total_inodes--;
ino->super->ino_usage--;
g_free (ino);
}
/* --------------------------------------------------------------------------------------------- */
struct vfs_s_entry * struct vfs_s_entry *
vfs_s_new_entry (struct vfs_class *me, const char *name, struct vfs_s_inode *inode) vfs_s_new_entry (struct vfs_class *me, const char *name, struct vfs_s_inode *inode)
{ {

View File

@ -158,6 +158,8 @@ struct vfs_s_subclass
/* entries and inodes */ /* entries and inodes */
struct vfs_s_inode *vfs_s_new_inode (struct vfs_class *me, struct vfs_s_inode *vfs_s_new_inode (struct vfs_class *me,
struct vfs_s_super *super, struct stat *initstat); struct vfs_s_super *super, struct stat *initstat);
void vfs_s_free_inode (struct vfs_class *me, struct vfs_s_inode *ino);
struct vfs_s_entry *vfs_s_new_entry (struct vfs_class *me, const char *name, struct vfs_s_entry *vfs_s_new_entry (struct vfs_class *me, const char *name,
struct vfs_s_inode *inode); struct vfs_s_inode *inode);
void vfs_s_free_entry (struct vfs_class *me, struct vfs_s_entry *ent); void vfs_s_free_entry (struct vfs_class *me, struct vfs_s_entry *ent);