On 03.11.2011 11:32, Jan Schmidt wrote: > On 03.11.2011 02:41, Li Zefan wrote: >> (as this is going to be merged into mainline..) >> >>> +/* >>> + * calls iterate() for every inode that references the extent identified by >>> + * the given parameters. will use the path given as a parameter and return it >>> + * released. >>> + * when the iterator function returns a non-zero value, iteration stops. >>> + */ >>> +int iterate_extent_inodes(struct btrfs_fs_info *fs_info, >>> + struct btrfs_path *path, >>> + u64 extent_item_objectid, >>> + u64 extent_offset, >>> + iterate_extent_inodes_t *iterate, void *ctx) >> >> While trying to use this API, I found there's a big defect in this function. >> >> fs_tree 1 fs_tree 2 >> \ / >> \ / >> \ / >> \ / >> node >> | >> | >> leaf (EXTENT_DATA item) >> >> In the above case, the function will find only 1 reference. > > Hum. You are right. > > I'm convinced that I've been at this point months ago, only I cannot > find code dealing with counts > 1 on nodes. I'll look for a fix in my > branches or make a new one. > > Currently, this is more of a best-effort resolver. Support for delayed > extents is missing, it should be used on commit roots to get a > consistent state. > The qgroups patch contains an implementation to find all roots for a given extent. A quite extensive part of qgroups is needed for that, so it might be easiest to build a new version on top of qgroups. Otherwise I could split qgroups in 2 parts to factor out that half. -Arne -- 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
