dm writecache: remove unused member pointer in writeback_struct
From: Huaisheng Ye <[email protected]>
The stucture member pointer page in writeback_struct never has been used actually. Remove it.
--- drivers/md/dm-writecache.c | 1 - 1 file changed, 1 deletion(-)
drivers/md/dm-writecache.c +0 -1
@@ -190,7 +190,6 @@ struct writeback_struct {struct dm_writecache *wc;struct wc_entry **wc_list;unsigned wc_list_n; -struct page *page;struct wc_entry *wc_list_inline[WB_LIST_INLINE ];struct bio bio; };
Signature · 1 line
1.8.3.1
dm writecache: add unlikely for getting two block with same LBA
From: Huaisheng Ye <[email protected]>
In function writecache_writeback, entries g and f has same original sector only happens at entry f has been committed, but entry g has NOT yet.
The probability of this happening is very low in the following
256 blocks at most of entry e, so add unlikely for the result.
--- drivers/md/dm-writecache.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/md/dm-writecache.c +2 -2
@@ -1628,8 +1628,8 @@ static void writecache_writeback(struct work_struct *work)if (unlikely (!next_node))break ; g = container_of(next_node, struct wc_entry, rb_node); -if (read_original_sector (wc, g) == -read_original_sector (wc, f)) { +if (unlikely (read_original_sector (wc, g) == +read_original_sector (wc, f))) { f = g;continue ; }
Signature · 1 line
1.8.3.1
Re: dm writecache: add unlikely for getting two block with same LBA
Quoted 10 lines · Huaisheng Ye
From: Huaisheng Ye <[email protected]>
In function
writecache_writeback, entries g and f has same original sector only happens at entry f has been committed, but entry g has NOT yet.The probability of this happening is very low in the following
256 blocks at most of entry e, so add unlikely for the result.Signed-off-by Huaisheng Ye <[email protected]>
Quoted 23 lines
--- drivers/md/dm-writecache.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/md/dm-writecache.c +2
-2@@ -1628,8 +1628,8 @@ static void writecache_writeback(struct work_struct *work)if (unlikely (!next_node))break ; g = container_of(next_node, struct wc_entry, rb_node); -if (read_original_sector (wc, g) == -read_original_sector (wc, f)) { +if (unlikely (read_original_sector (wc, g) == +read_original_sector (wc, f))) { f = g;continue ; }Signature · 1 line
1.8.3.1
Quoted 6 lines · Huaisheng Ye
From: Huaisheng Ye <[email protected]>
The stucture member pointer page in
writeback_structnever has been used actually. Remove it.Signed-off-by Huaisheng Ye <[email protected]>
Quoted 20 lines
--- drivers/md/dm-writecache.c | 1 - 1 file changed, 1 deletion(-)drivers/md/dm-writecache.c +0
-1@@ -190,7 +190,6 @@ struct writeback_struct {struct dm_writecache *wc;struct wc_entry **wc_list;unsigned wc_list_n; -struct page *page;struct wc_entry *wc_list_inline[WB_LIST_INLINE ];struct bio bio; };Signature · 1 line
1.8.3.1