/* handle remote file deletion by discarding the callback promise  */
static void afs_vnode_deleted_remotely(struct afs_vnode *vnode)
/* handle remote file deletion by discarding the callback promise  */
static void afs_vnode_deleted_remotely(struct afs_vnode *vnode)
{
	struct afs_server *server;
	_enter("{%p}", vnode->server);
	set_bit(AFS_VNODE_DELETED, &vnode->flags);
	server = vnode->server;
	if (server) {
		if (vnode->cb_promised) {
			spin_lock(&server->cb_lock);
			if (vnode->cb_promised) {
				rb_erase(&vnode->cb_promise,
					 &server->cb_promises);
				vnode->cb_promised = false;
			}
			spin_unlock(&server->cb_lock);
		}
		spin_lock(&server->fs_lock);
		rb_erase(&vnode->server_rb, &server->fs_vnodes);
		spin_unlock(&server->fs_lock);
		vnode->server = NULL;
		afs_put_server(server);
	} else {
		ASSERT(!vnode->cb_promised);
	}
	_leave("");
}