Commit c31e4961 authored by Chao Yu's avatar Chao Yu Committed by Jaegeuk Kim

f2fs: fix compile warning in f2fs_destroy_node_manager()

fs/f2fs/node.c: In function ‘f2fs_destroy_node_manager’:
fs/f2fs/node.c:3390:1: warning: the frame size of 1048 bytes is larger than 1024 bytes [-Wframe-larger-than=]
 3390 | }

Merging below pointer arrays into common one, and reuse it by cast type.

struct nat_entry *natvec[NATVEC_SIZE];
struct nat_entry_set *setvec[SETVEC_SIZE];
Signed-off-by: default avatarChao Yu <chao@kernel.org>
Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
parent 0135c482
...@@ -3062,7 +3062,7 @@ int f2fs_flush_nat_entries(struct f2fs_sb_info *sbi, struct cp_control *cpc) ...@@ -3062,7 +3062,7 @@ int f2fs_flush_nat_entries(struct f2fs_sb_info *sbi, struct cp_control *cpc)
struct f2fs_nm_info *nm_i = NM_I(sbi); struct f2fs_nm_info *nm_i = NM_I(sbi);
struct curseg_info *curseg = CURSEG_I(sbi, CURSEG_HOT_DATA); struct curseg_info *curseg = CURSEG_I(sbi, CURSEG_HOT_DATA);
struct f2fs_journal *journal = curseg->journal; struct f2fs_journal *journal = curseg->journal;
struct nat_entry_set *setvec[SETVEC_SIZE]; struct nat_entry_set *setvec[NAT_VEC_SIZE];
struct nat_entry_set *set, *tmp; struct nat_entry_set *set, *tmp;
unsigned int found; unsigned int found;
nid_t set_idx = 0; nid_t set_idx = 0;
...@@ -3095,7 +3095,7 @@ int f2fs_flush_nat_entries(struct f2fs_sb_info *sbi, struct cp_control *cpc) ...@@ -3095,7 +3095,7 @@ int f2fs_flush_nat_entries(struct f2fs_sb_info *sbi, struct cp_control *cpc)
remove_nats_in_journal(sbi); remove_nats_in_journal(sbi);
while ((found = __gang_lookup_nat_set(nm_i, while ((found = __gang_lookup_nat_set(nm_i,
set_idx, SETVEC_SIZE, setvec))) { set_idx, NAT_VEC_SIZE, setvec))) {
unsigned idx; unsigned idx;
set_idx = setvec[found - 1]->set + 1; set_idx = setvec[found - 1]->set + 1;
...@@ -3316,8 +3316,9 @@ void f2fs_destroy_node_manager(struct f2fs_sb_info *sbi) ...@@ -3316,8 +3316,9 @@ void f2fs_destroy_node_manager(struct f2fs_sb_info *sbi)
{ {
struct f2fs_nm_info *nm_i = NM_I(sbi); struct f2fs_nm_info *nm_i = NM_I(sbi);
struct free_nid *i, *next_i; struct free_nid *i, *next_i;
struct nat_entry *natvec[NATVEC_SIZE]; void *vec[NAT_VEC_SIZE];
struct nat_entry_set *setvec[SETVEC_SIZE]; struct nat_entry **natvec = (struct nat_entry **)vec;
struct nat_entry_set **setvec = (struct nat_entry_set **)vec;
nid_t nid = 0; nid_t nid = 0;
unsigned int found; unsigned int found;
...@@ -3340,7 +3341,7 @@ void f2fs_destroy_node_manager(struct f2fs_sb_info *sbi) ...@@ -3340,7 +3341,7 @@ void f2fs_destroy_node_manager(struct f2fs_sb_info *sbi)
/* destroy nat cache */ /* destroy nat cache */
f2fs_down_write(&nm_i->nat_tree_lock); f2fs_down_write(&nm_i->nat_tree_lock);
while ((found = __gang_lookup_nat_cache(nm_i, while ((found = __gang_lookup_nat_cache(nm_i,
nid, NATVEC_SIZE, natvec))) { nid, NAT_VEC_SIZE, natvec))) {
unsigned idx; unsigned idx;
nid = nat_get_nid(natvec[found - 1]) + 1; nid = nat_get_nid(natvec[found - 1]) + 1;
...@@ -3356,8 +3357,9 @@ void f2fs_destroy_node_manager(struct f2fs_sb_info *sbi) ...@@ -3356,8 +3357,9 @@ void f2fs_destroy_node_manager(struct f2fs_sb_info *sbi)
/* destroy nat set cache */ /* destroy nat set cache */
nid = 0; nid = 0;
memset(vec, 0, sizeof(void *) * NAT_VEC_SIZE);
while ((found = __gang_lookup_nat_set(nm_i, while ((found = __gang_lookup_nat_set(nm_i,
nid, SETVEC_SIZE, setvec))) { nid, NAT_VEC_SIZE, setvec))) {
unsigned idx; unsigned idx;
nid = setvec[found - 1]->set + 1; nid = setvec[found - 1]->set + 1;
......
...@@ -35,8 +35,7 @@ ...@@ -35,8 +35,7 @@
#define DEF_RF_NODE_BLOCKS 0 #define DEF_RF_NODE_BLOCKS 0
/* vector size for gang look-up from nat cache that consists of radix tree */ /* vector size for gang look-up from nat cache that consists of radix tree */
#define NATVEC_SIZE 64 #define NAT_VEC_SIZE 32
#define SETVEC_SIZE 32
/* return value for read_node_page */ /* return value for read_node_page */
#define LOCKED_PAGE 1 #define LOCKED_PAGE 1
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment