Limit maximum number of SharedCacheMap mapped objects.
[captive.git] / src / libcaptive / client / file-slave.c
index aeca8e8..8193e38 100644 (file)
 #include "captive/usecount.h"
 #include "vfs.h"
 #include "vfs-slave.h"
+#include "../cc/sharedcachemap.h"
 
 
 /* Config: */
-#define MAX_FILE_READ   0x1000000      /* FIXME: Workaround memory consumption for non-journalled fastfat.sys */
+#define MAX_FILE_READ   0x8000000      /* FIXME: Workaround memory consumption for non-journalled fastfat.sys */
 #define MAX_FILE_WRITTEN 0x100000      /* FIXME: Workaround memory consumption for non-journalled fastfat.sys */
 
 
@@ -150,6 +151,9 @@ NTSTATUS err;
        g_return_val_if_fail(captive_file_slave_object!=NULL,GNOME_VFS_ERROR_BAD_PARAMETERS);
        g_return_val_if_fail(pathname!=NULL,GNOME_VFS_ERROR_BAD_PARAMETERS);
 
+       if (captive_shared_cache_map_restart_needed())
+               return GNOME_VFS_ERROR_SERVICE_OBSOLETE;
+
        errvfsresult=captive_ObjectAttributes_init(pathname,&file_ObjectAttributes);
        g_return_val_if_fail(errvfsresult==GNOME_VFS_OK,errvfsresult);