1 // SPDX-License-Identifier: GPL-2.0-or-later
2 /* handling of writes to regular files and writing back to the server
4 * Copyright (C) 2007 Red Hat, Inc. All Rights Reserved.
8 #include <linux/backing-dev.h>
9 #include <linux/slab.h>
11 #include <linux/pagemap.h>
12 #include <linux/writeback.h>
13 #include <linux/pagevec.h>
14 #include <linux/netfs.h>
17 static void afs_write_to_cache(struct afs_vnode *vnode, loff_t start, size_t len,
18 loff_t i_size, bool caching);
20 #ifdef CONFIG_AFS_FSCACHE
22 * Mark a page as having been made dirty and thus needing writeback. We also
23 * need to pin the cache object to write back to.
25 int afs_set_page_dirty(struct page *page)
27 return fscache_set_page_dirty(page, afs_vnode_cache(AFS_FS_I(page->mapping->host)));
29 static void afs_folio_start_fscache(bool caching, struct folio *folio)
32 folio_start_fscache(folio);
35 static void afs_folio_start_fscache(bool caching, struct folio *folio)
41 * prepare to perform part of a write to a page
43 int afs_write_begin(struct file *file, struct address_space *mapping,
44 loff_t pos, unsigned len, unsigned flags,
45 struct page **_page, void **fsdata)
47 struct afs_vnode *vnode = AFS_FS_I(file_inode(file));
55 _enter("{%llx:%llu},%llx,%x",
56 vnode->fid.vid, vnode->fid.vnode, pos, len);
58 /* Prefetch area to be written into the cache if we're caching this
59 * file. We need to do this before we get a lock on the page in case
60 * there's more than one writer competing for the same cache block.
62 ret = netfs_write_begin(file, mapping, pos, len, flags, &folio, fsdata,
67 index = folio_index(folio);
68 from = pos - index * PAGE_SIZE;
72 /* See if this page is already partially written in a way that we can
73 * merge the new write with.
75 if (folio_test_private(folio)) {
76 priv = (unsigned long)folio_get_private(folio);
77 f = afs_folio_dirty_from(folio, priv);
78 t = afs_folio_dirty_to(folio, priv);
81 if (folio_test_writeback(folio)) {
82 trace_afs_folio_dirty(vnode, tracepoint_string("alrdy"), folio);
83 goto flush_conflicting_write;
85 /* If the file is being filled locally, allow inter-write
86 * spaces to be merged into writes. If it's not, only write
87 * back what the user gives us.
89 if (!test_bit(AFS_VNODE_NEW_CONTENT, &vnode->flags) &&
91 goto flush_conflicting_write;
94 *_page = &folio->page;
98 /* The previous write and this write aren't adjacent or overlapping, so
101 flush_conflicting_write:
102 _debug("flush conflict");
103 ret = folio_write_one(folio);
107 ret = folio_lock_killable(folio);
114 _leave(" = %d", ret);
119 * finalise part of a write to a page
121 int afs_write_end(struct file *file, struct address_space *mapping,
122 loff_t pos, unsigned len, unsigned copied,
123 struct page *subpage, void *fsdata)
125 struct folio *folio = page_folio(subpage);
126 struct afs_vnode *vnode = AFS_FS_I(file_inode(file));
128 unsigned int f, from = offset_in_folio(folio, pos);
129 unsigned int t, to = from + copied;
130 loff_t i_size, write_end_pos;
132 _enter("{%llx:%llu},{%lx}",
133 vnode->fid.vid, vnode->fid.vnode, folio_index(folio));
135 if (!folio_test_uptodate(folio)) {
141 folio_mark_uptodate(folio);
147 write_end_pos = pos + copied;
149 i_size = i_size_read(&vnode->vfs_inode);
150 if (write_end_pos > i_size) {
151 write_seqlock(&vnode->cb_lock);
152 i_size = i_size_read(&vnode->vfs_inode);
153 if (write_end_pos > i_size)
154 afs_set_i_size(vnode, write_end_pos);
155 write_sequnlock(&vnode->cb_lock);
156 fscache_update_cookie(afs_vnode_cache(vnode), NULL, &write_end_pos);
159 if (folio_test_private(folio)) {
160 priv = (unsigned long)folio_get_private(folio);
161 f = afs_folio_dirty_from(folio, priv);
162 t = afs_folio_dirty_to(folio, priv);
167 priv = afs_folio_dirty(folio, f, t);
168 folio_change_private(folio, (void *)priv);
169 trace_afs_folio_dirty(vnode, tracepoint_string("dirty+"), folio);
171 priv = afs_folio_dirty(folio, from, to);
172 folio_attach_private(folio, (void *)priv);
173 trace_afs_folio_dirty(vnode, tracepoint_string("dirty"), folio);
176 if (folio_mark_dirty(folio))
177 _debug("dirtied %lx", folio_index(folio));
186 * kill all the pages in the given range
188 static void afs_kill_pages(struct address_space *mapping,
189 loff_t start, loff_t len)
191 struct afs_vnode *vnode = AFS_FS_I(mapping->host);
193 pgoff_t index = start / PAGE_SIZE;
194 pgoff_t last = (start + len - 1) / PAGE_SIZE, next;
196 _enter("{%llx:%llu},%llx @%llx",
197 vnode->fid.vid, vnode->fid.vnode, len, start);
200 _debug("kill %lx (to %lx)", index, last);
202 folio = filemap_get_folio(mapping, index);
208 next = folio_next_index(folio);
210 folio_clear_uptodate(folio);
211 folio_end_writeback(folio);
213 generic_error_remove_page(mapping, &folio->page);
217 } while (index = next, index <= last);
223 * Redirty all the pages in a given range.
225 static void afs_redirty_pages(struct writeback_control *wbc,
226 struct address_space *mapping,
227 loff_t start, loff_t len)
229 struct afs_vnode *vnode = AFS_FS_I(mapping->host);
231 pgoff_t index = start / PAGE_SIZE;
232 pgoff_t last = (start + len - 1) / PAGE_SIZE, next;
234 _enter("{%llx:%llu},%llx @%llx",
235 vnode->fid.vid, vnode->fid.vnode, len, start);
238 _debug("redirty %llx @%llx", len, start);
240 folio = filemap_get_folio(mapping, index);
246 next = index + folio_nr_pages(folio);
247 folio_redirty_for_writepage(wbc, folio);
248 folio_end_writeback(folio);
250 } while (index = next, index <= last);
256 * completion of write to server
258 static void afs_pages_written_back(struct afs_vnode *vnode, loff_t start, unsigned int len)
260 struct address_space *mapping = vnode->vfs_inode.i_mapping;
264 XA_STATE(xas, &mapping->i_pages, start / PAGE_SIZE);
266 _enter("{%llx:%llu},{%x @%llx}",
267 vnode->fid.vid, vnode->fid.vnode, len, start);
271 end = (start + len - 1) / PAGE_SIZE;
272 xas_for_each(&xas, folio, end) {
273 if (!folio_test_writeback(folio)) {
274 kdebug("bad %x @%llx page %lx %lx",
275 len, start, folio_index(folio), end);
276 ASSERT(folio_test_writeback(folio));
279 trace_afs_folio_dirty(vnode, tracepoint_string("clear"), folio);
280 folio_detach_private(folio);
281 folio_end_writeback(folio);
286 afs_prune_wb_keys(vnode);
291 * Find a key to use for the writeback. We cached the keys used to author the
292 * writes on the vnode. *_wbk will contain the last writeback key used or NULL
293 * and we need to start from there if it's set.
295 static int afs_get_writeback_key(struct afs_vnode *vnode,
296 struct afs_wb_key **_wbk)
298 struct afs_wb_key *wbk = NULL;
300 int ret = -ENOKEY, ret2;
302 spin_lock(&vnode->wb_lock);
304 p = (*_wbk)->vnode_link.next;
306 p = vnode->wb_keys.next;
308 while (p != &vnode->wb_keys) {
309 wbk = list_entry(p, struct afs_wb_key, vnode_link);
310 _debug("wbk %u", key_serial(wbk->key));
311 ret2 = key_validate(wbk->key);
313 refcount_inc(&wbk->usage);
314 _debug("USE WB KEY %u", key_serial(wbk->key));
324 spin_unlock(&vnode->wb_lock);
326 afs_put_wb_key(*_wbk);
331 static void afs_store_data_success(struct afs_operation *op)
333 struct afs_vnode *vnode = op->file[0].vnode;
335 op->ctime = op->file[0].scb.status.mtime_client;
336 afs_vnode_commit_status(op, &op->file[0]);
337 if (op->error == 0) {
338 if (!op->store.laundering)
339 afs_pages_written_back(vnode, op->store.pos, op->store.size);
340 afs_stat_v(vnode, n_stores);
341 atomic_long_add(op->store.size, &afs_v2net(vnode)->n_store_bytes);
345 static const struct afs_operation_ops afs_store_data_operation = {
346 .issue_afs_rpc = afs_fs_store_data,
347 .issue_yfs_rpc = yfs_fs_store_data,
348 .success = afs_store_data_success,
354 static int afs_store_data(struct afs_vnode *vnode, struct iov_iter *iter, loff_t pos,
357 struct afs_operation *op;
358 struct afs_wb_key *wbk = NULL;
359 loff_t size = iov_iter_count(iter), i_size;
362 _enter("%s{%llx:%llu.%u},%llx,%llx",
369 ret = afs_get_writeback_key(vnode, &wbk);
371 _leave(" = %d [no keys]", ret);
375 op = afs_alloc_operation(wbk->key, vnode->volume);
381 i_size = i_size_read(&vnode->vfs_inode);
383 afs_op_set_vnode(op, 0, vnode);
384 op->file[0].dv_delta = 1;
385 op->file[0].modification = true;
386 op->store.write_iter = iter;
388 op->store.size = size;
389 op->store.i_size = max(pos + size, i_size);
390 op->store.laundering = laundering;
391 op->mtime = vnode->vfs_inode.i_mtime;
392 op->flags |= AFS_OPERATION_UNINTR;
393 op->ops = &afs_store_data_operation;
396 afs_begin_vnode_operation(op);
397 afs_wait_for_operation(op);
408 ret = afs_get_writeback_key(vnode, &wbk);
411 op->key = key_get(wbk->key);
418 _leave(" = %d", op->error);
419 return afs_put_operation(op);
423 * Extend the region to be written back to include subsequent contiguously
424 * dirty pages if possible, but don't sleep while doing so.
426 * If this page holds new content, then we can include filler zeros in the
429 static void afs_extend_writeback(struct address_space *mapping,
430 struct afs_vnode *vnode,
441 unsigned int psize, filler = 0;
444 pgoff_t index = (start + len) / PAGE_SIZE;
448 XA_STATE(xas, &mapping->i_pages, index);
452 /* Firstly, we gather up a batch of contiguous dirty pages
453 * under the RCU read lock - but we can't clear the dirty flags
454 * there if any of those pages are mapped.
458 xas_for_each(&xas, folio, ULONG_MAX) {
460 if (xas_retry(&xas, folio))
462 if (xa_is_value(folio))
464 if (folio_index(folio) != index)
467 if (!folio_try_get_rcu(folio)) {
472 /* Has the page moved or been split? */
473 if (unlikely(folio != xas_reload(&xas))) {
478 if (!folio_trylock(folio)) {
482 if (!folio_test_dirty(folio) ||
483 folio_test_writeback(folio) ||
484 folio_test_fscache(folio)) {
490 psize = folio_size(folio);
491 priv = (unsigned long)folio_get_private(folio);
492 f = afs_folio_dirty_from(folio, priv);
493 t = afs_folio_dirty_to(folio, priv);
494 if (f != 0 && !new_content) {
502 if (len >= max_len || *_count <= 0)
504 else if (t == psize || new_content)
507 index += folio_nr_pages(folio);
508 if (!pagevec_add(&pvec, &folio->page))
518 /* Now, if we obtained any pages, we can shift them to being
519 * writable and mark them for caching.
521 if (!pagevec_count(&pvec))
524 for (i = 0; i < pagevec_count(&pvec); i++) {
525 folio = page_folio(pvec.pages[i]);
526 trace_afs_folio_dirty(vnode, tracepoint_string("store+"), folio);
528 if (!folio_clear_dirty_for_io(folio))
530 if (folio_start_writeback(folio))
532 afs_folio_start_fscache(caching, folio);
534 *_count -= folio_nr_pages(folio);
538 pagevec_release(&pvec);
546 * Synchronously write back the locked page and any subsequent non-locked dirty
549 static ssize_t afs_write_back_from_locked_folio(struct address_space *mapping,
550 struct writeback_control *wbc,
552 loff_t start, loff_t end)
554 struct afs_vnode *vnode = AFS_FS_I(mapping->host);
555 struct iov_iter iter;
557 unsigned int offset, to, len, max_len;
558 loff_t i_size = i_size_read(&vnode->vfs_inode);
559 bool new_content = test_bit(AFS_VNODE_NEW_CONTENT, &vnode->flags);
560 bool caching = fscache_cookie_enabled(afs_vnode_cache(vnode));
561 long count = wbc->nr_to_write;
564 _enter(",%lx,%llx-%llx", folio_index(folio), start, end);
566 if (folio_start_writeback(folio))
568 afs_folio_start_fscache(caching, folio);
570 count -= folio_nr_pages(folio);
572 /* Find all consecutive lockable dirty pages that have contiguous
573 * written regions, stopping when we find a page that is not
574 * immediately lockable, is not dirty or is missing, or we reach the
577 priv = (unsigned long)folio_get_private(folio);
578 offset = afs_folio_dirty_from(folio, priv);
579 to = afs_folio_dirty_to(folio, priv);
580 trace_afs_folio_dirty(vnode, tracepoint_string("store"), folio);
584 if (start < i_size) {
585 /* Trim the write to the EOF; the extra data is ignored. Also
586 * put an upper limit on the size of a single storedata op.
588 max_len = 65536 * 4096;
589 max_len = min_t(unsigned long long, max_len, end - start + 1);
590 max_len = min_t(unsigned long long, max_len, i_size - start);
593 (to == folio_size(folio) || new_content))
594 afs_extend_writeback(mapping, vnode, &count,
595 start, max_len, new_content,
597 len = min_t(loff_t, len, max_len);
600 /* We now have a contiguous set of dirty pages, each with writeback
601 * set; the first page is still locked at this point, but all the rest
602 * have been unlocked.
606 if (start < i_size) {
607 _debug("write back %x @%llx [%llx]", len, start, i_size);
609 /* Speculatively write to the cache. We have to fix this up
610 * later if the store fails.
612 afs_write_to_cache(vnode, start, len, i_size, caching);
614 iov_iter_xarray(&iter, WRITE, &mapping->i_pages, start, len);
615 ret = afs_store_data(vnode, &iter, start, false);
617 _debug("write discard %x @%llx [%llx]", len, start, i_size);
619 /* The dirty region was entirely beyond the EOF. */
620 fscache_clear_page_bits(afs_vnode_cache(vnode),
621 mapping, start, len, caching);
622 afs_pages_written_back(vnode, start, len);
628 wbc->nr_to_write = count;
633 pr_notice("kAFS: Unexpected error from FS.StoreData %d\n", ret);
641 afs_redirty_pages(wbc, mapping, start, len);
642 mapping_set_error(mapping, ret);
647 afs_redirty_pages(wbc, mapping, start, len);
648 mapping_set_error(mapping, -ENOSPC);
658 trace_afs_file_error(vnode, ret, afs_file_error_writeback_fail);
659 afs_kill_pages(mapping, start, len);
660 mapping_set_error(mapping, ret);
664 _leave(" = %d", ret);
669 * write a page back to the server
670 * - the caller locked the page for us
672 int afs_writepage(struct page *subpage, struct writeback_control *wbc)
674 struct folio *folio = page_folio(subpage);
678 _enter("{%lx},", folio_index(folio));
680 #ifdef CONFIG_AFS_FSCACHE
681 folio_wait_fscache(folio);
684 start = folio_index(folio) * PAGE_SIZE;
685 ret = afs_write_back_from_locked_folio(folio_mapping(folio), wbc,
686 folio, start, LLONG_MAX - start);
688 _leave(" = %zd", ret);
697 * write a region of pages back to the server
699 static int afs_writepages_region(struct address_space *mapping,
700 struct writeback_control *wbc,
701 loff_t start, loff_t end, loff_t *_next)
704 struct page *head_page;
708 _enter("%llx,%llx,", start, end);
711 pgoff_t index = start / PAGE_SIZE;
713 n = find_get_pages_range_tag(mapping, &index, end / PAGE_SIZE,
714 PAGECACHE_TAG_DIRTY, 1, &head_page);
718 folio = page_folio(head_page);
719 start = folio_pos(folio); /* May regress with THPs */
721 _debug("wback %lx", folio_index(folio));
723 /* At this point we hold neither the i_pages lock nor the
724 * page lock: the page may be truncated or invalidated
725 * (changing page->mapping to NULL), or even swizzled
726 * back from swapper_space to tmpfs file mapping
728 if (wbc->sync_mode != WB_SYNC_NONE) {
729 ret = folio_lock_killable(folio);
735 if (!folio_trylock(folio)) {
741 if (folio_mapping(folio) != mapping ||
742 !folio_test_dirty(folio)) {
743 start += folio_size(folio);
749 if (folio_test_writeback(folio) ||
750 folio_test_fscache(folio)) {
752 if (wbc->sync_mode != WB_SYNC_NONE) {
753 folio_wait_writeback(folio);
754 #ifdef CONFIG_AFS_FSCACHE
755 folio_wait_fscache(folio);
762 if (!folio_clear_dirty_for_io(folio))
764 ret = afs_write_back_from_locked_folio(mapping, wbc, folio, start, end);
767 _leave(" = %zd", ret);
774 } while (wbc->nr_to_write > 0);
777 _leave(" = 0 [%llx]", *_next);
782 * write some of the pending data back to the server
784 int afs_writepages(struct address_space *mapping,
785 struct writeback_control *wbc)
787 struct afs_vnode *vnode = AFS_FS_I(mapping->host);
793 /* We have to be careful as we can end up racing with setattr()
794 * truncating the pagecache since the caller doesn't take a lock here
797 if (wbc->sync_mode == WB_SYNC_ALL)
798 down_read(&vnode->validate_lock);
799 else if (!down_read_trylock(&vnode->validate_lock))
802 if (wbc->range_cyclic) {
803 start = mapping->writeback_index * PAGE_SIZE;
804 ret = afs_writepages_region(mapping, wbc, start, LLONG_MAX, &next);
806 mapping->writeback_index = next / PAGE_SIZE;
807 if (start > 0 && wbc->nr_to_write > 0) {
808 ret = afs_writepages_region(mapping, wbc, 0,
811 mapping->writeback_index =
815 } else if (wbc->range_start == 0 && wbc->range_end == LLONG_MAX) {
816 ret = afs_writepages_region(mapping, wbc, 0, LLONG_MAX, &next);
817 if (wbc->nr_to_write > 0 && ret == 0)
818 mapping->writeback_index = next / PAGE_SIZE;
820 ret = afs_writepages_region(mapping, wbc,
821 wbc->range_start, wbc->range_end, &next);
824 up_read(&vnode->validate_lock);
825 _leave(" = %d", ret);
830 * write to an AFS file
832 ssize_t afs_file_write(struct kiocb *iocb, struct iov_iter *from)
834 struct afs_vnode *vnode = AFS_FS_I(file_inode(iocb->ki_filp));
835 struct afs_file *af = iocb->ki_filp->private_data;
837 size_t count = iov_iter_count(from);
839 _enter("{%llx:%llu},{%zu},",
840 vnode->fid.vid, vnode->fid.vnode, count);
842 if (IS_SWAPFILE(&vnode->vfs_inode)) {
844 "AFS: Attempt to write to active swap file!\n");
851 result = afs_validate(vnode, af->key);
855 result = generic_file_write_iter(iocb, from);
857 _leave(" = %zd", result);
862 * flush any dirty pages for this process, and check for write errors.
863 * - the return status from this call provides a reliable indication of
864 * whether any write errors occurred for this process.
866 int afs_fsync(struct file *file, loff_t start, loff_t end, int datasync)
868 struct afs_vnode *vnode = AFS_FS_I(file_inode(file));
869 struct afs_file *af = file->private_data;
872 _enter("{%llx:%llu},{n=%pD},%d",
873 vnode->fid.vid, vnode->fid.vnode, file,
876 ret = afs_validate(vnode, af->key);
880 return file_write_and_wait_range(file, start, end);
884 * notification that a previously read-only page is about to become writable
885 * - if it returns an error, the caller will deliver a bus error signal
887 vm_fault_t afs_page_mkwrite(struct vm_fault *vmf)
889 struct folio *folio = page_folio(vmf->page);
890 struct file *file = vmf->vma->vm_file;
891 struct inode *inode = file_inode(file);
892 struct afs_vnode *vnode = AFS_FS_I(inode);
893 struct afs_file *af = file->private_data;
895 vm_fault_t ret = VM_FAULT_RETRY;
897 _enter("{{%llx:%llu}},{%lx}", vnode->fid.vid, vnode->fid.vnode, folio_index(folio));
899 afs_validate(vnode, af->key);
901 sb_start_pagefault(inode->i_sb);
903 /* Wait for the page to be written to the cache before we allow it to
904 * be modified. We then assume the entire page will need writing back.
906 #ifdef CONFIG_AFS_FSCACHE
907 if (folio_test_fscache(folio) &&
908 folio_wait_fscache_killable(folio) < 0)
912 if (folio_wait_writeback_killable(folio))
915 if (folio_lock_killable(folio) < 0)
918 /* We mustn't change folio->private until writeback is complete as that
919 * details the portion of the page we need to write back and we might
920 * need to redirty the page if there's a problem.
922 if (folio_wait_writeback_killable(folio) < 0) {
927 priv = afs_folio_dirty(folio, 0, folio_size(folio));
928 priv = afs_folio_dirty_mmapped(priv);
929 if (folio_test_private(folio)) {
930 folio_change_private(folio, (void *)priv);
931 trace_afs_folio_dirty(vnode, tracepoint_string("mkwrite+"), folio);
933 folio_attach_private(folio, (void *)priv);
934 trace_afs_folio_dirty(vnode, tracepoint_string("mkwrite"), folio);
936 file_update_time(file);
938 ret = VM_FAULT_LOCKED;
940 sb_end_pagefault(inode->i_sb);
945 * Prune the keys cached for writeback. The caller must hold vnode->wb_lock.
947 void afs_prune_wb_keys(struct afs_vnode *vnode)
949 LIST_HEAD(graveyard);
950 struct afs_wb_key *wbk, *tmp;
952 /* Discard unused keys */
953 spin_lock(&vnode->wb_lock);
955 if (!mapping_tagged(&vnode->vfs_inode.i_data, PAGECACHE_TAG_WRITEBACK) &&
956 !mapping_tagged(&vnode->vfs_inode.i_data, PAGECACHE_TAG_DIRTY)) {
957 list_for_each_entry_safe(wbk, tmp, &vnode->wb_keys, vnode_link) {
958 if (refcount_read(&wbk->usage) == 1)
959 list_move(&wbk->vnode_link, &graveyard);
963 spin_unlock(&vnode->wb_lock);
965 while (!list_empty(&graveyard)) {
966 wbk = list_entry(graveyard.next, struct afs_wb_key, vnode_link);
967 list_del(&wbk->vnode_link);
973 * Clean up a page during invalidation.
975 int afs_launder_page(struct page *subpage)
977 struct folio *folio = page_folio(subpage);
978 struct afs_vnode *vnode = AFS_FS_I(folio_inode(folio));
979 struct iov_iter iter;
980 struct bio_vec bv[1];
985 _enter("{%lx}", folio_index(folio));
987 priv = (unsigned long)folio_get_private(folio);
988 if (folio_clear_dirty_for_io(folio)) {
990 t = folio_size(folio);
991 if (folio_test_private(folio)) {
992 f = afs_folio_dirty_from(folio, priv);
993 t = afs_folio_dirty_to(folio, priv);
996 bv[0].bv_page = &folio->page;
998 bv[0].bv_len = t - f;
999 iov_iter_bvec(&iter, WRITE, bv, 1, bv[0].bv_len);
1001 trace_afs_folio_dirty(vnode, tracepoint_string("launder"), folio);
1002 ret = afs_store_data(vnode, &iter, folio_pos(folio) + f, true);
1005 trace_afs_folio_dirty(vnode, tracepoint_string("laundered"), folio);
1006 folio_detach_private(folio);
1007 folio_wait_fscache(folio);
1012 * Deal with the completion of writing the data to the cache.
1014 static void afs_write_to_cache_done(void *priv, ssize_t transferred_or_error,
1017 struct afs_vnode *vnode = priv;
1019 if (IS_ERR_VALUE(transferred_or_error) &&
1020 transferred_or_error != -ENOBUFS)
1021 afs_invalidate_cache(vnode, 0);
1025 * Save the write to the cache also.
1027 static void afs_write_to_cache(struct afs_vnode *vnode,
1028 loff_t start, size_t len, loff_t i_size,
1031 fscache_write_to_cache(afs_vnode_cache(vnode),
1032 vnode->vfs_inode.i_mapping, start, len, i_size,
1033 afs_write_to_cache_done, vnode, caching);