16 #include <linux/kernel.h>
17 #include <linux/module.h>
20 #include <linux/sched.h>
24 unsigned afs_vnode_update_timeout = 10;
27 #define afs_breakring_space(server) \
28 CIRC_SPACE((server)->cb_break_head, (server)->cb_break_tail, \
29 ARRAY_SIZE((server)->cb_break))
50 _debug(
"UNPROMISE { vid=%x:%u uq=%u}",
51 vnode->
fid.vid, vnode->
fid.vnode, vnode->
fid.unique);
118 spin_lock(&vnode->
lock);
133 spin_unlock(&vnode->
lock);
143 static void afs_break_one_callback(
struct afs_server *server,
154 if (fid->
vid < vnode->
fid.vid)
156 else if (fid->
vid > vnode->
fid.vid)
158 else if (fid->
vnode < vnode->
fid.vnode)
160 else if (fid->
vnode > vnode->
fid.vnode)
162 else if (fid->
unique < vnode->
fid.unique)
164 else if (fid->
unique > vnode->
fid.unique)
182 if (!
igrab(AFS_VNODE_TO_I(vnode)))
186 afs_break_callback(server, vnode);
197 _enter(
"%p,%zu,", server, count);
202 for (; count > 0; callbacks++, count--) {
203 _debug(
"- Fid { vl=%08x n=%u u=%u } CB { v=%u x=%u t=%u }",
205 callbacks->
fid.vnode,
206 callbacks->
fid.unique,
211 afs_break_one_callback(server, &callbacks->
fid);
222 static void afs_do_give_up_callback(
struct afs_server *server,
227 _enter(
"%p,%p", server, vnode);
269 _leave(
" [not promised]");
300 _leave(
" [not promised]");
325 afs_do_give_up_callback(server, vnode);
392 timeout = vnode->update_at - now;
395 &afs_vnode_update, timeout *
HZ);
401 list_del_init(&vnode->update);
406 _debug(
"update %s", vnode->vldb.name);
408 vnode->upd_rej_cnt = 0;
409 vnode->upd_busy_cnt = 0;
411 ret = afs_vnode_update_record(
vl, &vldb);
414 afs_vnode_apply_update(
vl, &vldb);
427 vnode->update_at =
get_seconds() + afs_vnode_update_timeout;
438 if (vnode->update_at <= xvnode->update_at)
439 vnode->update_at = xvnode->update_at + 1;
442 timeout = xvnode->update_at - now;
446 timeout = afs_vnode_update_timeout;
451 _debug(
"timeout %ld", timeout);
453 &afs_vnode_update, timeout *
HZ);
464 afs_callback_update_worker =
466 return afs_callback_update_worker ? 0 : -
ENOMEM;