From patchwork Tue Jun 1 14:17:49 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "M. Mohan Kumar" X-Patchwork-Id: 103544 X-Patchwork-Delegate: ericvh@gmail.com Received: from lists.sourceforge.net (lists.sourceforge.net [216.34.181.88]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o51EICcJ009287 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Tue, 1 Jun 2010 14:18:47 GMT Received: from localhost ([127.0.0.1] helo=sfs-ml-3.v29.ch3.sourceforge.com) by sfs-ml-3.v29.ch3.sourceforge.com with esmtp (Exim 4.69) (envelope-from ) id 1OJSIB-0004aA-R8; Tue, 01 Jun 2010 14:18:07 +0000 Received: from sfi-mx-1.v28.ch3.sourceforge.com ([172.29.28.121] helo=mx.sourceforge.net) by sfs-ml-3.v29.ch3.sourceforge.com with esmtp (Exim 4.69) (envelope-from ) id 1OJSIA-0004a5-Pg for v9fs-developer@lists.sourceforge.net; Tue, 01 Jun 2010 14:18:06 +0000 Received-SPF: softfail (sfi-mx-1.v28.ch3.sourceforge.com: transitioning domain of in.ibm.com does not designate 122.248.162.8 as permitted sender) client-ip=122.248.162.8; envelope-from=mohan@in.ibm.com; helo=e28smtp08.in.ibm.com; Received: from e28smtp08.in.ibm.com ([122.248.162.8]) by sfi-mx-1.v28.ch3.sourceforge.com with esmtps (TLSv1:AES256-SHA:256) (Exim 4.69) id 1OJSI4-0004jO-JD for v9fs-developer@lists.sourceforge.net; Tue, 01 Jun 2010 14:18:06 +0000 Received: from d28relay03.in.ibm.com (d28relay03.in.ibm.com [9.184.220.60]) by e28smtp08.in.ibm.com (8.14.4/8.13.1) with ESMTP id o51DCwpX030610 for ; Tue, 1 Jun 2010 18:42:58 +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 o51EHoX53666120 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 o51EHncj006485 for ; Wed, 2 Jun 2010 00:17:49 +1000 Received: from localhost.localdomain ([9.77.202.116]) by d28av04.in.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id o51EHnX6006470; Wed, 2 Jun 2010 00:17:49 +1000 From: "M. Mohan Kumar" To: qemu-devel@nongnu.org, v9fs-developer@lists.sourceforge.net Date: Tue, 1 Jun 2010 19:47:49 +0530 Message-Id: <1275401869-27560-1-git-send-email-mohan@in.ibm.com> X-Mailer: git-send-email 1.6.6.1 In-Reply-To: <1275401834-27520-1-git-send-email-mohan@in.ibm.com> References: <1275401834-27520-1-git-send-email-mohan@in.ibm.com> X-Spam-Score: -0.4 (/) X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. 0.7 SPF_SOFTFAIL SPF: sender does not match SPF record (softfail) -1.1 AWL AWL: From: address is in the auto white-list X-Headers-End: 1OJSI4-0004jO-JD Subject: [V9fs-developer] 9p: [RFC] [PATCH 02/02] Make use of iounit for read/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-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Tue, 01 Jun 2010 14:18:48 +0000 (UTC) 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)