diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2015-04-01 23:42:28 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2015-04-11 22:28:27 -0400 |
commit | e1200fe68f20759f359698f8a8dc81d06d1265f5 (patch) | |
tree | 2f6a596be0d8d2aa759687be4c0e9f4e0ecc1723 /fs/9p/vfs_addr.c | |
parent | 9565a5445240cd441f2c670aa7260ee8eb5dff79 (diff) | |
download | linux-e1200fe68f20759f359698f8a8dc81d06d1265f5.tar.gz linux-e1200fe68f20759f359698f8a8dc81d06d1265f5.tar.bz2 linux-e1200fe68f20759f359698f8a8dc81d06d1265f5.zip |
9p: switch p9_client_read() to passing struct iov_iter *
... and make it loop
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/9p/vfs_addr.c')
-rw-r--r-- | fs/9p/vfs_addr.c | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/fs/9p/vfs_addr.c b/fs/9p/vfs_addr.c index 402269c108cd..afe3225aaf36 100644 --- a/fs/9p/vfs_addr.c +++ b/fs/9p/vfs_addr.c @@ -51,12 +51,11 @@ */ static int v9fs_fid_readpage(struct p9_fid *fid, struct page *page) { - int retval; - loff_t offset; - char *buffer; - struct inode *inode; + struct inode *inode = page->mapping->host; + struct bio_vec bvec = {.bv_page = page, .bv_len = PAGE_SIZE}; + struct iov_iter to; + int retval, err; - inode = page->mapping->host; p9_debug(P9_DEBUG_VFS, "\n"); BUG_ON(!PageLocked(page)); @@ -65,16 +64,16 @@ static int v9fs_fid_readpage(struct p9_fid *fid, struct page *page) if (retval == 0) return retval; - buffer = kmap(page); - offset = page_offset(page); + iov_iter_bvec(&to, ITER_BVEC | READ, &bvec, 1, PAGE_SIZE); - retval = v9fs_fid_readn(fid, buffer, NULL, PAGE_CACHE_SIZE, offset); - if (retval < 0) { + retval = p9_client_read(fid, page_offset(page), &to, &err); + if (err) { v9fs_uncache_page(inode, page); + retval = err; goto done; } - memset(buffer + retval, 0, PAGE_CACHE_SIZE - retval); + zero_user(page, retval, PAGE_SIZE - retval); flush_dcache_page(page); SetPageUptodate(page); @@ -82,7 +81,6 @@ static int v9fs_fid_readpage(struct p9_fid *fid, struct page *page) retval = 0; done: - kunmap(page); unlock_page(page); return retval; } |