Skip to content

Commit

Permalink
f2fs: Fix not used variable 'index'
Browse files Browse the repository at this point in the history
Fix the following compilation warning:
fs/f2fs/data.c:2391:10: warning: variable ‘index’ set but not used
[-Wunused-but-set-variable]
 2391 |  pgoff_t index;

Only define and set the variable index when the CONFIG_F2FS_FS_COMPRESSION
is enabled.

Fixes: db92e6c ("f2fs: convert f2fs_mpage_readpages() to use folio")
Signed-off-by: Zeng Heng <[email protected]>
Reviewed-by: Chao Yu <[email protected]>
Signed-off-by: Jaegeuk Kim <[email protected]>
  • Loading branch information
henryZe authored and Jaegeuk Kim committed Oct 28, 2024
1 parent af4c5ca commit 665e78a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions fs/f2fs/data.c
Original file line number Diff line number Diff line change
Expand Up @@ -2385,10 +2385,10 @@ static int f2fs_mpage_readpages(struct inode *inode,
.nr_cpages = 0,
};
pgoff_t nc_cluster_idx = NULL_CLUSTER;
pgoff_t index;
#endif
unsigned nr_pages = rac ? readahead_count(rac) : 1;
unsigned max_nr_pages = nr_pages;
pgoff_t index;
int ret = 0;

map.m_pblk = 0;
Expand All @@ -2406,9 +2406,9 @@ static int f2fs_mpage_readpages(struct inode *inode,
prefetchw(&folio->flags);
}

#ifdef CONFIG_F2FS_FS_COMPRESSION
index = folio_index(folio);

#ifdef CONFIG_F2FS_FS_COMPRESSION
if (!f2fs_compressed_file(inode))
goto read_single_page;

Expand Down

0 comments on commit 665e78a

Please sign in to comment.