Blackfin arch: add NFC driver support in BF527-EZKIT board
[linux-2.6/kmemtrace.git] / fs / afs / write.c
blob9a849ad3c489411c8043cb66d50f8feceadfe7b8
1 /* handling of writes to regular files and writing back to the server
3 * Copyright (C) 2007 Red Hat, Inc. All Rights Reserved.
4 * Written by David Howells (dhowells@redhat.com)
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version
9 * 2 of the License, or (at your option) any later version.
11 #include <linux/backing-dev.h>
12 #include <linux/slab.h>
13 #include <linux/fs.h>
14 #include <linux/pagemap.h>
15 #include <linux/writeback.h>
16 #include <linux/pagevec.h>
17 #include "internal.h"
19 static int afs_write_back_from_locked_page(struct afs_writeback *wb,
20 struct page *page);
23 * mark a page as having been made dirty and thus needing writeback
25 int afs_set_page_dirty(struct page *page)
27 _enter("");
28 return __set_page_dirty_nobuffers(page);
32 * unlink a writeback record because its usage has reached zero
33 * - must be called with the wb->vnode->writeback_lock held
35 static void afs_unlink_writeback(struct afs_writeback *wb)
37 struct afs_writeback *front;
38 struct afs_vnode *vnode = wb->vnode;
40 list_del_init(&wb->link);
41 if (!list_empty(&vnode->writebacks)) {
42 /* if an fsync rises to the front of the queue then wake it
43 * up */
44 front = list_entry(vnode->writebacks.next,
45 struct afs_writeback, link);
46 if (front->state == AFS_WBACK_SYNCING) {
47 _debug("wake up sync");
48 front->state = AFS_WBACK_COMPLETE;
49 wake_up(&front->waitq);
55 * free a writeback record
57 static void afs_free_writeback(struct afs_writeback *wb)
59 _enter("");
60 key_put(wb->key);
61 kfree(wb);
65 * dispose of a reference to a writeback record
67 void afs_put_writeback(struct afs_writeback *wb)
69 struct afs_vnode *vnode = wb->vnode;
71 _enter("{%d}", wb->usage);
73 spin_lock(&vnode->writeback_lock);
74 if (--wb->usage == 0)
75 afs_unlink_writeback(wb);
76 else
77 wb = NULL;
78 spin_unlock(&vnode->writeback_lock);
79 if (wb)
80 afs_free_writeback(wb);
84 * partly or wholly fill a page that's under preparation for writing
86 static int afs_fill_page(struct afs_vnode *vnode, struct key *key,
87 unsigned start, unsigned len, struct page *page)
89 int ret;
91 _enter(",,%u,%u", start, len);
93 ASSERTCMP(start + len, <=, PAGE_SIZE);
95 ret = afs_vnode_fetch_data(vnode, key, start, len, page);
96 if (ret < 0) {
97 if (ret == -ENOENT) {
98 _debug("got NOENT from server"
99 " - marking file deleted and stale");
100 set_bit(AFS_VNODE_DELETED, &vnode->flags);
101 ret = -ESTALE;
105 _leave(" = %d", ret);
106 return ret;
110 * prepare a page for being written to
112 static int afs_prepare_page(struct afs_vnode *vnode, struct page *page,
113 struct key *key, unsigned offset, unsigned to)
115 unsigned eof, tail, start, stop, len;
116 loff_t i_size, pos;
117 void *p;
118 int ret;
120 _enter("");
122 if (offset == 0 && to == PAGE_SIZE)
123 return 0;
125 p = kmap_atomic(page, KM_USER0);
127 i_size = i_size_read(&vnode->vfs_inode);
128 pos = (loff_t) page->index << PAGE_SHIFT;
129 if (pos >= i_size) {
130 /* partial write, page beyond EOF */
131 _debug("beyond");
132 if (offset > 0)
133 memset(p, 0, offset);
134 if (to < PAGE_SIZE)
135 memset(p + to, 0, PAGE_SIZE - to);
136 kunmap_atomic(p, KM_USER0);
137 return 0;
140 if (i_size - pos >= PAGE_SIZE) {
141 /* partial write, page entirely before EOF */
142 _debug("before");
143 tail = eof = PAGE_SIZE;
144 } else {
145 /* partial write, page overlaps EOF */
146 eof = i_size - pos;
147 _debug("overlap %u", eof);
148 tail = max(eof, to);
149 if (tail < PAGE_SIZE)
150 memset(p + tail, 0, PAGE_SIZE - tail);
151 if (offset > eof)
152 memset(p + eof, 0, PAGE_SIZE - eof);
155 kunmap_atomic(p, KM_USER0);
157 ret = 0;
158 if (offset > 0 || eof > to) {
159 /* need to fill one or two bits that aren't going to be written
160 * (cover both fillers in one read if there are two) */
161 start = (offset > 0) ? 0 : to;
162 stop = (eof > to) ? eof : offset;
163 len = stop - start;
164 _debug("wr=%u-%u av=0-%u rd=%u@%u",
165 offset, to, eof, start, len);
166 ret = afs_fill_page(vnode, key, start, len, page);
169 _leave(" = %d", ret);
170 return ret;
174 * prepare to perform part of a write to a page
175 * - the caller holds the page locked, preventing it from being written out or
176 * modified by anyone else
178 int afs_prepare_write(struct file *file, struct page *page,
179 unsigned offset, unsigned to)
181 struct afs_writeback *candidate, *wb;
182 struct afs_vnode *vnode = AFS_FS_I(file->f_dentry->d_inode);
183 struct key *key = file->private_data;
184 pgoff_t index;
185 int ret;
187 _enter("{%x:%u},{%lx},%u,%u",
188 vnode->fid.vid, vnode->fid.vnode, page->index, offset, to);
190 candidate = kzalloc(sizeof(*candidate), GFP_KERNEL);
191 if (!candidate)
192 return -ENOMEM;
193 candidate->vnode = vnode;
194 candidate->first = candidate->last = page->index;
195 candidate->offset_first = offset;
196 candidate->to_last = to;
197 candidate->usage = 1;
198 candidate->state = AFS_WBACK_PENDING;
199 init_waitqueue_head(&candidate->waitq);
201 if (!PageUptodate(page)) {
202 _debug("not up to date");
203 ret = afs_prepare_page(vnode, page, key, offset, to);
204 if (ret < 0) {
205 kfree(candidate);
206 _leave(" = %d [prep]", ret);
207 return ret;
211 try_again:
212 index = page->index;
213 spin_lock(&vnode->writeback_lock);
215 /* see if this page is already pending a writeback under a suitable key
216 * - if so we can just join onto that one */
217 wb = (struct afs_writeback *) page_private(page);
218 if (wb) {
219 if (wb->key == key && wb->state == AFS_WBACK_PENDING)
220 goto subsume_in_current_wb;
221 goto flush_conflicting_wb;
224 if (index > 0) {
225 /* see if we can find an already pending writeback that we can
226 * append this page to */
227 list_for_each_entry(wb, &vnode->writebacks, link) {
228 if (wb->last == index - 1 && wb->key == key &&
229 wb->state == AFS_WBACK_PENDING)
230 goto append_to_previous_wb;
234 list_add_tail(&candidate->link, &vnode->writebacks);
235 candidate->key = key_get(key);
236 spin_unlock(&vnode->writeback_lock);
237 SetPagePrivate(page);
238 set_page_private(page, (unsigned long) candidate);
239 _leave(" = 0 [new]");
240 return 0;
242 subsume_in_current_wb:
243 _debug("subsume");
244 ASSERTRANGE(wb->first, <=, index, <=, wb->last);
245 if (index == wb->first && offset < wb->offset_first)
246 wb->offset_first = offset;
247 if (index == wb->last && to > wb->to_last)
248 wb->to_last = to;
249 spin_unlock(&vnode->writeback_lock);
250 kfree(candidate);
251 _leave(" = 0 [sub]");
252 return 0;
254 append_to_previous_wb:
255 _debug("append into %lx-%lx", wb->first, wb->last);
256 wb->usage++;
257 wb->last++;
258 wb->to_last = to;
259 spin_unlock(&vnode->writeback_lock);
260 SetPagePrivate(page);
261 set_page_private(page, (unsigned long) wb);
262 kfree(candidate);
263 _leave(" = 0 [app]");
264 return 0;
266 /* the page is currently bound to another context, so if it's dirty we
267 * need to flush it before we can use the new context */
268 flush_conflicting_wb:
269 _debug("flush conflict");
270 if (wb->state == AFS_WBACK_PENDING)
271 wb->state = AFS_WBACK_CONFLICTING;
272 spin_unlock(&vnode->writeback_lock);
273 if (PageDirty(page)) {
274 ret = afs_write_back_from_locked_page(wb, page);
275 if (ret < 0) {
276 afs_put_writeback(candidate);
277 _leave(" = %d", ret);
278 return ret;
282 /* the page holds a ref on the writeback record */
283 afs_put_writeback(wb);
284 set_page_private(page, 0);
285 ClearPagePrivate(page);
286 goto try_again;
290 * finalise part of a write to a page
292 int afs_commit_write(struct file *file, struct page *page,
293 unsigned offset, unsigned to)
295 struct afs_vnode *vnode = AFS_FS_I(file->f_dentry->d_inode);
296 loff_t i_size, maybe_i_size;
298 _enter("{%x:%u},{%lx},%u,%u",
299 vnode->fid.vid, vnode->fid.vnode, page->index, offset, to);
301 maybe_i_size = (loff_t) page->index << PAGE_SHIFT;
302 maybe_i_size += to;
304 i_size = i_size_read(&vnode->vfs_inode);
305 if (maybe_i_size > i_size) {
306 spin_lock(&vnode->writeback_lock);
307 i_size = i_size_read(&vnode->vfs_inode);
308 if (maybe_i_size > i_size)
309 i_size_write(&vnode->vfs_inode, maybe_i_size);
310 spin_unlock(&vnode->writeback_lock);
313 SetPageUptodate(page);
314 set_page_dirty(page);
315 if (PageDirty(page))
316 _debug("dirtied");
318 return 0;
322 * kill all the pages in the given range
324 static void afs_kill_pages(struct afs_vnode *vnode, bool error,
325 pgoff_t first, pgoff_t last)
327 struct pagevec pv;
328 unsigned count, loop;
330 _enter("{%x:%u},%lx-%lx",
331 vnode->fid.vid, vnode->fid.vnode, first, last);
333 pagevec_init(&pv, 0);
335 do {
336 _debug("kill %lx-%lx", first, last);
338 count = last - first + 1;
339 if (count > PAGEVEC_SIZE)
340 count = PAGEVEC_SIZE;
341 pv.nr = find_get_pages_contig(vnode->vfs_inode.i_mapping,
342 first, count, pv.pages);
343 ASSERTCMP(pv.nr, ==, count);
345 for (loop = 0; loop < count; loop++) {
346 ClearPageUptodate(pv.pages[loop]);
347 if (error)
348 SetPageError(pv.pages[loop]);
349 end_page_writeback(pv.pages[loop]);
352 __pagevec_release(&pv);
353 } while (first < last);
355 _leave("");
359 * synchronously write back the locked page and any subsequent non-locked dirty
360 * pages also covered by the same writeback record
362 static int afs_write_back_from_locked_page(struct afs_writeback *wb,
363 struct page *primary_page)
365 struct page *pages[8], *page;
366 unsigned long count;
367 unsigned n, offset, to;
368 pgoff_t start, first, last;
369 int loop, ret;
371 _enter(",%lx", primary_page->index);
373 count = 1;
374 if (!clear_page_dirty_for_io(primary_page))
375 BUG();
376 if (test_set_page_writeback(primary_page))
377 BUG();
379 /* find all consecutive lockable dirty pages, stopping when we find a
380 * page that is not immediately lockable, is not dirty or is missing,
381 * or we reach the end of the range */
382 start = primary_page->index;
383 if (start >= wb->last)
384 goto no_more;
385 start++;
386 do {
387 _debug("more %lx [%lx]", start, count);
388 n = wb->last - start + 1;
389 if (n > ARRAY_SIZE(pages))
390 n = ARRAY_SIZE(pages);
391 n = find_get_pages_contig(wb->vnode->vfs_inode.i_mapping,
392 start, n, pages);
393 _debug("fgpc %u", n);
394 if (n == 0)
395 goto no_more;
396 if (pages[0]->index != start) {
397 do {
398 put_page(pages[--n]);
399 } while (n > 0);
400 goto no_more;
403 for (loop = 0; loop < n; loop++) {
404 page = pages[loop];
405 if (page->index > wb->last)
406 break;
407 if (TestSetPageLocked(page))
408 break;
409 if (!PageDirty(page) ||
410 page_private(page) != (unsigned long) wb) {
411 unlock_page(page);
412 break;
414 if (!clear_page_dirty_for_io(page))
415 BUG();
416 if (test_set_page_writeback(page))
417 BUG();
418 unlock_page(page);
419 put_page(page);
421 count += loop;
422 if (loop < n) {
423 for (; loop < n; loop++)
424 put_page(pages[loop]);
425 goto no_more;
428 start += loop;
429 } while (start <= wb->last && count < 65536);
431 no_more:
432 /* we now have a contiguous set of dirty pages, each with writeback set
433 * and the dirty mark cleared; the first page is locked and must remain
434 * so, all the rest are unlocked */
435 first = primary_page->index;
436 last = first + count - 1;
438 offset = (first == wb->first) ? wb->offset_first : 0;
439 to = (last == wb->last) ? wb->to_last : PAGE_SIZE;
441 _debug("write back %lx[%u..] to %lx[..%u]", first, offset, last, to);
443 ret = afs_vnode_store_data(wb, first, last, offset, to);
444 if (ret < 0) {
445 switch (ret) {
446 case -EDQUOT:
447 case -ENOSPC:
448 set_bit(AS_ENOSPC,
449 &wb->vnode->vfs_inode.i_mapping->flags);
450 break;
451 case -EROFS:
452 case -EIO:
453 case -EREMOTEIO:
454 case -EFBIG:
455 case -ENOENT:
456 case -ENOMEDIUM:
457 case -ENXIO:
458 afs_kill_pages(wb->vnode, true, first, last);
459 set_bit(AS_EIO, &wb->vnode->vfs_inode.i_mapping->flags);
460 break;
461 case -EACCES:
462 case -EPERM:
463 case -ENOKEY:
464 case -EKEYEXPIRED:
465 case -EKEYREJECTED:
466 case -EKEYREVOKED:
467 afs_kill_pages(wb->vnode, false, first, last);
468 break;
469 default:
470 break;
472 } else {
473 ret = count;
476 _leave(" = %d", ret);
477 return ret;
481 * write a page back to the server
482 * - the caller locked the page for us
484 int afs_writepage(struct page *page, struct writeback_control *wbc)
486 struct backing_dev_info *bdi = page->mapping->backing_dev_info;
487 struct afs_writeback *wb;
488 int ret;
490 _enter("{%lx},", page->index);
492 wb = (struct afs_writeback *) page_private(page);
493 ASSERT(wb != NULL);
495 ret = afs_write_back_from_locked_page(wb, page);
496 unlock_page(page);
497 if (ret < 0) {
498 _leave(" = %d", ret);
499 return 0;
502 wbc->nr_to_write -= ret;
503 if (wbc->nonblocking && bdi_write_congested(bdi))
504 wbc->encountered_congestion = 1;
506 _leave(" = 0");
507 return 0;
511 * write a region of pages back to the server
513 static int afs_writepages_region(struct address_space *mapping,
514 struct writeback_control *wbc,
515 pgoff_t index, pgoff_t end, pgoff_t *_next)
517 struct backing_dev_info *bdi = mapping->backing_dev_info;
518 struct afs_writeback *wb;
519 struct page *page;
520 int ret, n;
522 _enter(",,%lx,%lx,", index, end);
524 do {
525 n = find_get_pages_tag(mapping, &index, PAGECACHE_TAG_DIRTY,
526 1, &page);
527 if (!n)
528 break;
530 _debug("wback %lx", page->index);
532 if (page->index > end) {
533 *_next = index;
534 page_cache_release(page);
535 _leave(" = 0 [%lx]", *_next);
536 return 0;
539 /* at this point we hold neither mapping->tree_lock nor lock on
540 * the page itself: the page may be truncated or invalidated
541 * (changing page->mapping to NULL), or even swizzled back from
542 * swapper_space to tmpfs file mapping
544 lock_page(page);
546 if (page->mapping != mapping) {
547 unlock_page(page);
548 page_cache_release(page);
549 continue;
552 if (wbc->sync_mode != WB_SYNC_NONE)
553 wait_on_page_writeback(page);
555 if (PageWriteback(page) || !PageDirty(page)) {
556 unlock_page(page);
557 continue;
560 wb = (struct afs_writeback *) page_private(page);
561 ASSERT(wb != NULL);
563 spin_lock(&wb->vnode->writeback_lock);
564 wb->state = AFS_WBACK_WRITING;
565 spin_unlock(&wb->vnode->writeback_lock);
567 ret = afs_write_back_from_locked_page(wb, page);
568 unlock_page(page);
569 page_cache_release(page);
570 if (ret < 0) {
571 _leave(" = %d", ret);
572 return ret;
575 wbc->nr_to_write -= ret;
577 if (wbc->nonblocking && bdi_write_congested(bdi)) {
578 wbc->encountered_congestion = 1;
579 break;
582 cond_resched();
583 } while (index < end && wbc->nr_to_write > 0);
585 *_next = index;
586 _leave(" = 0 [%lx]", *_next);
587 return 0;
591 * write some of the pending data back to the server
593 int afs_writepages(struct address_space *mapping,
594 struct writeback_control *wbc)
596 struct backing_dev_info *bdi = mapping->backing_dev_info;
597 pgoff_t start, end, next;
598 int ret;
600 _enter("");
602 if (wbc->nonblocking && bdi_write_congested(bdi)) {
603 wbc->encountered_congestion = 1;
604 _leave(" = 0 [congest]");
605 return 0;
608 if (wbc->range_cyclic) {
609 start = mapping->writeback_index;
610 end = -1;
611 ret = afs_writepages_region(mapping, wbc, start, end, &next);
612 if (start > 0 && wbc->nr_to_write > 0 && ret == 0 &&
613 !(wbc->nonblocking && wbc->encountered_congestion))
614 ret = afs_writepages_region(mapping, wbc, 0, start,
615 &next);
616 mapping->writeback_index = next;
617 } else if (wbc->range_start == 0 && wbc->range_end == LLONG_MAX) {
618 end = (pgoff_t)(LLONG_MAX >> PAGE_CACHE_SHIFT);
619 ret = afs_writepages_region(mapping, wbc, 0, end, &next);
620 if (wbc->nr_to_write > 0)
621 mapping->writeback_index = next;
622 } else {
623 start = wbc->range_start >> PAGE_CACHE_SHIFT;
624 end = wbc->range_end >> PAGE_CACHE_SHIFT;
625 ret = afs_writepages_region(mapping, wbc, start, end, &next);
628 _leave(" = %d", ret);
629 return ret;
633 * write an inode back
635 int afs_write_inode(struct inode *inode, int sync)
637 struct afs_vnode *vnode = AFS_FS_I(inode);
638 int ret;
640 _enter("{%x:%u},", vnode->fid.vid, vnode->fid.vnode);
642 ret = 0;
643 if (sync) {
644 ret = filemap_fdatawait(inode->i_mapping);
645 if (ret < 0)
646 __mark_inode_dirty(inode, I_DIRTY_DATASYNC);
649 _leave(" = %d", ret);
650 return ret;
654 * completion of write to server
656 void afs_pages_written_back(struct afs_vnode *vnode, struct afs_call *call)
658 struct afs_writeback *wb = call->wb;
659 struct pagevec pv;
660 unsigned count, loop;
661 pgoff_t first = call->first, last = call->last;
662 bool free_wb;
664 _enter("{%x:%u},{%lx-%lx}",
665 vnode->fid.vid, vnode->fid.vnode, first, last);
667 ASSERT(wb != NULL);
669 pagevec_init(&pv, 0);
671 do {
672 _debug("done %lx-%lx", first, last);
674 count = last - first + 1;
675 if (count > PAGEVEC_SIZE)
676 count = PAGEVEC_SIZE;
677 pv.nr = find_get_pages_contig(call->mapping, first, count,
678 pv.pages);
679 ASSERTCMP(pv.nr, ==, count);
681 spin_lock(&vnode->writeback_lock);
682 for (loop = 0; loop < count; loop++) {
683 struct page *page = pv.pages[loop];
684 end_page_writeback(page);
685 if (page_private(page) == (unsigned long) wb) {
686 set_page_private(page, 0);
687 ClearPagePrivate(page);
688 wb->usage--;
691 free_wb = false;
692 if (wb->usage == 0) {
693 afs_unlink_writeback(wb);
694 free_wb = true;
696 spin_unlock(&vnode->writeback_lock);
697 first += count;
698 if (free_wb) {
699 afs_free_writeback(wb);
700 wb = NULL;
703 __pagevec_release(&pv);
704 } while (first <= last);
706 _leave("");
710 * write to an AFS file
712 ssize_t afs_file_write(struct kiocb *iocb, const struct iovec *iov,
713 unsigned long nr_segs, loff_t pos)
715 struct dentry *dentry = iocb->ki_filp->f_path.dentry;
716 struct afs_vnode *vnode = AFS_FS_I(dentry->d_inode);
717 ssize_t result;
718 size_t count = iov_length(iov, nr_segs);
719 int ret;
721 _enter("{%x.%u},{%zu},%lu,",
722 vnode->fid.vid, vnode->fid.vnode, count, nr_segs);
724 if (IS_SWAPFILE(&vnode->vfs_inode)) {
725 printk(KERN_INFO
726 "AFS: Attempt to write to active swap file!\n");
727 return -EBUSY;
730 if (!count)
731 return 0;
733 result = generic_file_aio_write(iocb, iov, nr_segs, pos);
734 if (IS_ERR_VALUE(result)) {
735 _leave(" = %zd", result);
736 return result;
739 /* return error values for O_SYNC and IS_SYNC() */
740 if (IS_SYNC(&vnode->vfs_inode) || iocb->ki_filp->f_flags & O_SYNC) {
741 ret = afs_fsync(iocb->ki_filp, dentry, 1);
742 if (ret < 0)
743 result = ret;
746 _leave(" = %zd", result);
747 return result;
751 * flush the vnode to the fileserver
753 int afs_writeback_all(struct afs_vnode *vnode)
755 struct address_space *mapping = vnode->vfs_inode.i_mapping;
756 struct writeback_control wbc = {
757 .bdi = mapping->backing_dev_info,
758 .sync_mode = WB_SYNC_ALL,
759 .nr_to_write = LONG_MAX,
760 .for_writepages = 1,
761 .range_cyclic = 1,
763 int ret;
765 _enter("");
767 ret = mapping->a_ops->writepages(mapping, &wbc);
768 __mark_inode_dirty(mapping->host, I_DIRTY_PAGES);
770 _leave(" = %d", ret);
771 return ret;
775 * flush any dirty pages for this process, and check for write errors.
776 * - the return status from this call provides a reliable indication of
777 * whether any write errors occurred for this process.
779 int afs_fsync(struct file *file, struct dentry *dentry, int datasync)
781 struct afs_writeback *wb, *xwb;
782 struct afs_vnode *vnode = AFS_FS_I(dentry->d_inode);
783 int ret;
785 _enter("{%x:%u},{n=%s},%d",
786 vnode->fid.vid, vnode->fid.vnode, dentry->d_name.name,
787 datasync);
789 /* use a writeback record as a marker in the queue - when this reaches
790 * the front of the queue, all the outstanding writes are either
791 * completed or rejected */
792 wb = kzalloc(sizeof(*wb), GFP_KERNEL);
793 if (!wb)
794 return -ENOMEM;
795 wb->vnode = vnode;
796 wb->first = 0;
797 wb->last = -1;
798 wb->offset_first = 0;
799 wb->to_last = PAGE_SIZE;
800 wb->usage = 1;
801 wb->state = AFS_WBACK_SYNCING;
802 init_waitqueue_head(&wb->waitq);
804 spin_lock(&vnode->writeback_lock);
805 list_for_each_entry(xwb, &vnode->writebacks, link) {
806 if (xwb->state == AFS_WBACK_PENDING)
807 xwb->state = AFS_WBACK_CONFLICTING;
809 list_add_tail(&wb->link, &vnode->writebacks);
810 spin_unlock(&vnode->writeback_lock);
812 /* push all the outstanding writebacks to the server */
813 ret = afs_writeback_all(vnode);
814 if (ret < 0) {
815 afs_put_writeback(wb);
816 _leave(" = %d [wb]", ret);
817 return ret;
820 /* wait for the preceding writes to actually complete */
821 ret = wait_event_interruptible(wb->waitq,
822 wb->state == AFS_WBACK_COMPLETE ||
823 vnode->writebacks.next == &wb->link);
824 afs_put_writeback(wb);
825 _leave(" = %d", ret);
826 return ret;