@@ -731,9 +731,9 @@ struct list_chunks_entry {
731731 u64 lstart ;
732732 u64 length ;
733733 u64 flags ;
734- u64 age ;
734+ u64 lnumber ;
735735 u64 used ;
736- u32 pnumber ;
736+ u32 number ;
737737};
738738
739739struct list_chunks_ctx {
@@ -843,7 +843,7 @@ static int print_list_chunks(struct list_chunks_ctx *ctx, unsigned sort_mode,
843843 int i ;
844844 int chidx ;
845845 u64 lastend ;
846- u64 age ;
846+ u64 number ;
847847 u32 gaps ;
848848 u32 tabidx ;
849849
@@ -853,17 +853,17 @@ static int print_list_chunks(struct list_chunks_ctx *ctx, unsigned sort_mode,
853853 */
854854 qsort (ctx -> stats , ctx -> length , sizeof (ctx -> stats [0 ]), cmp_cse_devid_start );
855855 devid = 0 ;
856- age = 0 ;
856+ number = 0 ;
857857 gaps = 0 ;
858858 lastend = 0 ;
859859 for (i = 0 ; i < ctx -> length ; i ++ ) {
860860 e = ctx -> stats [i ];
861861 if (e .devid != devid ) {
862862 devid = e .devid ;
863- age = 0 ;
863+ number = 0 ;
864864 }
865- ctx -> stats [i ].pnumber = age ;
866- age ++ ;
865+ ctx -> stats [i ].number = number ;
866+ number ++ ;
867867 if (with_empty && sort_mode == CHUNK_SORT_PSTART && e .start != lastend )
868868 gaps ++ ;
869869 lastend = e .start + e .length ;
@@ -937,7 +937,7 @@ static int print_list_chunks(struct list_chunks_ctx *ctx, unsigned sort_mode,
937937 table_printf (table , 2 , tabidx , ">%s" , pretty_size_mode (e .start , unit_mode ));
938938 table_printf (table , 3 , tabidx , ">%s" , pretty_size_mode (e .length , unit_mode ));
939939 table_printf (table , 4 , tabidx , ">%s" , pretty_size_mode (e .start + e .length , unit_mode ));
940- table_printf (table , 5 , tabidx , ">%llu" , e .age );
940+ table_printf (table , 5 , tabidx , ">%llu" , e .lnumber + 1 );
941941 table_printf (table , 6 , tabidx , ">%s" , pretty_size_mode (e .lstart , unit_mode ));
942942 if (with_usage )
943943 table_printf (table , 7 , tabidx , ">%6.2f" ,
@@ -995,8 +995,8 @@ static int cmd_inspect_list_chunks(const struct cmd_struct *cmd,
995995 struct btrfs_ioctl_search_key * sk = & args .key ;
996996 struct btrfs_ioctl_search_header sh ;
997997 unsigned long off = 0 ;
998- u64 * age = NULL ;
999- unsigned age_size = 128 ;
998+ u64 * lnumber = NULL ;
999+ unsigned lnumber_size = 128 ;
10001000 int ret ;
10011001 int fd ;
10021002 int i ;
@@ -1091,8 +1091,8 @@ static int cmd_inspect_list_chunks(const struct cmd_struct *cmd,
10911091 sk -> max_type = BTRFS_CHUNK_ITEM_KEY ;
10921092 sk -> max_offset = (u64 )- 1 ;
10931093 sk -> max_transid = (u64 )- 1 ;
1094- age = calloc (age_size , sizeof (u64 ));
1095- if (!age ) {
1094+ lnumber = calloc (lnumber_size , sizeof (u64 ));
1095+ if (!lnumber ) {
10961096 ret = 1 ;
10971097 error_msg (ERROR_MSG_MEMORY , NULL );
10981098 goto out_nomem ;
@@ -1133,22 +1133,22 @@ static int cmd_inspect_list_chunks(const struct cmd_struct *cmd,
11331133 e -> lstart = sh .offset ;
11341134 e -> length = item -> length ;
11351135 e -> flags = item -> type ;
1136- e -> pnumber = -1 ;
1137- while (devid > age_size ) {
1136+ e -> number = -1 ;
1137+ while (devid > lnumber_size ) {
11381138 u64 * tmp ;
1139- unsigned old_size = age_size ;
1139+ unsigned old_size = lnumber_size ;
11401140
1141- age_size += 128 ;
1142- tmp = calloc (age_size , sizeof (u64 ));
1141+ lnumber_size += 128 ;
1142+ tmp = calloc (lnumber_size , sizeof (u64 ));
11431143 if (!tmp ) {
11441144 ret = 1 ;
11451145 error_msg (ERROR_MSG_MEMORY , NULL );
11461146 goto out_nomem ;
11471147 }
1148- memcpy (tmp , age , sizeof (u64 ) * old_size );
1149- age = tmp ;
1148+ memcpy (tmp , lnumber , sizeof (u64 ) * old_size );
1149+ lnumber = tmp ;
11501150 }
1151- e -> age = age [devid ]++ ;
1151+ e -> lnumber = lnumber [devid ]++ ;
11521152 if (with_usage ) {
11531153 if (used == (u64 )- 1 )
11541154 used = fill_usage (fd , sh .offset );
@@ -1186,7 +1186,7 @@ static int cmd_inspect_list_chunks(const struct cmd_struct *cmd,
11861186
11871187out_nomem :
11881188 free (ctx .stats );
1189- free (age );
1189+ free (lnumber );
11901190
11911191 return !!ret ;
11921192}
0 commit comments