On Fri, Aug 16, 2013 at 04:27:28PM +0800, Liu Bo wrote: > Similar to ocfs2, btrfs also supports that extents can be shared by > different inodes, and there are some userspace tools requesting > for this kind of 'space shared infomation'.[1] > > ocfs2 uses flag FIEMAP_EXTENT_SHARED, so does btrfs. Looks ok to me. > + int ref_cnt = 0; I think using long is cleaner here, it always fits into (void*), int does not. > + /* > + * As btrfs supports shared space, this information > + * can be exported to userspace tools via > + * flag FIEMAP_EXTENT_SHARED. > + */ > + ret = iterate_inodes_from_logical( > + em->block_start, > + BTRFS_I(inode)->root->fs_info, > + path, count_ext_ref, &ref_cnt); > + if (ret < 0) > + goto out_free; > + > + if (ref_cnt > 1) > + flags |= FIEMAP_EXTENT_SHARED; AFAICS, e2fsprogs filefrag does not yet know about FIEMAP_EXTENT_SHARED. 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
