The link/unlink functions absolutely need to be in sync. Enforce that by having one combined function.