diff options
author | Luke Shumaker <lukeshu@lukeshu.com> | 2023-03-10 19:31:50 -0700 |
---|---|---|
committer | Luke Shumaker <lukeshu@lukeshu.com> | 2023-04-17 21:52:25 -0600 |
commit | dc1eddc75a17687ee4d3bc301dd8b2ff253095fe (patch) | |
tree | 17ae387fae2f01a9ba94d74cf5f88a64b2c6f7a0 /cmd/btrfs-rec | |
parent | ee2564cc3164e2c235b3d617a1a4fed2f9d9efc6 (diff) |
cmd/btrfs-rec, btrfsutil: Delete OldRebuiltForrest
Diffstat (limited to 'cmd/btrfs-rec')
-rw-r--r-- | cmd/btrfs-rec/main.go | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/cmd/btrfs-rec/main.go b/cmd/btrfs-rec/main.go index ad768de..e167095 100644 --- a/cmd/btrfs-rec/main.go +++ b/cmd/btrfs-rec/main.go @@ -49,10 +49,9 @@ var globalFlags struct { logLevel textui.LogLevelFlag pvs []string - mappings string - nodeList string - rebuildV1 bool - rebuildV2 bool + mappings string + nodeList string + rebuild bool stopProfiling profile.StopFunc @@ -102,11 +101,8 @@ func main() { "load node list (output of 'btrfs-recs inspect [rebuild-mappings] list-nodes') from external JSON file `nodes.json`") noError(argparser.MarkPersistentFlagFilename("node-list")) - argparser.PersistentFlags().BoolVar(&globalFlags.rebuildV1, "rebuild", false, - "attempt to rebuild broken btrees when reading (v1)") - - argparser.PersistentFlags().BoolVar(&globalFlags.rebuildV2, "rebuild-v2", false, - "attempt to rebuild broken btrees when reading (v2)") + argparser.PersistentFlags().BoolVar(&globalFlags.rebuild, "rebuild", false, + "attempt to rebuild broken btrees when reading") globalFlags.stopProfiling = profile.AddProfileFlags(argparser.PersistentFlags(), "profile.") @@ -214,9 +210,7 @@ func runWithRawFSAndNodeList(runE func(*btrfs.FS, []btrfsvol.LogicalAddr, *cobra func _runWithReadableFS(wantNodeList bool, runE func(btrfs.ReadableFS, []btrfsvol.LogicalAddr, *cobra.Command, []string) error) func(*cobra.Command, []string) error { inner := func(fs *btrfs.FS, nodeList []btrfsvol.LogicalAddr, cmd *cobra.Command, args []string) error { var rfs btrfs.ReadableFS = fs - if globalFlags.rebuildV1 { - rfs = btrfsutil.NewOldRebuiltForrest(fs) - } else if globalFlags.rebuildV2 { + if globalFlags.rebuild { ctx := cmd.Context() graph, err := btrfsutil.ReadGraph(ctx, fs, nodeList) @@ -231,7 +225,7 @@ func _runWithReadableFS(wantNodeList bool, runE func(btrfs.ReadableFS, []btrfsvo } return func(cmd *cobra.Command, args []string) error { - if wantNodeList || globalFlags.rebuildV2 { + if wantNodeList || globalFlags.rebuild { return runWithRawFSAndNodeList(inner)(cmd, args) } return runWithRawFS(func(fs *btrfs.FS, cmd *cobra.Command, args []string) error { |