Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 341d14f1 authored by Mitch Harder's avatar Mitch Harder Committed by Chris Mason
Browse files

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: default avatarMitch Harder <mitch.harder@sabayonlinux.org>
Signed-off-by: default avatarChris Mason <chris.mason@oracle.com>
parent 69261c4b
Loading
Loading
Loading
Loading
+2 −5
Original line number Original line Diff line number Diff line
@@ -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,
static noinline int prepare_pages(struct btrfs_root *root, struct file *file,
			 struct page **pages, size_t num_pages,
			 struct page **pages, size_t num_pages,
			 loff_t pos, unsigned long first_index,
			 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;
	struct extent_state *cached_state = NULL;
	int i;
	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 btrfs_root *root = BTRFS_I(inode)->root;
	struct page **pages = NULL;
	struct page **pages = NULL;
	unsigned long first_index;
	unsigned long first_index;
	unsigned long last_index;
	size_t num_written = 0;
	size_t num_written = 0;
	int nrptrs;
	int nrptrs;
	int ret = 0;
	int ret = 0;
@@ -1172,7 +1171,6 @@ static noinline ssize_t __btrfs_buffered_write(struct file *file,
		return -ENOMEM;
		return -ENOMEM;


	first_index = pos >> PAGE_CACHE_SHIFT;
	first_index = pos >> PAGE_CACHE_SHIFT;
	last_index = (pos + iov_iter_count(i)) >> PAGE_CACHE_SHIFT;


	while (iov_iter_count(i) > 0) {
	while (iov_iter_count(i) > 0) {
		size_t offset = pos & (PAGE_CACHE_SIZE - 1);
		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
		 * contents of pages from loop to loop
		 */
		 */
		ret = prepare_pages(root, file, pages, num_pages,
		ret = prepare_pages(root, file, pages, num_pages,
				    pos, first_index, last_index,
				    pos, first_index, write_bytes);
				    write_bytes);
		if (ret) {
		if (ret) {
			btrfs_delalloc_release_space(inode,
			btrfs_delalloc_release_space(inode,
					num_pages << PAGE_CACHE_SHIFT);
					num_pages << PAGE_CACHE_SHIFT);