Lines Matching refs:vnode
34 struct afs_vnode *vnode = AFS_FS_I(file_inode(file)); in afs_write_begin() local
43 vnode->fid.vid, vnode->fid.vnode, pos, len); in afs_write_begin()
69 trace_afs_folio_dirty(vnode, tracepoint_string("alrdy"), folio); in afs_write_begin()
76 if (!test_bit(AFS_VNODE_NEW_CONTENT, &vnode->flags) && in afs_write_begin()
113 struct afs_vnode *vnode = AFS_FS_I(file_inode(file)); in afs_write_end() local
120 vnode->fid.vid, vnode->fid.vnode, folio_index(folio)); in afs_write_end()
136 i_size = i_size_read(&vnode->vfs_inode); in afs_write_end()
138 write_seqlock(&vnode->cb_lock); in afs_write_end()
139 i_size = i_size_read(&vnode->vfs_inode); in afs_write_end()
141 afs_set_i_size(vnode, maybe_i_size); in afs_write_end()
142 write_sequnlock(&vnode->cb_lock); in afs_write_end()
155 trace_afs_folio_dirty(vnode, tracepoint_string("dirty+"), folio); in afs_write_end()
159 trace_afs_folio_dirty(vnode, tracepoint_string("dirty"), folio); in afs_write_end()
177 struct afs_vnode *vnode = AFS_FS_I(mapping->host); in afs_kill_pages() local
183 vnode->fid.vid, vnode->fid.vnode, len, start); in afs_kill_pages()
215 struct afs_vnode *vnode = AFS_FS_I(mapping->host); in afs_redirty_pages() local
221 vnode->fid.vid, vnode->fid.vnode, len, start); in afs_redirty_pages()
244 static void afs_pages_written_back(struct afs_vnode *vnode, loff_t start, unsigned int len) in afs_pages_written_back() argument
246 struct address_space *mapping = vnode->vfs_inode.i_mapping; in afs_pages_written_back()
253 vnode->fid.vid, vnode->fid.vnode, len, start); in afs_pages_written_back()
265 trace_afs_folio_dirty(vnode, tracepoint_string("clear"), folio); in afs_pages_written_back()
272 afs_prune_wb_keys(vnode); in afs_pages_written_back()
281 static int afs_get_writeback_key(struct afs_vnode *vnode, in afs_get_writeback_key() argument
288 spin_lock(&vnode->wb_lock); in afs_get_writeback_key()
292 p = vnode->wb_keys.next; in afs_get_writeback_key()
294 while (p != &vnode->wb_keys) { in afs_get_writeback_key()
310 spin_unlock(&vnode->wb_lock); in afs_get_writeback_key()
319 struct afs_vnode *vnode = op->file[0].vnode; in afs_store_data_success() local
325 afs_pages_written_back(vnode, op->store.pos, op->store.size); in afs_store_data_success()
326 afs_stat_v(vnode, n_stores); in afs_store_data_success()
327 atomic_long_add(op->store.size, &afs_v2net(vnode)->n_store_bytes); in afs_store_data_success()
340 static int afs_store_data(struct afs_vnode *vnode, struct iov_iter *iter, loff_t pos, in afs_store_data() argument
349 vnode->volume->name, in afs_store_data()
350 vnode->fid.vid, in afs_store_data()
351 vnode->fid.vnode, in afs_store_data()
352 vnode->fid.unique, in afs_store_data()
355 ret = afs_get_writeback_key(vnode, &wbk); in afs_store_data()
361 op = afs_alloc_operation(wbk->key, vnode->volume); in afs_store_data()
367 i_size = i_size_read(&vnode->vfs_inode); in afs_store_data()
369 afs_op_set_vnode(op, 0, vnode); in afs_store_data()
377 op->mtime = vnode->vfs_inode.i_mtime; in afs_store_data()
394 ret = afs_get_writeback_key(vnode, &wbk); in afs_store_data()
416 struct afs_vnode *vnode, in afs_extend_writeback() argument
509 trace_afs_folio_dirty(vnode, tracepoint_string("store+"), folio); in afs_extend_writeback()
536 struct afs_vnode *vnode = AFS_FS_I(mapping->host); in afs_write_back_from_locked_folio() local
540 loff_t i_size = i_size_read(&vnode->vfs_inode); in afs_write_back_from_locked_folio()
541 bool new_content = test_bit(AFS_VNODE_NEW_CONTENT, &vnode->flags); in afs_write_back_from_locked_folio()
560 trace_afs_folio_dirty(vnode, tracepoint_string("store"), folio); in afs_write_back_from_locked_folio()
574 afs_extend_writeback(mapping, vnode, &count, in afs_write_back_from_locked_folio()
589 ret = afs_store_data(vnode, &iter, start, false); in afs_write_back_from_locked_folio()
594 afs_pages_written_back(vnode, start, len); in afs_write_back_from_locked_folio()
630 trace_afs_file_error(vnode, ret, afs_file_error_writeback_fail); in afs_write_back_from_locked_folio()
750 struct afs_vnode *vnode = AFS_FS_I(mapping->host); in afs_writepages() local
761 down_read(&vnode->validate_lock); in afs_writepages()
762 else if (!down_read_trylock(&vnode->validate_lock)) in afs_writepages()
787 up_read(&vnode->validate_lock); in afs_writepages()
797 struct afs_vnode *vnode = AFS_FS_I(file_inode(iocb->ki_filp)); in afs_file_write() local
803 vnode->fid.vid, vnode->fid.vnode, count); in afs_file_write()
805 if (IS_SWAPFILE(&vnode->vfs_inode)) { in afs_file_write()
814 result = afs_validate(vnode, af->key); in afs_file_write()
831 struct afs_vnode *vnode = AFS_FS_I(file_inode(file)); in afs_fsync() local
836 vnode->fid.vid, vnode->fid.vnode, file, in afs_fsync()
839 ret = afs_validate(vnode, af->key); in afs_fsync()
855 struct afs_vnode *vnode = AFS_FS_I(inode); in afs_page_mkwrite() local
860 _enter("{{%llx:%llu}},{%lx}", vnode->fid.vid, vnode->fid.vnode, folio_index(folio)); in afs_page_mkwrite()
862 afs_validate(vnode, af->key); in afs_page_mkwrite()
894 trace_afs_folio_dirty(vnode, tracepoint_string("mkwrite+"), folio); in afs_page_mkwrite()
897 trace_afs_folio_dirty(vnode, tracepoint_string("mkwrite"), folio); in afs_page_mkwrite()
910 void afs_prune_wb_keys(struct afs_vnode *vnode) in afs_prune_wb_keys() argument
916 spin_lock(&vnode->wb_lock); in afs_prune_wb_keys()
918 if (!mapping_tagged(&vnode->vfs_inode.i_data, PAGECACHE_TAG_WRITEBACK) && in afs_prune_wb_keys()
919 !mapping_tagged(&vnode->vfs_inode.i_data, PAGECACHE_TAG_DIRTY)) { in afs_prune_wb_keys()
920 list_for_each_entry_safe(wbk, tmp, &vnode->wb_keys, vnode_link) { in afs_prune_wb_keys()
926 spin_unlock(&vnode->wb_lock); in afs_prune_wb_keys()
941 struct afs_vnode *vnode = AFS_FS_I(folio_inode(folio)); in afs_launder_page() local
964 trace_afs_folio_dirty(vnode, tracepoint_string("launder"), folio); in afs_launder_page()
965 ret = afs_store_data(vnode, &iter, folio_pos(folio) + f, true); in afs_launder_page()
968 trace_afs_folio_dirty(vnode, tracepoint_string("laundered"), folio); in afs_launder_page()