| 1 | package btrfsscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs`/ |
| 2 | |
| 3 | import ( |
| 4 | "errorsscip-go gomod github.com/golang/go/src go1.12 errors/" |
| 5 | "fmtscip-go gomod github.com/golang/go/src go1.12 fmt/" |
| 6 | ) |
| 7 | |
| 8 | type ErrNotBtrfsscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs`/ErrNotBtrfs# struct { |
| 9 | Pathscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs`/ErrNotBtrfs#Path. string |
| 10 | } |
| 11 | |
| 12 | func (e ErrNotBtrfsscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs`/ErrNotBtrfs#) Errorscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs`/ErrNotBtrfs#Error().() string { |
| 13 | return fmtscip-go gomod github.com/golang/go/src go1.12 fmt/.Sprintfscip-go gomod github.com/golang/go/src go1.12 fmt/Sprintf().("not a btrfs filesystem: %s", e.Pathscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs`/ErrNotBtrfs#Path.) |
| 14 | } |
| 15 | |
| 16 | // Error codes as returned by the kernel |
| 17 | type ErrCodescip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs`/ErrCode# int |
| 18 | |
| 19 | func (e ErrCodescip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs`/ErrCode#) Errorscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs`/ErrCode#Error().() string { |
| 20 | s, ok := errorStringscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs`/errorString.[e] |
| 21 | if ok { |
| 22 | return s |
| 23 | } |
| 24 | return fmtscip-go gomod github.com/golang/go/src go1.12 fmt/.Sprintfscip-go gomod github.com/golang/go/src go1.12 fmt/Sprintf().("error %d", int(e)) |
| 25 | } |
| 26 | |
| 27 | const ( |
| 28 | ErrDevRAID1MinNotMetscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs`/ErrDevRAID1MinNotMet. = ErrCodescip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs`/ErrCode#(iota + 1) |
| 29 | ErrDevRAID10MinNotMetscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs`/ErrDevRAID10MinNotMet. |
| 30 | ErrDevRAID5MinNotMetscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs`/ErrDevRAID5MinNotMet. |
| 31 | ErrDevRAID6MinNotMetscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs`/ErrDevRAID6MinNotMet. |
| 32 | ErrDevTargetReplacescip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs`/ErrDevTargetReplace. |
| 33 | ErrDevMissingNotFoundscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs`/ErrDevMissingNotFound. |
| 34 | ErrDevOnlyWritablescip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs`/ErrDevOnlyWritable. |
| 35 | ErrDevExclRunInProgressscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs`/ErrDevExclRunInProgress. |
| 36 | ) |
| 37 | |
| 38 | var errorStringscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs`/errorString. = map[ErrCodescip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs`/ErrCode#]string{ |
| 39 | ErrDevRAID1MinNotMetscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs`/ErrDevRAID1MinNotMet.: "unable to go below two devices on raid1", |
| 40 | ErrDevRAID10MinNotMetscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs`/ErrDevRAID10MinNotMet.: "unable to go below four devices on raid10", |
| 41 | ErrDevRAID5MinNotMetscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs`/ErrDevRAID5MinNotMet.: "unable to go below two devices on raid5", |
| 42 | ErrDevRAID6MinNotMetscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs`/ErrDevRAID6MinNotMet.: "unable to go below three devices on raid6", |
| 43 | ErrDevTargetReplacescip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs`/ErrDevTargetReplace.: "unable to remove the dev_replace target dev", |
| 44 | ErrDevMissingNotFoundscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs`/ErrDevMissingNotFound.: "no missing devices found to remove", |
| 45 | ErrDevOnlyWritablescip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs`/ErrDevOnlyWritable.: "unable to remove the only writeable device", |
| 46 | ErrDevExclRunInProgressscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs`/ErrDevExclRunInProgress.: "add/delete/balance/replace/resize operation in progress", |
| 47 | } |
| 48 | |
| 49 | var ( |
| 50 | ErrNotFoundscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs`/ErrNotFound. = errorsscip-go gomod github.com/golang/go/src go1.12 errors/.Newscip-go gomod github.com/golang/go/src go1.12 errors/New().("not found") |
| 51 | errNotImplementedscip-go gomod github.com/dennwc/btrfs . `github.com/dennwc/btrfs`/errNotImplemented. = errorsscip-go gomod github.com/golang/go/src go1.12 errors/.Newscip-go gomod github.com/golang/go/src go1.12 errors/New().("not implemented") |
| 52 | ) |