Skip to content

Commit 341d14f

Browse files
Mitch Harderchrismason-xx
authored andcommitted
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>
1 parent 69261c4 commit 341d14f

1 file changed

Lines changed: 2 additions & 5 deletions

File tree

‎fs/btrfs/file.c‎

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1059,7 +1059,7 @@ static int prepare_uptodate_page(struct page *page, u64 pos)
10591059
static noinline int prepare_pages(struct btrfs_root *root, struct file *file,
10601060
struct page **pages, size_t num_pages,
10611061
loff_t pos, unsigned long first_index,
1062-
unsigned long last_index, size_t write_bytes)
1062+
size_t write_bytes)
10631063
{
10641064
struct extent_state *cached_state = NULL;
10651065
int i;
@@ -1159,7 +1159,6 @@ static noinline ssize_t __btrfs_buffered_write(struct file *file,
11591159
struct btrfs_root *root = BTRFS_I(inode)->root;
11601160
struct page **pages = NULL;
11611161
unsigned long first_index;
1162-
unsigned long last_index;
11631162
size_t num_written = 0;
11641163
int nrptrs;
11651164
int ret = 0;
@@ -1172,7 +1171,6 @@ static noinline ssize_t __btrfs_buffered_write(struct file *file,
11721171
return -ENOMEM;
11731172

11741173
first_index = pos >> PAGE_CACHE_SHIFT;
1175-
last_index = (pos + iov_iter_count(i)) >> PAGE_CACHE_SHIFT;
11761174

11771175
while (iov_iter_count(i) > 0) {
11781176
size_t offset = pos & (PAGE_CACHE_SIZE - 1);
@@ -1206,8 +1204,7 @@ static noinline ssize_t __btrfs_buffered_write(struct file *file,
12061204
* contents of pages from loop to loop
12071205
*/
12081206
ret = prepare_pages(root, file, pages, num_pages,
1209-
pos, first_index, last_index,
1210-
write_bytes);
1207+
pos, first_index, write_bytes);
12111208
if (ret) {
12121209
btrfs_delalloc_release_space(inode,
12131210
num_pages << PAGE_CACHE_SHIFT);

0 commit comments

Comments
 (0)