X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=fuse%2Fdircache.c;h=771e3133ebb516b249c1d9e392d68c4f1ef806ca;hb=14b1e7b963cd5446ab76a067085b91925dd5d3e3;hp=1028926084f1e47307680dc9b78b8be865e7755b;hpb=9a8889e4d0c532b9f77af3a9cc7aae06adebfb83;p=libguestfs.git diff --git a/fuse/dircache.c b/fuse/dircache.c index 1028926..771e313 100644 --- a/fuse/dircache.c +++ b/fuse/dircache.c @@ -13,7 +13,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * * Derived from the example program 'fusexmp.c': * Copyright (C) 2001-2007 Miklos Szeredi @@ -37,17 +37,9 @@ #include "hash.h" #include "hash-pjw.h" +#include "guestmount.h" #include "dircache.h" -extern int verbose; -extern int dir_cache_timeout; - -static inline char * -bad_cast (char const *s) -{ - return (char *) s; -} - /* Note on attribute caching: FUSE can cache filesystem attributes for * short periods of time (configurable via -o attr_timeout). It * doesn't cache xattrs, and in any case FUSE caching doesn't solve @@ -146,7 +138,7 @@ init_dir_caches (void) rlc_ht = hash_initialize (1024, NULL, gen_hash, gen_compare, rlc_free); if (!lsc_ht || !xac_ht || !rlc_ht) { fprintf (stderr, "guestmount: could not initialize dir cache hashtables\n"); - exit (1); + exit (EXIT_FAILURE); } } @@ -392,7 +384,7 @@ lsc_remove (Hash_table *ht, const char *pathname, Hash_data_freer freer) entry = hash_delete (ht, &key); - if (verbose) + if (verbose && entry) fprintf (stderr, "dir cache: invalidating entry %p (%s)\n", entry, entry->pathname);