From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=55611 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OJSHz-0006Og-Cm for qemu-devel@nongnu.org; Tue, 01 Jun 2010 10:18:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OJSHy-0002wS-Em for qemu-devel@nongnu.org; Tue, 01 Jun 2010 10:17:55 -0400 Received: from e28smtp09.in.ibm.com ([122.248.162.9]:33781) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OJSHx-0002vp-MU for qemu-devel@nongnu.org; Tue, 01 Jun 2010 10:17:54 -0400 Received: from d28relay03.in.ibm.com (d28relay03.in.ibm.com [9.184.220.60]) by e28smtp09.in.ibm.com (8.14.4/8.13.1) with ESMTP id o51DI8Za002547 for ; Tue, 1 Jun 2010 18:48:08 +0530 Received: from d28av04.in.ibm.com (d28av04.in.ibm.com [9.184.220.66]) by d28relay03.in.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id o51EHoNa3502260 for ; Tue, 1 Jun 2010 19:47:50 +0530 Received: from d28av04.in.ibm.com (loopback [127.0.0.1]) by d28av04.in.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id o51EHncl006485 for ; Wed, 2 Jun 2010 00:17:50 +1000 From: "M. Mohan Kumar" Date: Tue, 1 Jun 2010 19:47:49 +0530 Message-Id: <1275401869-27560-1-git-send-email-mohan@in.ibm.com> In-Reply-To: <1275401834-27520-1-git-send-email-mohan@in.ibm.com> References: <1275401834-27520-1-git-send-email-mohan@in.ibm.com> Subject: [Qemu-devel] 9p: [RFC] [PATCH 02/02] Make use of iounit for read/write List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org, v9fs-developer@lists.sourceforge.net Change the v9fs_file_readn function to limit the maximum transfer size based on the iounit instead of msize. Also remove the redundant check for limiting the transfer size in v9fs_file_write. This check is done by p9_client_write. Signed-off-by: M. Mohan Kumar --- fs/9p/vfs_file.c | 10 ++-------- 1 files changed, 2 insertions(+), 8 deletions(-) diff --git a/fs/9p/vfs_file.c b/fs/9p/vfs_file.c index 25b300e..b8c0891 100644 --- a/fs/9p/vfs_file.c +++ b/fs/9p/vfs_file.c @@ -160,7 +160,7 @@ v9fs_file_readn(struct file *filp, char *data, char __user *udata, u32 count, offset += n; count -= n; total += n; - } while (count > 0 && n == (fid->clnt->msize - P9_IOHDRSZ)); + } while (count > 0 && n == fid->iounit); if (n < 0) total = n; @@ -187,11 +187,7 @@ v9fs_file_read(struct file *filp, char __user *udata, size_t count, P9_DPRINTK(P9_DEBUG_VFS, "count %zu offset %lld\n", count, *offset); fid = filp->private_data; - if (count > (fid->clnt->msize - P9_IOHDRSZ)) - ret = v9fs_file_readn(filp, NULL, udata, count, *offset); - else - ret = p9_client_read(fid, NULL, udata, *offset, count); - + ret = v9fs_file_readn(filp, NULL, udata, count, *offset); if (ret > 0) *offset += ret; @@ -225,8 +221,6 @@ v9fs_file_write(struct file *filp, const char __user * data, clnt = fid->clnt; rsize = fid->iounit; - if (!rsize || rsize > clnt->msize-P9_IOHDRSZ) - rsize = clnt->msize - P9_IOHDRSZ; do { if (count < rsize) -- 1.6.6.1