mountOptionsParser parses the mount options, superblock options.
(mountOptions string)
| 146 | |
| 147 | // mountOptionsParser parses the mount options, superblock options. |
| 148 | func mountOptionsParser(mountOptions string) map[string]string { |
| 149 | opts := make(map[string]string) |
| 150 | for opt := range strings.SplitSeq(mountOptions, ",") { |
| 151 | splitOption := strings.Split(opt, "=") |
| 152 | if len(splitOption) < 2 { |
| 153 | key := splitOption[0] |
| 154 | opts[key] = "" |
| 155 | } else { |
| 156 | key, value := splitOption[0], splitOption[1] |
| 157 | opts[key] = value |
| 158 | } |
| 159 | } |
| 160 | return opts |
| 161 | } |
| 162 | |
| 163 | // readMountInfo reads a full mountinfo file (no 1 MiB cap, unlike parsers.ReadFileNoStat). |
| 164 | func readMountInfo(path string) ([]byte, error) { |
no outgoing calls
no test coverage detected