Skip to contentSkip to conversation

btrfs: remove unused pages_processed variable

PATCH In review Arnd Bergmann 4 participants 5 messages Jul 24, 2023 – Aug 10, 2023 Btrfs file system

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 btrfs: remove unused pages_processed variable

From: Arnd Bergmann <[email protected]>

The only user of pages_processed was removed, so it's now a local write-only variable that can be eliminated as well:

fs/btrfs/extent_io.c:214:16: error: variable 'pages_processed' set but not used [-Werror,-Wunused-but-set-variable]

Fixes 9480af8687200 ("btrfs: split page locking out of __process_pages_contig")
---
 fs/btrfs/extent_io.c | 2 --
 1 file changed, 2 deletions(-)
fs/btrfs/extent_io.c +0 -2
index c0440a0988c9a..121edea2cfe85 100644
@@ -211,7 +211,6 @@ static void __process_pages_contig(struct address_space *mapping,
 	pgoff_t start_index = start >> PAGE_SHIFT;
 	pgoff_t end_index = end >> PAGE_SHIFT;
 	pgoff_t index = start_index;
-	unsigned long pages_processed = 0;
 	struct folio_batch fbatch;
 	int i;
 
@@ -226,7 +225,6 @@ static void __process_pages_contig(struct address_space *mapping,
 
 			process_one_page(fs_info, &folio->page, locked_page,
 					 page_ops, start, end);
-			pages_processed += folio_nr_pages(folio);
 		}
 		folio_batch_release(&fbatch);
 		cond_resched();
Signature · 1 line
2.39.2
Reviewed-by on v1 1/1
#1 lore raw
Quoted 4 lines · Arnd Bergmann

From: Arnd Bergmann <[email protected]>

The only user of pages_processed was removed, so it's now a local write-only variable that can be eliminated as well:

Hmm, I thought I had fixed this up, but obviously that version didn't end up in for-next, probably due to a faul on my side..

Looks good:

Reviewed-by on v1 1/1
#2 lore raw
In reply to Arnd Bergmann
Quoted 11 lines · Arnd Bergmann

From: Arnd Bergmann <[email protected]>

The only user of pages_processed was removed, so it's now a local write-only variable that can be eliminated as well:

fs/btrfs/extent_io.c:214:16: error: variable 'pages_processed' set but not used [-Werror,-Wunused-but-set-variable]

Fixes 9480af8687200 ("btrfs: split page locking out of __process_pages_contig")

Thanks for the patch!

Quoted 27 lines
---
 fs/btrfs/extent_io.c | 2 --
 1 file changed, 2 deletions(-)
fs/btrfs/extent_io.c +0 -2
index c0440a0988c9a..121edea2cfe85 100644
@@ -211,7 +211,6 @@ static void __process_pages_contig(struct address_space *mapping,
 	pgoff_t start_index = start >> PAGE_SHIFT;
 	pgoff_t end_index = end >> PAGE_SHIFT;
 	pgoff_t index = start_index;
-	unsigned long pages_processed = 0;
 	struct folio_batch fbatch;
 	int i;
 
@@ -226,7 +225,6 @@ static void __process_pages_contig(struct address_space *mapping,
 
 			process_one_page(fs_info, &folio->page, locked_page,
 					 page_ops, start, end);
-			pages_processed += folio_nr_pages(folio);
 		}
 		folio_batch_release(&fbatch);
 		cond_resched();
Signature · 1 line
2.39.2
#3 lore raw
Quoted 14 lines · Nick Desaulniers
Quoted 11 lines · Arnd Bergmann

From: Arnd Bergmann <[email protected]>

The only user of pages_processed was removed, so it's now a local write-only variable that can be eliminated as well:

fs/btrfs/extent_io.c:214:16: error: variable 'pages_processed' set but not used [-Werror,-Wunused-but-set-variable]

Fixes 9480af8687200 ("btrfs: split page locking out of __process_pages_contig")
Quoted 4 lines

Thanks for the patch!

Friendly ping the btrfs maintainers to please pick this up. Our CI for linux-next has been red over this for longer than I like, and it's giving me nausea, heartburn, indigestion, upset stomach, and...well...
https://youtu.be/d8InOVEsMlU

Quoted 28 lines
Quoted 28 lines
---
 fs/btrfs/extent_io.c | 2 --
 1 file changed, 2 deletions(-)
fs/btrfs/extent_io.c +0 -3
index c0440a0988c9a..121edea2cfe85 100644
@@ -211,7 +211,6 @@ static void __process_pages_contig(struct address_space *mapping,
      pgoff_t start_index = start >> PAGE_SHIFT;
      pgoff_t end_index = end >> PAGE_SHIFT;
      pgoff_t index = start_index;
-     unsigned long pages_processed = 0;
      struct folio_batch fbatch;
      int i;
 
@@ -226,7 +225,6 @@ static void __process_pages_contig(struct address_space *mapping,
 
                      process_one_page(fs_info, &folio->page, locked_page,
                                       page_ops, start, end);
-                     pages_processed += folio_nr_pages(folio);
              }
              folio_batch_release(&fbatch);
              cond_resched();
--

2.39.2

Signature · 2 lines
Thanks,
~Nick Desaulniers
#4 lore raw
Quoted 16 lines · Nick Desaulniers
Quoted 14 lines · Nick Desaulniers
Quoted 11 lines · Arnd Bergmann

From: Arnd Bergmann <[email protected]>

The only user of pages_processed was removed, so it's now a local write-only variable that can be eliminated as well:

fs/btrfs/extent_io.c:214:16: error: variable 'pages_processed' set but not used [-Werror,-Wunused-but-set-variable]

Fixes 9480af8687200 ("btrfs: split page locking out of __process_pages_contig")
Quoted 6 lines
Quoted 4 lines

Thanks for the patch!

Friendly ping the btrfs maintainers to please pick this up.

Fix folded to the original patch, thanks.