Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Btrfs: Remove unused variable 'last_index' in file.c

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 <mitch.harder@sabayonlinux.org>
Signed-off-by: Chris Mason <chris.mason@oracle.com>

authored by

Mitch Harder and committed by
Chris Mason
341d14f1 69261c4b

+2 -5
+2 -5
fs/btrfs/file.c
··· 1059 1059 static noinline int prepare_pages(struct btrfs_root *root, struct file *file, 1060 1060 struct page **pages, size_t num_pages, 1061 1061 loff_t pos, unsigned long first_index, 1062 - unsigned long last_index, size_t write_bytes) 1062 + size_t write_bytes) 1063 1063 { 1064 1064 struct extent_state *cached_state = NULL; 1065 1065 int i; ··· 1159 1159 struct btrfs_root *root = BTRFS_I(inode)->root; 1160 1160 struct page **pages = NULL; 1161 1161 unsigned long first_index; 1162 - unsigned long last_index; 1163 1162 size_t num_written = 0; 1164 1163 int nrptrs; 1165 1164 int ret = 0; ··· 1171 1172 return -ENOMEM; 1172 1173 1173 1174 first_index = pos >> PAGE_CACHE_SHIFT; 1174 - last_index = (pos + iov_iter_count(i)) >> PAGE_CACHE_SHIFT; 1175 1175 1176 1176 while (iov_iter_count(i) > 0) { 1177 1177 size_t offset = pos & (PAGE_CACHE_SIZE - 1); ··· 1204 1206 * contents of pages from loop to loop 1205 1207 */ 1206 1208 ret = prepare_pages(root, file, pages, num_pages, 1207 - pos, first_index, last_index, 1208 - write_bytes); 1209 + pos, first_index, write_bytes); 1209 1210 if (ret) { 1210 1211 btrfs_delalloc_release_space(inode, 1211 1212 num_pages << PAGE_CACHE_SHIFT);