> On Sun, Sep 29, 2013 at 11:25:36PM +0800, Anand Jain wrote: >> It needs a lot more information about the snapshots if >> snapshot's life cycle has to be all auto managed by >> scripts _some day_. this patch is a step towards that. >> >> This patch provides the size which would be freed >> if the subvol/snapshot is deleted. >> preview: >> --------------------- >> btrfs su show /btrfs/sv1 >> :: >> Unshared space: 89.09MiB > > Useful information, but it takes time to calculate the number. The tree > search ioctl has significant overhead and seeking all over the extent > tree can be also lengthy. I've tried it on a random subvolume on a SSD > disk and it's been running 10 minutes already, one cpu is at 100%.
No wonder Anand's approach is inefficient.In Anand's approach: Search Every EXTENT_DATA Search every extent's refs in extent tree. If we want to speed up this progress, i think we can split it into two parts: 1. First to search inline extent_data 2. Secondly search in extent tree to calculate (extent refs=1) This will avoid n*n rather than n+n which is better… Thanks, Wang > > david > -- > To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in > the body of a message to majord...@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html