From patchwork Thu Aug 27 01:03:42 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Abhishek Kulkarni X-Patchwork-Id: 44162 X-Patchwork-Delegate: ericvh@gmail.com Received: from lists.sourceforge.net (lists.sourceforge.net [216.34.181.88]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n7R1QYnm016132 for ; Thu, 27 Aug 2009 01:26:34 GMT Received: from localhost ([127.0.0.1] helo=sfs-ml-4.v29.ch3.sourceforge.com) by 335xhf1.ch3.sourceforge.com with esmtp (Exim 4.69) (envelope-from ) id 1MgTkn-0008CN-8g; Thu, 27 Aug 2009 01:26:17 +0000 Received: from sfi-mx-2.v28.ch3.sourceforge.com ([172.29.28.122] helo=mx.sourceforge.net) by 335xhf1.ch3.sourceforge.com with esmtp (Exim 4.69) (envelope-from ) id 1MgTkm-0008CI-Bq for v9fs-developer@lists.sourceforge.net; Thu, 27 Aug 2009 01:26:16 +0000 X-ACL-Warn: Received: from mail-pz0-f192.google.com ([209.85.222.192]) by 72vjzd1.ch3.sourceforge.com with esmtp (Exim 4.69) id 1MgTke-00021z-6O for v9fs-developer@lists.sourceforge.net; Thu, 27 Aug 2009 01:26:16 +0000 Received: by pzk30 with SMTP id 30so723788pzk.4 for ; Wed, 26 Aug 2009 18:26:02 -0700 (PDT) Received: by 10.115.80.15 with SMTP id h15mr10648823wal.186.1251335016987; Wed, 26 Aug 2009 18:03:36 -0700 (PDT) Received: from localhost.localdomain (y-130-55-115-47.lanl.gov [130.55.115.47]) by mx.google.com with ESMTPS id 23sm931524pxi.1.2009.08.26.18.03.35 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 26 Aug 2009 18:03:36 -0700 (PDT) From: Abhishek Kulkarni To: linux-kernel@vger.kernel.org Date: Wed, 26 Aug 2009 19:03:42 -0600 Message-Id: <1251335023-8615-1-git-send-email-adkulkar@umail.iu.edu> X-Mailer: git-send-email 1.6.3.3 X-Spam-Score: -1.3 (-) X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. -1.3 AWL AWL: From: address is in the auto white-list X-Headers-End: 1MgTke-00021z-6O Cc: ericvh@gmail.com, v9fs-developer@lists.sourceforge.net Subject: [V9fs-developer] [PATCH 1/2] 9p: Use the i_size_[read, write]() macros instead of using inode->i_size directly. 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 Change all occurrence of inode->i_size with i_size_read() or i_size_write() as appropriate. Signed-off-by: Abhishek Kulkarni --- fs/9p/vfs_file.c | 8 ++++---- fs/9p/vfs_inode.c | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/fs/9p/vfs_file.c b/fs/9p/vfs_file.c index 68bf2af..de7690e 100644 --- a/fs/9p/vfs_file.c +++ b/fs/9p/vfs_file.c @@ -72,7 +72,7 @@ int v9fs_file_open(struct inode *inode, struct file *file) return err; } if (omode & P9_OTRUNC) { - inode->i_size = 0; + i_size_write(inode, 0); inode->i_blocks = 0; } if ((file->f_flags & O_APPEND) && (!v9fs_extended(v9ses))) @@ -239,9 +239,9 @@ v9fs_file_write(struct file *filp, const char __user * data, *offset += total; } - if (*offset > inode->i_size) { - inode->i_size = *offset; - inode->i_blocks = (inode->i_size + 512 - 1) >> 9; + if (*offset > i_size_read(inode)) { + i_size_write(inode, *offset); + inode->i_blocks = (i_size_read(inode) + 512 - 1) >> 9; } if (n < 0) diff --git a/fs/9p/vfs_inode.c b/fs/9p/vfs_inode.c index 06a223d..f3bfa87 100644 --- a/fs/9p/vfs_inode.c +++ b/fs/9p/vfs_inode.c @@ -872,10 +872,10 @@ v9fs_stat2inode(struct p9_wstat *stat, struct inode *inode, } else inode->i_rdev = 0; - inode->i_size = stat->length; + i_size_write(inode, stat->length); /* not real number of blocks, but 512 byte ones ... */ - inode->i_blocks = (inode->i_size + 512 - 1) >> 9; + inode->i_blocks = (i_size_read(inode) + 512 - 1) >> 9; } /**