Lines Matching refs:dvnode
107 static bool afs_dir_check_page(struct afs_vnode *dvnode, struct page *page, in afs_dir_check_page() argument
133 __func__, dvnode->vfs_inode.i_ino, tmp, qty, in afs_dir_check_page()
135 trace_afs_dir_check_failed(dvnode, off, i_size); in afs_dir_check_page()
137 trace_afs_file_error(dvnode, -EIO, afs_file_error_dir_bad_magic); in afs_dir_check_page()
151 afs_stat_v(dvnode, n_read_dir); in afs_dir_check_page()
161 static bool afs_dir_check_pages(struct afs_vnode *dvnode, struct afs_read *req) in afs_dir_check_pages() argument
167 if (!afs_dir_check_page(dvnode, req->pages[i], req->actual_len)) in afs_dir_check_pages()
173 dvnode->fid.vid, dvnode->fid.vnode, in afs_dir_check_pages()
211 static struct afs_read *afs_read_dir(struct afs_vnode *dvnode, struct key *key) in afs_read_dir() argument
212 __acquires(&dvnode->validate_lock) in afs_read_dir()
220 i_size = i_size_read(&dvnode->vfs_inode); in afs_read_dir()
222 return ERR_PTR(afs_bad(dvnode, afs_file_error_dir_small)); in afs_read_dir()
224 trace_afs_file_error(dvnode, -EFBIG, afs_file_error_dir_big); in afs_read_dir()
246 req->data_version = dvnode->status.data_version; /* May change */ in afs_read_dir()
263 n = find_get_pages_contig(dvnode->vfs_inode.i_mapping, i, in afs_read_dir()
268 gfp_t gfp = dvnode->vfs_inode.i_mapping->gfp_mask; in afs_read_dir()
270 if (test_and_clear_bit(AFS_VNODE_DIR_VALID, &dvnode->flags)) in afs_read_dir()
271 afs_stat_v(dvnode, n_inval); in afs_read_dir()
278 dvnode->vfs_inode.i_mapping, in afs_read_dir()
295 if (down_read_killable(&dvnode->validate_lock) < 0) in afs_read_dir()
298 if (test_bit(AFS_VNODE_DIR_VALID, &dvnode->flags)) in afs_read_dir()
301 up_read(&dvnode->validate_lock); in afs_read_dir()
302 if (down_write_killable(&dvnode->validate_lock) < 0) in afs_read_dir()
305 if (!test_bit(AFS_VNODE_DIR_VALID, &dvnode->flags)) { in afs_read_dir()
306 trace_afs_reload_dir(dvnode); in afs_read_dir()
307 ret = afs_fetch_data(dvnode, key, req); in afs_read_dir()
318 if (!afs_dir_check_pages(dvnode, req)) in afs_read_dir()
323 set_bit(AFS_VNODE_DIR_VALID, &dvnode->flags); in afs_read_dir()
326 downgrade_write(&dvnode->validate_lock); in afs_read_dir()
331 up_write(&dvnode->validate_lock); in afs_read_dir()
338 up_write(&dvnode->validate_lock); in afs_read_dir()
346 static int afs_dir_iterate_block(struct afs_vnode *dvnode, in afs_dir_iterate_block() argument
397 return afs_bad(dvnode, afs_file_error_dir_over_end); in afs_dir_iterate_block()
405 return afs_bad(dvnode, afs_file_error_dir_unmarked_ext); in afs_dir_iterate_block()
441 struct afs_vnode *dvnode = AFS_FS_I(dir); in afs_dir_iterate() local
456 req = afs_read_dir(dvnode, key); in afs_dir_iterate()
475 ret = afs_bad(dvnode, afs_file_error_dir_missing_page); in afs_dir_iterate()
488 ret = afs_dir_iterate_block(dvnode, ctx, dblock, blkoff); in afs_dir_iterate()
503 up_read(&dvnode->validate_lock); in afs_dir_iterate()
708 static bool afs_server_supports_ibulk(struct afs_vnode *dvnode) in afs_server_supports_ibulk() argument
711 struct afs_volume *volume = dvnode->volume; in afs_server_supports_ibulk()
724 if (server == dvnode->cb_server) { in afs_server_supports_ibulk()
746 struct afs_vnode *dvnode = AFS_FS_I(dir), *vnode; in afs_do_lookup() local
748 afs_dataversion_t data_version = READ_ONCE(dvnode->status.data_version); in afs_do_lookup()
759 cookie->fids[i].vid = dvnode->fid.vid; in afs_do_lookup()
765 if (!afs_server_supports_ibulk(dvnode)) in afs_do_lookup()
789 op = afs_alloc_operation(NULL, dvnode->volume); in afs_do_lookup()
795 afs_op_set_vnode(op, 0, dvnode); in afs_do_lookup()
932 struct afs_vnode *dvnode = AFS_FS_I(dir); in afs_lookup() local
940 dvnode->fid.vid, dvnode->fid.vnode, dentry, dentry); in afs_lookup()
949 if (test_bit(AFS_VNODE_DELETED, &dvnode->flags)) { in afs_lookup()
954 key = afs_request_key(dvnode->volume->cell); in afs_lookup()
960 ret = afs_validate(dvnode, key); in afs_lookup()
974 afs_stat_v(dvnode, n_lookup); in afs_lookup()
987 trace_afs_lookup(dvnode, &d->d_name, &fid); in afs_lookup()
989 trace_afs_lookup(dvnode, &dentry->d_name, &fid); in afs_lookup()
1000 struct afs_vnode *dvnode; in afs_d_revalidate_rcu() local
1012 dvnode = AFS_FS_I(dir); in afs_d_revalidate_rcu()
1013 if (test_bit(AFS_VNODE_DELETED, &dvnode->flags)) in afs_d_revalidate_rcu()
1016 if (!afs_check_validity(dvnode)) in afs_d_revalidate_rcu()
1024 dir_version = (long)READ_ONCE(dvnode->status.data_version); in afs_d_revalidate_rcu()
1027 dir_version = (long)READ_ONCE(dvnode->invalid_before); in afs_d_revalidate_rcu()
1260 struct afs_vnode *dvnode = dvp->vnode; in afs_create_edit_dir() local
1264 down_write(&dvnode->validate_lock); in afs_create_edit_dir()
1265 if (test_bit(AFS_VNODE_DIR_VALID, &dvnode->flags) && in afs_create_edit_dir()
1266 dvnode->status.data_version == dvp->dv_before + dvp->dv_delta) in afs_create_edit_dir()
1267 afs_edit_dir_add(dvnode, &op->dentry->d_name, &vp->fid, in afs_create_edit_dir()
1269 up_write(&dvnode->validate_lock); in afs_create_edit_dir()
1295 struct afs_vnode *dvnode = AFS_FS_I(dir); in afs_mkdir() local
1298 dvnode->fid.vid, dvnode->fid.vnode, dentry, mode); in afs_mkdir()
1300 op = afs_alloc_operation(NULL, dvnode->volume); in afs_mkdir()
1306 afs_op_set_vnode(op, 0, dvnode); in afs_mkdir()
1343 struct afs_vnode *dvnode = dvp->vnode; in afs_rmdir_edit_dir() local
1348 down_write(&dvnode->validate_lock); in afs_rmdir_edit_dir()
1349 if (test_bit(AFS_VNODE_DIR_VALID, &dvnode->flags) && in afs_rmdir_edit_dir()
1350 dvnode->status.data_version == dvp->dv_before + dvp->dv_delta) in afs_rmdir_edit_dir()
1351 afs_edit_dir_remove(dvnode, &op->dentry->d_name, in afs_rmdir_edit_dir()
1353 up_write(&dvnode->validate_lock); in afs_rmdir_edit_dir()
1378 struct afs_vnode *dvnode = AFS_FS_I(dir), *vnode = NULL; in afs_rmdir() local
1382 dvnode->fid.vid, dvnode->fid.vnode, dentry); in afs_rmdir()
1384 op = afs_alloc_operation(NULL, dvnode->volume); in afs_rmdir()
1388 afs_op_set_vnode(op, 0, dvnode); in afs_rmdir()
1429 struct afs_vnode *dvnode = op->file[0].vnode; in afs_dir_remove_link() local
1442 } else if (test_bit(AFS_VNODE_DIR_VALID, &dvnode->flags)) { in afs_dir_remove_link()
1478 struct afs_vnode *dvnode = dvp->vnode; in afs_unlink_edit_dir() local
1481 down_write(&dvnode->validate_lock); in afs_unlink_edit_dir()
1482 if (test_bit(AFS_VNODE_DIR_VALID, &dvnode->flags) && in afs_unlink_edit_dir()
1483 dvnode->status.data_version == dvp->dv_before + dvp->dv_delta) in afs_unlink_edit_dir()
1484 afs_edit_dir_remove(dvnode, &op->dentry->d_name, in afs_unlink_edit_dir()
1486 up_write(&dvnode->validate_lock); in afs_unlink_edit_dir()
1511 struct afs_vnode *dvnode = AFS_FS_I(dir); in afs_unlink() local
1516 dvnode->fid.vid, dvnode->fid.vnode, dentry); in afs_unlink()
1521 op = afs_alloc_operation(NULL, dvnode->volume); in afs_unlink()
1525 afs_op_set_vnode(op, 0, dvnode); in afs_unlink()
1542 op->error = afs_sillyrename(dvnode, vnode, dentry, op->key); in afs_unlink()
1593 struct afs_vnode *dvnode = AFS_FS_I(dir); in afs_create() local
1597 dvnode->fid.vid, dvnode->fid.vnode, dentry, mode); in afs_create()
1602 op = afs_alloc_operation(NULL, dvnode->volume); in afs_create()
1608 afs_op_set_vnode(op, 0, dvnode); in afs_create()
1664 struct afs_vnode *dvnode = AFS_FS_I(dir); in afs_link() local
1670 dvnode->fid.vid, dvnode->fid.vnode, in afs_link()
1676 op = afs_alloc_operation(NULL, dvnode->volume); in afs_link()
1682 afs_op_set_vnode(op, 0, dvnode); in afs_link()
1717 struct afs_vnode *dvnode = AFS_FS_I(dir); in afs_symlink() local
1721 dvnode->fid.vid, dvnode->fid.vnode, dentry, in afs_symlink()
1732 op = afs_alloc_operation(NULL, dvnode->volume); in afs_symlink()
1738 afs_op_set_vnode(op, 0, dvnode); in afs_symlink()
1950 struct afs_vnode *dvnode = AFS_FS_I(page->mapping->host); in afs_dir_releasepage() local
1952 _enter("{{%llx:%llu}[%lu]}", dvnode->fid.vid, dvnode->fid.vnode, page->index); in afs_dir_releasepage()
1957 if (test_and_clear_bit(AFS_VNODE_DIR_VALID, &dvnode->flags)) in afs_dir_releasepage()
1958 afs_stat_v(dvnode, n_relpg); in afs_dir_releasepage()
1970 struct afs_vnode *dvnode = AFS_FS_I(page->mapping->host); in afs_dir_invalidatepage() local
1977 if (test_and_clear_bit(AFS_VNODE_DIR_VALID, &dvnode->flags)) in afs_dir_invalidatepage()
1978 afs_stat_v(dvnode, n_inval); in afs_dir_invalidatepage()