Lines Matching defs:vnode

2 /* vnode and volume validity verification.
19 * (2) On a RW volume, in response to certain vnode (inode)-accessing RPC
20 * calls, the server maintains a time-limited per-vnode promise that it
24 * Note that a vnode-level callbacks may also be sent for other reasons,
27 * (3) On a RO (or Backup) volume, in response to certain vnode-accessing RPC
50 * a volume have been altered since we last checked a vnode.
63 * vnode have been altered.
78 * (3) When a vnode-level CB.CallBack occurs, we increment ->cb_break on the
79 * vnode and reset its ->cb_expires_at. If the vnode is mmapped, we also
80 * dispatch a work item to unmap all PTEs to the vnode's pagecache to
84 * validity of a vnode. This first checks to see if ->cb_v_check and
86 * exclusively and perform an FS.FetchStatus on the vnode.
88 * After checking the volume, we check the vnode. If there's a mismatch
89 * between the volume counters and the vnode's mirrors of those counters,
90 * we lock vnode->validate_lock and issue an FS.FetchStatus on the vnode.
110 * parsed and used to set the promise in ->cb_expires_at for the vnode,
114 * the vnode.
118 * Check the validity of a vnode/inode and its parent volume.
120 bool afs_check_validity(const struct afs_vnode *vnode)
122 const struct afs_volume *volume = vnode->volume;
125 if (test_bit(AFS_VNODE_DELETED, &vnode->flags))
129 atomic64_read(&vnode->cb_expires_at) <= deadline ||
131 vnode->cb_ro_snapshot != atomic_read(&volume->cb_ro_snapshot) ||
132 vnode->cb_scrub != atomic_read(&volume->cb_scrub) ||
133 test_bit(AFS_VNODE_ZAP_DATA, &vnode->flags)) {
358 static void afs_zap_data(struct afs_vnode *vnode)
360 _enter("{%llx:%llu}", vnode->fid.vid, vnode->fid.vnode);
362 afs_invalidate_cache(vnode, 0);
367 if (S_ISREG(vnode->netfs.inode.i_mode))
368 invalidate_remote_inode(&vnode->netfs.inode);
370 invalidate_inode_pages2(vnode->netfs.inode.i_mapping);
374 * validate a vnode/inode
382 int afs_validate(struct afs_vnode *vnode, struct key *key)
384 struct afs_volume *volume = vnode->volume;
391 vnode->fid.vid, vnode->fid.vnode, vnode->flags,
394 if (afs_check_validity(vnode))
395 return test_bit(AFS_VNODE_DELETED, &vnode->flags) ? -ESTALE : 0;
397 ret = down_write_killable(&vnode->validate_lock);
401 if (test_bit(AFS_VNODE_DELETED, &vnode->flags)) {
421 if (vnode->cb_ro_snapshot != cb_ro_snapshot ||
422 vnode->cb_scrub != cb_scrub)
423 unmap_mapping_pages(vnode->netfs.inode.i_mapping, 0, 0, false);
425 if (vnode->cb_ro_snapshot != cb_ro_snapshot ||
426 vnode->cb_scrub != cb_scrub ||
429 atomic64_read(&vnode->cb_expires_at) <= deadline
431 ret = afs_fetch_status(vnode, key, false, NULL);
434 set_bit(AFS_VNODE_DELETED, &vnode->flags);
440 _debug("new promise [fl=%lx]", vnode->flags);
451 _debug("vnode inval %x==%x %x==%x",
452 vnode->cb_ro_snapshot, cb_ro_snapshot,
453 vnode->cb_scrub, cb_scrub);
454 if (vnode->cb_scrub != cb_scrub)
456 vnode->cb_ro_snapshot = cb_ro_snapshot;
457 vnode->cb_scrub = cb_scrub;
459 /* if the vnode's data version number changed then its contents are
461 zap |= test_and_clear_bit(AFS_VNODE_ZAP_DATA, &vnode->flags);
463 afs_zap_data(vnode);
464 up_write(&vnode->validate_lock);
471 up_write(&vnode->validate_lock);