From patchwork Thu Dec 8 20:59:02 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefano Stabellini X-Patchwork-Id: 9467129 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id C0C086071E for ; Thu, 8 Dec 2016 20:59:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id ACA8C283E2 for ; Thu, 8 Dec 2016 20:59:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A0C0E285F4; Thu, 8 Dec 2016 20:59:18 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.sourceforge.net (lists.sourceforge.net [216.34.181.88]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 0A400283E2 for ; Thu, 8 Dec 2016 20:59:18 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=sfs-ml-4.v29.ch3.sourceforge.com) by sfs-ml-4.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1cF5mf-00070H-0z; Thu, 08 Dec 2016 20:59:17 +0000 Received: from sog-mx-1.v43.ch3.sourceforge.com ([172.29.43.191] helo=mx.sourceforge.net) by sfs-ml-4.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1cF5me-00070C-PS for v9fs-developer@lists.sourceforge.net; Thu, 08 Dec 2016 20:59:16 +0000 X-ACL-Warn: Received: from mail.kernel.org ([198.145.29.136]) by sog-mx-1.v43.ch3.sourceforge.com with esmtps (TLSv1:AES256-SHA:256) (Exim 4.76) id 1cF5md-0003nu-Qe for v9fs-developer@lists.sourceforge.net; Thu, 08 Dec 2016 20:59:16 +0000 Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id F17D9203A4; Thu, 8 Dec 2016 20:59:08 +0000 (UTC) Received: from sstabellini-ThinkPad-X260.hsd1.ca.comcast.net (96-82-76-110-static.hfc.comcastbusiness.net [96.82.76.110]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id A82B4203A1; Thu, 8 Dec 2016 20:59:07 +0000 (UTC) From: Stefano Stabellini To: v9fs-developer@lists.sourceforge.net Date: Thu, 8 Dec 2016 12:59:02 -0800 Message-Id: <1481230746-16741-1-git-send-email-sstabellini@kernel.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: References: X-Virus-Scanned: ClamAV using ClamSMTP X-Headers-End: 1cF5md-0003nu-Qe Cc: ericvh@gmail.com, rminnich@sandia.gov, sstabellini@kernel.org, linux-kernel@vger.kernel.org, lucho@ionkov.net Subject: [V9fs-developer] [PATCH 1/5] 9p: add iocb parameter to p9_client_read and p9_client_write X-BeenThere: v9fs-developer@lists.sourceforge.net X-Mailman-Version: 2.1.9 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: v9fs-developer-bounces@lists.sourceforge.net X-Virus-Scanned: ClamAV using ClamSMTP The parameter can be NULL. Currently not utilized, but it will be used in later patches. Signed-off-by: Stefano Stabellini --- fs/9p/vfs_addr.c | 8 ++++---- fs/9p/vfs_dir.c | 2 +- fs/9p/vfs_file.c | 4 ++-- fs/9p/xattr.c | 4 ++-- include/net/9p/client.h | 7 +++++-- net/9p/client.c | 6 ++++-- 6 files changed, 18 insertions(+), 13 deletions(-) diff --git a/fs/9p/vfs_addr.c b/fs/9p/vfs_addr.c index 6181ad7..99ba284 100644 --- a/fs/9p/vfs_addr.c +++ b/fs/9p/vfs_addr.c @@ -66,7 +66,7 @@ static int v9fs_fid_readpage(struct p9_fid *fid, struct page *page) iov_iter_bvec(&to, ITER_BVEC | READ, &bvec, 1, PAGE_SIZE); - retval = p9_client_read(fid, page_offset(page), &to, &err); + retval = p9_client_read(fid, NULL, page_offset(page), &to, &err); if (err) { v9fs_uncache_page(inode, page); retval = err; @@ -181,7 +181,7 @@ static int v9fs_vfs_writepage_locked(struct page *page) set_page_writeback(page); - p9_client_write(v9inode->writeback_fid, page_offset(page), &from, &err); + p9_client_write(v9inode->writeback_fid, NULL, page_offset(page), &from, &err); end_page_writeback(page); return err; @@ -251,7 +251,7 @@ static int v9fs_launder_page(struct page *page) ssize_t n; int err = 0; if (iov_iter_rw(iter) == WRITE) { - n = p9_client_write(file->private_data, pos, iter, &err); + n = p9_client_write(file->private_data, iocb, pos, iter, &err); if (n) { struct inode *inode = file_inode(file); loff_t i_size = i_size_read(inode); @@ -259,7 +259,7 @@ static int v9fs_launder_page(struct page *page) inode_add_bytes(inode, pos + n - i_size); } } else { - n = p9_client_read(file->private_data, pos, iter, &err); + n = p9_client_read(file->private_data, iocb, pos, iter, &err); } return n ? n : err; } diff --git a/fs/9p/vfs_dir.c b/fs/9p/vfs_dir.c index b0405d6..68557e0 100644 --- a/fs/9p/vfs_dir.c +++ b/fs/9p/vfs_dir.c @@ -134,7 +134,7 @@ static int v9fs_dir_readdir(struct file *file, struct dir_context *ctx) struct iov_iter to; int n; iov_iter_kvec(&to, READ | ITER_KVEC, &kvec, 1, buflen); - n = p9_client_read(file->private_data, ctx->pos, &to, + n = p9_client_read(file->private_data, NULL, ctx->pos, &to, &err); if (err) return err; diff --git a/fs/9p/vfs_file.c b/fs/9p/vfs_file.c index d7b78d5..79e8c7d 100644 --- a/fs/9p/vfs_file.c +++ b/fs/9p/vfs_file.c @@ -387,7 +387,7 @@ static int v9fs_file_flock_dotl(struct file *filp, int cmd, p9_debug(P9_DEBUG_VFS, "count %zu offset %lld\n", iov_iter_count(to), iocb->ki_pos); - ret = p9_client_read(fid, iocb->ki_pos, to, &err); + ret = p9_client_read(fid, iocb, iocb->ki_pos, to, &err); if (!ret) return err; @@ -416,7 +416,7 @@ static int v9fs_file_flock_dotl(struct file *filp, int cmd, return retval; origin = iocb->ki_pos; - retval = p9_client_write(file->private_data, iocb->ki_pos, from, &err); + retval = p9_client_write(file->private_data, iocb, iocb->ki_pos, from, &err); if (retval > 0) { struct inode *inode = file_inode(file); loff_t i_size; diff --git a/fs/9p/xattr.c b/fs/9p/xattr.c index f329eee..5e137c0 100644 --- a/fs/9p/xattr.c +++ b/fs/9p/xattr.c @@ -48,7 +48,7 @@ ssize_t v9fs_fid_xattr_get(struct p9_fid *fid, const char *name, retval = -ERANGE; } else { iov_iter_truncate(&to, attr_size); - retval = p9_client_read(attr_fid, 0, &to, &err); + retval = p9_client_read(attr_fid, NULL, 0, &to, &err); if (err) retval = err; } @@ -125,7 +125,7 @@ int v9fs_fid_xattr_set(struct p9_fid *fid, const char *name, p9_debug(P9_DEBUG_VFS, "p9_client_xattrcreate failed %d\n", retval); else - p9_client_write(fid, 0, &from, &retval); + p9_client_write(fid, NULL, 0, &from, &retval); p9_client_clunk(fid); return retval; } diff --git a/include/net/9p/client.h b/include/net/9p/client.h index c6b97e5..aef19c6 100644 --- a/include/net/9p/client.h +++ b/include/net/9p/client.h @@ -26,6 +26,7 @@ #ifndef NET_9P_CLIENT_H #define NET_9P_CLIENT_H +#include #include /* Number of requests per row */ @@ -238,8 +239,10 @@ int p9_client_create_dotl(struct p9_fid *ofid, char *name, u32 flags, u32 mode, int p9_client_fsync(struct p9_fid *fid, int datasync); int p9_client_remove(struct p9_fid *fid); int p9_client_unlinkat(struct p9_fid *dfid, const char *name, int flags); -int p9_client_read(struct p9_fid *fid, u64 offset, struct iov_iter *to, int *err); -int p9_client_write(struct p9_fid *fid, u64 offset, struct iov_iter *from, int *err); +int p9_client_read(struct p9_fid *fid, struct kiocb *iocb, u64 offset, + struct iov_iter *to, int *err); +int p9_client_write(struct p9_fid *fid, struct kiocb *iocb, u64 offset, + struct iov_iter *from, int *err); int p9_client_readdir(struct p9_fid *fid, char *data, u32 count, u64 offset); int p9dirent_read(struct p9_client *clnt, char *buf, int len, struct p9_dirent *dirent); diff --git a/net/9p/client.c b/net/9p/client.c index 3fc94a4..b5ea9a3 100644 --- a/net/9p/client.c +++ b/net/9p/client.c @@ -1536,7 +1536,8 @@ int p9_client_unlinkat(struct p9_fid *dfid, const char *name, int flags) EXPORT_SYMBOL(p9_client_unlinkat); int -p9_client_read(struct p9_fid *fid, u64 offset, struct iov_iter *to, int *err) +p9_client_read(struct p9_fid *fid, struct kiocb *iocb, u64 offset, + struct iov_iter *to, int *err) { struct p9_client *clnt = fid->clnt; struct p9_req_t *req; @@ -1616,7 +1617,8 @@ int p9_client_unlinkat(struct p9_fid *dfid, const char *name, int flags) EXPORT_SYMBOL(p9_client_read); int -p9_client_write(struct p9_fid *fid, u64 offset, struct iov_iter *from, int *err) +p9_client_write(struct p9_fid *fid, struct kiocb *iocb, u64 offset, + struct iov_iter *from, int *err) { struct p9_client *clnt = fid->clnt; struct p9_req_t *req;