From patchwork Tue Jul 12 19:43:45 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mitch Harder X-Patchwork-Id: 969162 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.4) with ESMTP id p6CJhuGY000927 for ; Tue, 12 Jul 2011 19:43:56 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754932Ab1GLTny (ORCPT ); Tue, 12 Jul 2011 15:43:54 -0400 Received: from mail-yx0-f174.google.com ([209.85.213.174]:39965 "EHLO mail-yx0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754887Ab1GLTny (ORCPT ); Tue, 12 Jul 2011 15:43:54 -0400 Received: by yxi11 with SMTP id 11so2098221yxi.19 for ; Tue, 12 Jul 2011 12:43:53 -0700 (PDT) Received: by 10.91.4.21 with SMTP id g21mr484043agi.198.1310499833381; Tue, 12 Jul 2011 12:43:53 -0700 (PDT) Received: from localhost.localdomain (adsl-70-146-208-28.mob.bellsouth.net [70.146.208.28]) by mx.google.com with ESMTPS id w13sm13623051ano.23.2011.07.12.12.43.52 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 12 Jul 2011 12:43:52 -0700 (PDT) From: Mitch Harder To: linux-btrfs@vger.kernel.org Cc: Mitch Harder Subject: [PATCH] Btrfs: Remove unused variable 'last_index' in file.c Date: Tue, 12 Jul 2011 14:43:45 -0500 Message-Id: <1310499825-18695-1-git-send-email-mitch.harder@sabayonlinux.org> X-Mailer: git-send-email 1.7.3.4 Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Tue, 12 Jul 2011 19:43:57 +0000 (UTC) The variable 'last_index' is calculated in the __btrfs_buffered_write function and passed as a parameter to the prepare_pages function, but is not used anywhere in the prepare_pages function. Remove instances of 'last_index' in these functions. Signed-off-by: Mitch Harder --- fs/btrfs/file.c | 7 ++----- 1 files changed, 2 insertions(+), 5 deletions(-) diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c index bd6bbb8..b061de0 100644 --- a/fs/btrfs/file.c +++ b/fs/btrfs/file.c @@ -1059,7 +1059,7 @@ static int prepare_uptodate_page(struct page *page, u64 pos) static noinline int prepare_pages(struct btrfs_root *root, struct file *file, struct page **pages, size_t num_pages, loff_t pos, unsigned long first_index, - unsigned long last_index, size_t write_bytes) + size_t write_bytes) { struct extent_state *cached_state = NULL; int i; @@ -1159,7 +1159,6 @@ static noinline ssize_t __btrfs_buffered_write(struct file *file, struct btrfs_root *root = BTRFS_I(inode)->root; struct page **pages = NULL; unsigned long first_index; - unsigned long last_index; size_t num_written = 0; int nrptrs; int ret = 0; @@ -1172,7 +1171,6 @@ static noinline ssize_t __btrfs_buffered_write(struct file *file, return -ENOMEM; first_index = pos >> PAGE_CACHE_SHIFT; - last_index = (pos + iov_iter_count(i)) >> PAGE_CACHE_SHIFT; while (iov_iter_count(i) > 0) { size_t offset = pos & (PAGE_CACHE_SIZE - 1); @@ -1206,8 +1204,7 @@ static noinline ssize_t __btrfs_buffered_write(struct file *file, * contents of pages from loop to loop */ ret = prepare_pages(root, file, pages, num_pages, - pos, first_index, last_index, - write_bytes); + pos, first_index, write_bytes); if (ret) { btrfs_delalloc_release_space(inode, num_pages << PAGE_CACHE_SHIFT);