High priority for lock refresh (sr #108607)
This commit is contained in:
parent
712b24fda0
commit
c21d6b0ab6
@ -1,6 +1,10 @@
|
||||
ChangeLog for davfs2
|
||||
--------------------
|
||||
|
||||
2014-08-10 Werner Baumann (werner.baumann@onlinehome.de)
|
||||
* cache.c, kernel_interface.c:
|
||||
High priority for lock refresh (sr #108607).
|
||||
|
||||
2014-08-09 Werner Baumann (werner.baumann@onlinehome.de)
|
||||
* cache.c, dav_init_cache:
|
||||
Increase faked free space.
|
||||
|
65
src/cache.c
65
src/cache.c
@ -737,35 +737,33 @@ dav_tidy_cache(void)
|
||||
(unsigned long long int) (cache_size + 0x80000) / 0x100000);
|
||||
}
|
||||
|
||||
if (cache_size > max_cache_size)
|
||||
resize_cache();
|
||||
|
||||
if (minimize_mem && next_minimize && time(NULL) > next_minimize) {
|
||||
if (debug)
|
||||
syslog(LOG_MAKEPRI(LOG_DAEMON, LOG_DEBUG), "minimize_tree");
|
||||
next_minimize = 0;
|
||||
minimize_tree(root);
|
||||
if (debug)
|
||||
syslog(LOG_MAKEPRI(LOG_DAEMON, LOG_DEBUG),
|
||||
"minimize_tree: %llu nodes remaining", fs_stat->n_nodes);
|
||||
}
|
||||
|
||||
static dav_node_list_item *item = NULL;
|
||||
|
||||
dav_node_list_item *next_item = changed;
|
||||
while (next_item && next_item != item)
|
||||
dav_node *node = NULL;
|
||||
int found = 0;
|
||||
while (next_item) {
|
||||
node = next_item->node;
|
||||
if (is_locked(node) && node->lock_expire < time(NULL) + lock_refresh)
|
||||
dav_lock_refresh(node->path, &node->lock_expire);
|
||||
if (next_item == item)
|
||||
found = 1;
|
||||
next_item = next_item->next;
|
||||
if (!next_item) {
|
||||
item = changed;
|
||||
if (!item)
|
||||
return 0;
|
||||
}
|
||||
next_item = item->next;
|
||||
dav_node *node = item->node;
|
||||
if (!found)
|
||||
item = changed;
|
||||
|
||||
if ((is_dirty(node) || is_created(node)) && !is_open_write(node)
|
||||
&& !is_backup(node) && item->save_at
|
||||
&& item-> save_at <= time(NULL)) {
|
||||
time_t save_at = 0;
|
||||
if (item) {
|
||||
node = item->node;
|
||||
save_at = item->save_at;
|
||||
item = item->next;
|
||||
} else {
|
||||
node = NULL;
|
||||
}
|
||||
|
||||
if (node && (is_dirty(node) || is_created(node)) && !is_open_write(node)
|
||||
&& !is_backup(node) && save_at && save_at <= time(NULL)) {
|
||||
if (debug)
|
||||
syslog(LOG_MAKEPRI(LOG_DAEMON, LOG_DEBUG), "tidy: %s", node->path);
|
||||
int ret = dav_put(node->path, node->cache_path, &node->remote_exists,
|
||||
@ -790,20 +788,27 @@ dav_tidy_cache(void)
|
||||
remove_node(node);
|
||||
}
|
||||
}
|
||||
} else if (is_locked(node) && !is_dirty(node) && !is_created(node)
|
||||
} else if (node && is_locked(node) && !is_dirty(node) && !is_created(node)
|
||||
&& !is_open_write(node)) {
|
||||
if (dav_unlock(node->path, &node->lock_expire) == 0)
|
||||
remove_from_changed(node);
|
||||
} else if (is_locked(node)
|
||||
&& node->lock_expire < (time(NULL) + lock_refresh)) {
|
||||
dav_lock_refresh(node->path, &node->lock_expire);
|
||||
}
|
||||
|
||||
item = next_item;
|
||||
if (cache_size > max_cache_size)
|
||||
resize_cache();
|
||||
|
||||
if (minimize_mem && next_minimize && time(NULL) > next_minimize) {
|
||||
if (debug)
|
||||
syslog(LOG_MAKEPRI(LOG_DAEMON, LOG_DEBUG), "minimize_tree");
|
||||
next_minimize = 0;
|
||||
minimize_tree(root);
|
||||
if (debug)
|
||||
syslog(LOG_MAKEPRI(LOG_DAEMON, LOG_DEBUG),
|
||||
"minimize_tree: %llu nodes remaining", fs_stat->n_nodes);
|
||||
}
|
||||
|
||||
if (item)
|
||||
return 1;
|
||||
|
||||
item = changed;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -225,6 +225,8 @@ dav_init_kernel_interface(const char *url, const char *mpoint,
|
||||
reply = buf + sizeof(struct fuse_out_header);
|
||||
|
||||
idle_time = args->delay_upload;
|
||||
if (idle_time > args->lock_refresh / 2)
|
||||
idle_time = args->lock_refresh / 2;
|
||||
|
||||
char *path = xasprintf("%s/%s", DAV_DEV_DIR, FUSE_DEV_NAME);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user