/*Lock for accessing the attribute cache*/
static pthread_mutex_t HgfsAttrCacheLock = PTHREAD_MUTEX_INITIALIZER;
+static void HgfsInvalidateParentsChildren(const char* parent);
/*
* Lists are used to manage attribute cache in Solaris and FreeBSD,
tmp = (HgfsAttrCache *)g_hash_table_lookup(g_hash_table, path);
if (tmp != NULL) {
tmp->changeTime = 0;
+ if (tmp->attr.type == HGFS_FILE_TYPE_DIRECTORY) {
+ HgfsInvalidateParentsChildren(tmp->path);
+ }
}
pthread_mutex_unlock(&HgfsAttrCacheLock);
}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * HgfsInvalidateParentsChildren
+ *
+ * This routine is called by the general function to invalidate a cache
+ * entry. If the entry is a directory this function is called to invalidate
+ * any cached children.
+ *
+ * Results:
+ * None
+ *
+ * Side effects:
+ * None
+ *
+ *----------------------------------------------------------------------
+ */
+
+static void
+HgfsInvalidateParentsChildren(const char* parent) //IN: parent
+{
+ gpointer key, value;
+ GHashTableIter iter;
+ size_t parentLen = Str_Strlen(parent, PATH_MAX);
+
+ LOG(4, ("Invalidating cache children for parent = %s\n",
+ parent));
+
+ g_hash_table_iter_init(&iter, g_hash_table);
+
+ while (g_hash_table_iter_next(&iter, &key, &value)) {
+ HgfsAttrCache *child = (HgfsAttrCache *)value;
+
+ if (Str_Strncasecmp(parent, child->path, parentLen) == 0) {
+ LOG(10, ("Invalidating cache child = %s\n", child->path));
+ child->changeTime = 0;
+ }
+ }
+}
+
+
/*
*----------------------------------------------------------------------
*
/*********************************************************
- * Copyright (C) 2013,2017 VMware, Inc. All rights reserved.
+ * Copyright (C) 2013,2018 VMware, Inc. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published
}
break;
default:
- LOG(4, ("failed with result %d\n", result));
+ LOG(4, ("Server protocol result %d\n", result));
}
break;
default:
/*********************************************************
- * Copyright (C) 2013,2017 VMware, Inc. All rights reserved.
+ * Copyright (C) 2013,2018 VMware, Inc. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published
#ifndef _VMHGFS_VERSION_H_
#define _VMHGFS_VERSION_H_
-#define VMHGFS_DRIVER_VERSION 1.6.6.0
-#define VMHGFS_DRIVER_VERSION_COMMAS 1,6,6,0
-#define VMHGFS_DRIVER_VERSION_STRING "1.6.6.0"
+#define VMHGFS_DRIVER_VERSION 1.6.7.0
+#define VMHGFS_DRIVER_VERSION_COMMAS 1,6,7,0
+#define VMHGFS_DRIVER_VERSION_STRING "1.6.7.0"
#endif /* _VMHGFS_VERSION_H_ */