aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs
diff options
context:
space:
mode:
authorZhao Lei <zhaolei@cn.fujitsu.com>2015-01-20 02:11:45 -0500
committerChris Mason <clm@fb.com>2015-01-21 21:06:50 -0500
commit570193454a5841a9fa477ce1bcc6c30ca6fcf552 (patch)
treecbe99a04b8d3c3dcfbb5cbba8afb81cf912ae024 /fs/btrfs
parentffe2d2034bbb34f49f76c808550fdfbea2ea1659 (diff)
Rename all ref_count to refs in struct
refs is better than ref_count to record a struct's ref count. Signed-off-by: Zhao Lei <zhaolei@cn.fujitsu.com> Suggested-by: David Sterba <dsterba@suse.cz> Signed-off-by: Chris Mason <clm@fb.com>
Diffstat (limited to 'fs/btrfs')
-rw-r--r--fs/btrfs/scrub.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/fs/btrfs/scrub.c b/fs/btrfs/scrub.c
index 1ae527c9f8f4..8af7372238fc 100644
--- a/fs/btrfs/scrub.c
+++ b/fs/btrfs/scrub.c
@@ -79,7 +79,7 @@ struct scrub_page {
79 u64 logical; 79 u64 logical;
80 u64 physical; 80 u64 physical;
81 u64 physical_for_dev_replace; 81 u64 physical_for_dev_replace;
82 atomic_t ref_count; 82 atomic_t refs;
83 struct { 83 struct {
84 unsigned int mirror_num:8; 84 unsigned int mirror_num:8;
85 unsigned int have_csum:1; 85 unsigned int have_csum:1;
@@ -112,7 +112,7 @@ struct scrub_block {
112 struct scrub_page *pagev[SCRUB_MAX_PAGES_PER_BLOCK]; 112 struct scrub_page *pagev[SCRUB_MAX_PAGES_PER_BLOCK];
113 int page_count; 113 int page_count;
114 atomic_t outstanding_pages; 114 atomic_t outstanding_pages;
115 atomic_t ref_count; /* free mem on transition to zero */ 115 atomic_t refs; /* free mem on transition to zero */
116 struct scrub_ctx *sctx; 116 struct scrub_ctx *sctx;
117 struct scrub_parity *sparity; 117 struct scrub_parity *sparity;
118 struct { 118 struct {
@@ -141,7 +141,7 @@ struct scrub_parity {
141 141
142 int stripe_len; 142 int stripe_len;
143 143
144 atomic_t ref_count; 144 atomic_t refs;
145 145
146 struct list_head spages; 146 struct list_head spages;
147 147
@@ -1313,7 +1313,7 @@ static int scrub_setup_recheck_block(struct scrub_block *original_sblock,
1313 int ret; 1313 int ret;
1314 1314
1315 /* 1315 /*
1316 * note: the two members ref_count and outstanding_pages 1316 * note: the two members refs and outstanding_pages
1317 * are not used (and not set) in the blocks that are used for 1317 * are not used (and not set) in the blocks that are used for
1318 * the recheck procedure 1318 * the recheck procedure
1319 */ 1319 */
@@ -2026,12 +2026,12 @@ static int scrub_checksum_super(struct scrub_block *sblock)
2026 2026
2027static void scrub_block_get(struct scrub_block *sblock) 2027static void scrub_block_get(struct scrub_block *sblock)
2028{ 2028{
2029 atomic_inc(&sblock->ref_count); 2029 atomic_inc(&sblock->refs);
2030} 2030}
2031 2031
2032static void scrub_block_put(struct scrub_block *sblock) 2032static void scrub_block_put(struct scrub_block *sblock)
2033{ 2033{
2034 if (atomic_dec_and_test(&sblock->ref_count)) { 2034 if (atomic_dec_and_test(&sblock->refs)) {
2035 int i; 2035 int i;
2036 2036
2037 if (sblock->sparity) 2037 if (sblock->sparity)
@@ -2045,12 +2045,12 @@ static void scrub_block_put(struct scrub_block *sblock)
2045 2045
2046static void scrub_page_get(struct scrub_page *spage) 2046static void scrub_page_get(struct scrub_page *spage)
2047{ 2047{
2048 atomic_inc(&spage->ref_count); 2048 atomic_inc(&spage->refs);
2049} 2049}
2050 2050
2051static void scrub_page_put(struct scrub_page *spage) 2051static void scrub_page_put(struct scrub_page *spage)
2052{ 2052{
2053 if (atomic_dec_and_test(&spage->ref_count)) { 2053 if (atomic_dec_and_test(&spage->refs)) {
2054 if (spage->page) 2054 if (spage->page)
2055 __free_page(spage->page); 2055 __free_page(spage->page);
2056 kfree(spage); 2056 kfree(spage);
@@ -2176,7 +2176,7 @@ static int scrub_pages(struct scrub_ctx *sctx, u64 logical, u64 len,
2176 2176
2177 /* one ref inside this function, plus one for each page added to 2177 /* one ref inside this function, plus one for each page added to
2178 * a bio later on */ 2178 * a bio later on */
2179 atomic_set(&sblock->ref_count, 1); 2179 atomic_set(&sblock->refs, 1);
2180 sblock->sctx = sctx; 2180 sblock->sctx = sctx;
2181 sblock->no_io_error_seen = 1; 2181 sblock->no_io_error_seen = 1;
2182 2182
@@ -2469,7 +2469,7 @@ static int scrub_pages_for_parity(struct scrub_parity *sparity,
2469 2469
2470 /* one ref inside this function, plus one for each page added to 2470 /* one ref inside this function, plus one for each page added to
2471 * a bio later on */ 2471 * a bio later on */
2472 atomic_set(&sblock->ref_count, 1); 2472 atomic_set(&sblock->refs, 1);
2473 sblock->sctx = sctx; 2473 sblock->sctx = sctx;
2474 sblock->no_io_error_seen = 1; 2474 sblock->no_io_error_seen = 1;
2475 sblock->sparity = sparity; 2475 sblock->sparity = sparity;
@@ -2721,12 +2721,12 @@ static inline int scrub_calc_parity_bitmap_len(int nsectors)
2721 2721
2722static void scrub_parity_get(struct scrub_parity *sparity) 2722static void scrub_parity_get(struct scrub_parity *sparity)
2723{ 2723{
2724 atomic_inc(&sparity->ref_count); 2724 atomic_inc(&sparity->refs);
2725} 2725}
2726 2726
2727static void scrub_parity_put(struct scrub_parity *sparity) 2727static void scrub_parity_put(struct scrub_parity *sparity)
2728{ 2728{
2729 if (!atomic_dec_and_test(&sparity->ref_count)) 2729 if (!atomic_dec_and_test(&sparity->refs))
2730 return; 2730 return;
2731 2731
2732 scrub_parity_check_and_repair(sparity); 2732 scrub_parity_check_and_repair(sparity);
@@ -2776,7 +2776,7 @@ static noinline_for_stack int scrub_raid56_parity(struct scrub_ctx *sctx,
2776 sparity->scrub_dev = sdev; 2776 sparity->scrub_dev = sdev;
2777 sparity->logic_start = logic_start; 2777 sparity->logic_start = logic_start;
2778 sparity->logic_end = logic_end; 2778 sparity->logic_end = logic_end;
2779 atomic_set(&sparity->ref_count, 1); 2779 atomic_set(&sparity->refs, 1);
2780 INIT_LIST_HEAD(&sparity->spages); 2780 INIT_LIST_HEAD(&sparity->spages);
2781 sparity->dbitmap = sparity->bitmap; 2781 sparity->dbitmap = sparity->bitmap;
2782 sparity->ebitmap = (void *)sparity->bitmap + bitmap_len; 2782 sparity->ebitmap = (void *)sparity->bitmap + bitmap_len;