From patchwork Tue Aug 24 15:43:42 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: jvrao X-Patchwork-Id: 126901 X-Patchwork-Delegate: ericvh@gmail.com Received: from lists.sourceforge.net (lists.sourceforge.net [216.34.181.88]) by demeter.kernel.org (8.14.4/8.14.3) with ESMTP id o7OFYnNg022193 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Tue, 24 Aug 2010 15:35:27 GMT 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.69) (envelope-from ) id 1OnvWP-0005PO-JF; Tue, 24 Aug 2010 15:34:45 +0000 Received: from sog-mx-2.v43.ch3.sourceforge.com ([172.29.43.192] helo=mx.sourceforge.net) by sfs-ml-4.v29.ch3.sourceforge.com with esmtp (Exim 4.69) (envelope-from ) id 1OnvWN-0005PC-NW for v9fs-developer@lists.sourceforge.net; Tue, 24 Aug 2010 15:34:43 +0000 X-ACL-Warn: Received: from e7.ny.us.ibm.com ([32.97.182.137]) by sog-mx-2.v43.ch3.sourceforge.com with esmtps (TLSv1:AES256-SHA:256) (Exim 4.69) id 1OnvWM-0006R8-PP for v9fs-developer@lists.sourceforge.net; Tue, 24 Aug 2010 15:34:43 +0000 Received: from d01relay04.pok.ibm.com (d01relay04.pok.ibm.com [9.56.227.236]) by e7.ny.us.ibm.com (8.14.4/8.13.1) with ESMTP id o7OFKhWw005419 for ; Tue, 24 Aug 2010 11:20:43 -0400 Received: from d03av02.boulder.ibm.com (d03av02.boulder.ibm.com [9.17.195.168]) by d01relay04.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id o7OFYakh080046 for ; Tue, 24 Aug 2010 11:34:37 -0400 Received: from d03av02.boulder.ibm.com (loopback [127.0.0.1]) by d03av02.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id o7OFYYro006990 for ; Tue, 24 Aug 2010 09:34:36 -0600 Received: from localhost.localdomain (elm9m80.beaverton.ibm.com [9.47.81.80]) by d03av02.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id o7OFYX1X006901; Tue, 24 Aug 2010 09:34:33 -0600 From: "Venkateswararao Jujjuri (JV)" To: v9fs-developer@lists.sourceforge.net Date: Tue, 24 Aug 2010 08:43:42 -0700 Message-Id: <1282664622-12511-1-git-send-email-jvrao@linux.vnet.ibm.com> X-Mailer: git-send-email 1.6.0.6 X-Spam-Score: -0.0 (/) X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. -0.0 T_RP_MATCHES_RCVD Envelope sender domain matches handover relay domain X-Headers-End: 1OnvWM-0006R8-PP Cc: linux-fsdevel@vger.kernel.org, Badari Pulavarty Subject: [V9fs-developer] [PATCH-V2] [fs/9p] Remove the redundant rsize calculation in v9fs_file_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, 24 Aug 2010 15:35:27 +0000 (UTC) diff --git a/fs/9p/vfs_file.c b/fs/9p/vfs_file.c index e97c92b..39c8abe 100644 --- a/fs/9p/vfs_file.c +++ b/fs/9p/vfs_file.c @@ -219,7 +219,7 @@ static ssize_t v9fs_file_write(struct file *filp, const char __user * data, size_t count, loff_t * offset) { - int n, rsize, total = 0; + int n, total = 0; struct p9_fid *fid; struct p9_client *clnt; struct inode *inode = filp->f_path.dentry->d_inode; @@ -232,14 +232,8 @@ v9fs_file_write(struct file *filp, const char __user * data, fid = filp->private_data; clnt = fid->clnt; - rsize = fid->iounit ? fid->iounit : clnt->msize - P9_IOHDRSZ; - do { - if (count < rsize) - rsize = count; - - n = p9_client_write(fid, NULL, data+total, origin+total, - rsize); + n = p9_client_write(fid, NULL, data+total, origin+total, count); if (n <= 0) break; count -= n;