From 67cd859ea3dcd22db5b9cd35077f40822ef4ade9 Mon Sep 17 00:00:00 2001 From: Pavel Roskin Date: Tue, 28 Oct 2003 08:20:30 +0000 Subject: [PATCH] * direntry.c (vfs_s_init_class): Use our getlocalcopy for remote filesystems that cache files, not for archives. (vfs_s_getlocalcopy): Corresponding changes. --- vfs/ChangeLog | 4 ++++ vfs/direntry.c | 14 ++++++++------ 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/vfs/ChangeLog b/vfs/ChangeLog index 30020e02d..a325533f6 100644 --- a/vfs/ChangeLog +++ b/vfs/ChangeLog @@ -1,5 +1,9 @@ 2003-10-28 Pavel Roskin + * direntry.c (vfs_s_init_class): Use our getlocalcopy for remote + filesystems that cache files, not for archives. + (vfs_s_getlocalcopy): Corresponding changes. + * direntry.c (vfs_s_init_class): Improve interface to allow more code reuse. Change all callers. (vfs_s_getlocalcopy): New implementation. Don't use diff --git a/vfs/direntry.c b/vfs/direntry.c index 44fba5d86..93484127f 100644 --- a/vfs/direntry.c +++ b/vfs/direntry.c @@ -973,19 +973,21 @@ vfs_s_ferrno (struct vfs_class *me) return me->verrno; } -/* Get local copy of the given file. We reuse the existing cache. */ +/* + * Get local copy of the given file. We reuse the existing file cache + * for remote filesystems. Archives use standard VFS facilities. + */ static char * vfs_s_getlocalcopy (struct vfs_class *me, const char *path) { - struct vfs_s_inode *ino; struct vfs_s_fh *fh; char *local; fh = vfs_s_open (me, path, O_RDONLY, 0); - if (!fh || !fh->ino || !fh->ino->localname) + if (!fh || !fh->ino || fh->ino->localname) return NULL; - local = g_strdup (ino->localname); + local = g_strdup (fh->ino->localname); vfs_s_close (fh); return local; } @@ -1097,10 +1099,10 @@ vfs_s_init_class (struct vfs_class *vclass, struct vfs_s_subclass *sub) vclass->nothingisopen = vfs_s_nothingisopen; vclass->free = vfs_s_free; if (sub->flags & VFS_S_REMOTE) { - sub->find_entry = vfs_s_find_entry_linear; - } else { vclass->getlocalcopy = vfs_s_getlocalcopy; vclass->ungetlocalcopy = vfs_s_ungetlocalcopy; + sub->find_entry = vfs_s_find_entry_linear; + } else { sub->find_entry = vfs_s_find_entry_tree; } vclass->setctl = vfs_s_setctl;