Re: [RFC PATCH 1/2] btrfs-progs: add 'btrfs inspect-internal csum-dump' command

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

 



[snip]
>> +        pr_debug("extent start: %llu, len: %llu\n", bytenr, extent_len);
>> +
>> +        csum_path = btrfs_alloc_path();
> 
> Hmm.. Here you allocate a path and release it after use, why not just do
> it in btrfs_lookup_csum()?

BTW, in user-space we have more stack memory, that's to say we could
completely afford something like:

	struct btrfs_path path;

	btrfs_init_path(&path);
	#do something with the path
	btrfs_release_path(&path);

In fact that's the preferred method.

> 
>> +        ret = btrfs_lookup_csum(info->csum_root, csum_path, bytenr,
>> +                    extent_len);
>> +        btrfs_release_path(csum_path);
>> +        if (ret) {

The naming is confusing as file-item.c has the same function name, but
different parameter list/return value.

What about reusing that one or using a wrapper around that one?

Thanks,
Qu

Attachment: signature.asc
Description: OpenPGP digital signature


[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