diff options
author | Benjamin Otte <otte@gnome.org> | 2009-06-04 18:41:35 +0200 |
---|---|---|
committer | Benjamin Otte <otte@gnome.org> | 2009-06-11 10:05:40 +0200 |
commit | 5bca61ba06c374b5d4ef197e4805074880ddee20 (patch) | |
tree | e4469dcf08bbb7fbb4ab2d6960277db8bd0ebce4 /daemon/gvfsbackendftp.h | |
parent | 5e3ce10bd814834731ac70e584a90b64ab2860fe (diff) | |
download | gvfs-5bca61ba06c374b5d4ef197e4805074880ddee20.tar.gz |
[FTP] rework cache handling
The cache handling has been split into a separate file and structure
now. While the API still isn't perfect, it's much clearer than before.
It's also faster when looking up lots of symlinks.
Diffstat (limited to 'daemon/gvfsbackendftp.h')
-rw-r--r-- | daemon/gvfsbackendftp.h | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/daemon/gvfsbackendftp.h b/daemon/gvfsbackendftp.h index e1df8b0b..c29b53fa 100644 --- a/daemon/gvfsbackendftp.h +++ b/daemon/gvfsbackendftp.h @@ -58,7 +58,9 @@ typedef enum { G_VFS_FTP_WORKAROUND_FEAT_AFTER_LOGIN, } GVfsFtpWorkaround; -typedef struct FtpDirReader FtpDirReader; +/* forward declarations */ +typedef struct _GVfsFtpDirCache GVfsFtpDirCache; +typedef struct _GVfsFtpDirFuncs GVfsFtpDirFuncs; #define G_VFS_TYPE_BACKEND_FTP (g_vfs_backend_ftp_get_type ()) #define G_VFS_BACKEND_FTP(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), G_VFS_TYPE_BACKEND_FTP, GVfsBackendFtp)) @@ -85,8 +87,9 @@ struct _GVfsBackendFtp int features; /* GVfsFtpFeatures that are supported */ int workarounds; /* GVfsFtpWorkarounds in use - int because it's atomic */ - /* vfuncs */ - const FtpDirReader * dir_ops; + /* directory cache */ + const GVfsFtpDirFuncs *dir_funcs; /* functions used in directory cache */ + GVfsFtpDirCache * dir_cache; /* directory cache */ /* connection collection - accessed from gvfsftptask.c */ GMutex * mutex; /* mutex protecting the following variables */ @@ -94,10 +97,6 @@ struct _GVfsBackendFtp GQueue * queue; /* queue containing the connections */ guint connections; /* current number of connections */ guint max_connections; /* upper server limit for number of connections - dynamically generated */ - - /* caching results from dir queries */ - GStaticRWLock directory_cache_lock; - GHashTable * directory_cache; }; struct _GVfsBackendFtpClass |