Ok. Will update the change log.
A better place for this code is really inside btrfs_wipe_existing_sb. Furthermore looking at libblkid it supports a way to wipe multiple superblocks by way of: blkid_do_wipe. I.e https://mirrors.edge.kernel.org/pub/linux/utils/util-linux/v2.21/libblkid-docs/libblkid-Low-level-tags.html#blkid-do-wipe Apparently this functionality has been in libblkid for quite some time according to this blog post - http://karelzak.blogspot.bg/2011/11/wipefs8-improvements.html (Karel Zak is the person mainting various system libraries). So can't we at the very least: 1) Remove some of our (open coded) implementation of btrfs_wipe_existing_sb and use the generic blkid implementation. 2) Incorporate your code into btrfs_wipe_existing_sb OR extend the usage of the generic blkid_do_wipe to wipe multiple copies of the sb ?
In btrfs_prepare_device() we have already zeroed the SBs which were within the block count. The btrfs_wipe_existing_sb() is to handle the other type of FS SBs. Definitely, we can consolidate all this into a single function using libblkid. However, it can be done in a separate patch. Thanks, Anand -- 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