Re: [PATCH v3 1/3] Btrfs-progs: btrfs-list: split list_subvols

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

On Thu, Jul 28, 2011 at 07:13:04PM +0200, Jan Schmidt wrote:
> split list_subvols to separate functions and allow printing only in the
> containing function. lets us make use of those functions when resolving
> logical addresses.
> 
> Signed-off-by: Jan Schmidt <list.btrfs@xxxxxxxxxxxxx>
> ---
> @@ -250,20 +249,15 @@ static int resolve_root(struct root_lookup *rl, struct root_info *ri, int print_
>  		 */
>  		found = tree_search(&rl->root, next);
>  		if (!found) {
> -			top_id = next;
> +			*top_id = next;
>  			break;
>  		}
>  	}
> -	if (print_parent) {
> -		printf("ID %llu parent %llu top level %llu path %s\n",
> -		       (unsigned long long)ri->root_id, (unsigned long long)parent_id, (unsigned long long)top_id,
> -			full_path);
> -	} else {
> -		printf("ID %llu top level %llu path %s\n",
> -		       (unsigned long long)ri->root_id, (unsigned long long)top_id,
> -			full_path);
> -	}
> -	free(full_path);
> +
> +	*root_id = ri->root_id;
> +	*parent_id = ri->root_id;
        ^^^^^^^^^^^^^^^^^^^^^^^^^

this is not correct, parent_id is already set during the loop above.
else it prints same id for both volume and it's parent like

ID 493 parent 493 top level 5 path stress/9/...


david
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Filesystem Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux