X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=blobdiff_plain;ds=sidebyside;f=fs%2Fafs%2Fwrite.c;h=065b4e10681ae2e449b700ad01c9d3f1c75cd9ab;hb=e2205a156f4dd727097f7f492bf03aa8920b0071;hp=aa03d43984b37cb4916538dd6b7fa54aa2e47e4e;hpb=b9b1f8d5930a813879278d0cbfc8c658d6a038dc;p=linux-2.6 diff --git a/fs/afs/write.c b/fs/afs/write.c index aa03d43984..065b4e1068 100644 --- a/fs/afs/write.c +++ b/fs/afs/write.c @@ -8,7 +8,7 @@ * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. */ - +#include #include #include #include @@ -206,7 +206,6 @@ int afs_prepare_write(struct file *file, struct page *page, _leave(" = %d [prep]", ret); return ret; } - SetPageUptodate(page); } try_again: @@ -311,8 +310,8 @@ int afs_commit_write(struct file *file, struct page *page, spin_unlock(&vnode->writeback_lock); } + SetPageUptodate(page); set_page_dirty(page); - if (PageDirty(page)) _debug("dirtied"); @@ -395,8 +394,9 @@ static int afs_write_back_from_locked_page(struct afs_writeback *wb, if (n == 0) goto no_more; if (pages[0]->index != start) { - for (n--; n >= 0; n--) - put_page(pages[n]); + do { + put_page(pages[--n]); + } while (n > 0); goto no_more; } @@ -404,7 +404,7 @@ static int afs_write_back_from_locked_page(struct afs_writeback *wb, page = pages[loop]; if (page->index > wb->last) break; - if (TestSetPageLocked(page)) + if (!trylock_page(page)) break; if (!PageDirty(page) || page_private(page) != (unsigned long) wb) { @@ -510,9 +510,9 @@ int afs_writepage(struct page *page, struct writeback_control *wbc) /* * write a region of pages back to the server */ -int afs_writepages_region(struct address_space *mapping, - struct writeback_control *wbc, - pgoff_t index, pgoff_t end, pgoff_t *_next) +static int afs_writepages_region(struct address_space *mapping, + struct writeback_control *wbc, + pgoff_t index, pgoff_t end, pgoff_t *_next) { struct backing_dev_info *bdi = mapping->backing_dev_info; struct afs_writeback *wb; @@ -669,7 +669,7 @@ void afs_pages_written_back(struct afs_vnode *vnode, struct afs_call *call) pagevec_init(&pv, 0); do { - _debug("attach %lx-%lx", first, last); + _debug("done %lx-%lx", first, last); count = last - first + 1; if (count > PAGEVEC_SIZE) @@ -701,7 +701,7 @@ void afs_pages_written_back(struct afs_vnode *vnode, struct afs_call *call) } __pagevec_release(&pv); - } while (first < last); + } while (first <= last); _leave(""); }