Commit 46f84c2c authored by Chao Yu's avatar Chao Yu Committed by Jaegeuk Kim

f2fs: clean up discard_cmd_control structure

Avoid long variable name in discard_cmd_control structure, no logic
change.
Signed-off-by: default avatarChao Yu <yuchao0@huawei.com>
Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
parent 004b6862
...@@ -220,12 +220,12 @@ struct discard_cmd { ...@@ -220,12 +220,12 @@ struct discard_cmd {
struct discard_cmd_control { struct discard_cmd_control {
struct task_struct *f2fs_issue_discard; /* discard thread */ struct task_struct *f2fs_issue_discard; /* discard thread */
struct list_head discard_entry_list; /* 4KB discard entry list */ struct list_head entry_list; /* 4KB discard entry list */
int nr_discards; /* # of discards in the list */ struct list_head pend_list; /* store pending entries */
struct list_head discard_pend_list; /* store pending entries */ struct list_head wait_list; /* store on-flushing entries */
struct list_head discard_wait_list; /* store on-flushing entries */
wait_queue_head_t discard_wait_queue; /* waiting queue for wake-up */ wait_queue_head_t discard_wait_queue; /* waiting queue for wake-up */
struct mutex cmd_lock; struct mutex cmd_lock;
int nr_discards; /* # of discards in the list */
int max_discards; /* max. discards to be issued */ int max_discards; /* max. discards to be issued */
atomic_t issued_discard; /* # of issued discard */ atomic_t issued_discard; /* # of issued discard */
atomic_t issing_discard; /* # of issing discard */ atomic_t issing_discard; /* # of issing discard */
......
...@@ -677,7 +677,7 @@ static struct discard_cmd *__create_discard_cmd(struct f2fs_sb_info *sbi, ...@@ -677,7 +677,7 @@ static struct discard_cmd *__create_discard_cmd(struct f2fs_sb_info *sbi,
block_t start, block_t len) block_t start, block_t len)
{ {
struct discard_cmd_control *dcc = SM_I(sbi)->dcc_info; struct discard_cmd_control *dcc = SM_I(sbi)->dcc_info;
struct list_head *pend_list = &(dcc->discard_pend_list); struct list_head *pend_list = &(dcc->pend_list);
struct discard_cmd *dc; struct discard_cmd *dc;
dc = f2fs_kmem_cache_alloc(discard_cmd_slab, GFP_NOFS); dc = f2fs_kmem_cache_alloc(discard_cmd_slab, GFP_NOFS);
...@@ -773,7 +773,7 @@ static void __submit_discard_cmd(struct f2fs_sb_info *sbi, ...@@ -773,7 +773,7 @@ static void __submit_discard_cmd(struct f2fs_sb_info *sbi,
bio->bi_end_io = f2fs_submit_discard_endio; bio->bi_end_io = f2fs_submit_discard_endio;
bio->bi_opf |= REQ_SYNC; bio->bi_opf |= REQ_SYNC;
submit_bio(bio); submit_bio(bio);
list_move_tail(&dc->list, &dcc->discard_wait_list); list_move_tail(&dc->list, &dcc->wait_list);
} }
} else { } else {
__remove_discard_cmd(sbi, dc); __remove_discard_cmd(sbi, dc);
...@@ -961,8 +961,8 @@ void f2fs_wait_discard_bio(struct f2fs_sb_info *sbi, block_t blkaddr) ...@@ -961,8 +961,8 @@ void f2fs_wait_discard_bio(struct f2fs_sb_info *sbi, block_t blkaddr)
void f2fs_wait_discard_bios(struct f2fs_sb_info *sbi) void f2fs_wait_discard_bios(struct f2fs_sb_info *sbi)
{ {
struct discard_cmd_control *dcc = SM_I(sbi)->dcc_info; struct discard_cmd_control *dcc = SM_I(sbi)->dcc_info;
struct list_head *pend_list = &(dcc->discard_pend_list); struct list_head *pend_list = &(dcc->pend_list);
struct list_head *wait_list = &(dcc->discard_wait_list); struct list_head *wait_list = &(dcc->wait_list);
struct discard_cmd *dc, *tmp; struct discard_cmd *dc, *tmp;
struct blk_plug plug; struct blk_plug plug;
...@@ -986,8 +986,8 @@ static int issue_discard_thread(void *data) ...@@ -986,8 +986,8 @@ static int issue_discard_thread(void *data)
struct f2fs_sb_info *sbi = data; struct f2fs_sb_info *sbi = data;
struct discard_cmd_control *dcc = SM_I(sbi)->dcc_info; struct discard_cmd_control *dcc = SM_I(sbi)->dcc_info;
wait_queue_head_t *q = &dcc->discard_wait_queue; wait_queue_head_t *q = &dcc->discard_wait_queue;
struct list_head *pend_list = &dcc->discard_pend_list; struct list_head *pend_list = &dcc->pend_list;
struct list_head *wait_list = &dcc->discard_wait_list; struct list_head *wait_list = &dcc->wait_list;
struct discard_cmd *dc, *tmp; struct discard_cmd *dc, *tmp;
struct blk_plug plug; struct blk_plug plug;
int iter = 0; int iter = 0;
...@@ -1135,7 +1135,7 @@ static bool add_discard_addrs(struct f2fs_sb_info *sbi, struct cp_control *cpc, ...@@ -1135,7 +1135,7 @@ static bool add_discard_addrs(struct f2fs_sb_info *sbi, struct cp_control *cpc,
unsigned int start = 0, end = -1; unsigned int start = 0, end = -1;
bool force = (cpc->reason == CP_DISCARD); bool force = (cpc->reason == CP_DISCARD);
struct discard_entry *de = NULL; struct discard_entry *de = NULL;
struct list_head *head = &SM_I(sbi)->dcc_info->discard_entry_list; struct list_head *head = &SM_I(sbi)->dcc_info->entry_list;
int i; int i;
if (se->valid_blocks == max_blocks || !f2fs_discard_en(sbi)) if (se->valid_blocks == max_blocks || !f2fs_discard_en(sbi))
...@@ -1184,7 +1184,7 @@ static bool add_discard_addrs(struct f2fs_sb_info *sbi, struct cp_control *cpc, ...@@ -1184,7 +1184,7 @@ static bool add_discard_addrs(struct f2fs_sb_info *sbi, struct cp_control *cpc,
void release_discard_addrs(struct f2fs_sb_info *sbi) void release_discard_addrs(struct f2fs_sb_info *sbi)
{ {
struct list_head *head = &(SM_I(sbi)->dcc_info->discard_entry_list); struct list_head *head = &(SM_I(sbi)->dcc_info->entry_list);
struct discard_entry *entry, *this; struct discard_entry *entry, *this;
/* drop caches */ /* drop caches */
...@@ -1210,7 +1210,7 @@ static void set_prefree_as_free_segments(struct f2fs_sb_info *sbi) ...@@ -1210,7 +1210,7 @@ static void set_prefree_as_free_segments(struct f2fs_sb_info *sbi)
void clear_prefree_segments(struct f2fs_sb_info *sbi, struct cp_control *cpc) void clear_prefree_segments(struct f2fs_sb_info *sbi, struct cp_control *cpc)
{ {
struct list_head *head = &(SM_I(sbi)->dcc_info->discard_entry_list); struct list_head *head = &(SM_I(sbi)->dcc_info->entry_list);
struct discard_entry *entry, *this; struct discard_entry *entry, *this;
struct dirty_seglist_info *dirty_i = DIRTY_I(sbi); struct dirty_seglist_info *dirty_i = DIRTY_I(sbi);
unsigned long *prefree_map = dirty_i->dirty_segmap[PRE]; unsigned long *prefree_map = dirty_i->dirty_segmap[PRE];
...@@ -1311,9 +1311,9 @@ static int create_discard_cmd_control(struct f2fs_sb_info *sbi) ...@@ -1311,9 +1311,9 @@ static int create_discard_cmd_control(struct f2fs_sb_info *sbi)
if (!dcc) if (!dcc)
return -ENOMEM; return -ENOMEM;
INIT_LIST_HEAD(&dcc->discard_entry_list); INIT_LIST_HEAD(&dcc->entry_list);
INIT_LIST_HEAD(&dcc->discard_pend_list); INIT_LIST_HEAD(&dcc->pend_list);
INIT_LIST_HEAD(&dcc->discard_wait_list); INIT_LIST_HEAD(&dcc->wait_list);
mutex_init(&dcc->cmd_lock); mutex_init(&dcc->cmd_lock);
atomic_set(&dcc->issued_discard, 0); atomic_set(&dcc->issued_discard, 0);
atomic_set(&dcc->issing_discard, 0); atomic_set(&dcc->issing_discard, 0);
......
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