183 | | if (!it1->hostname.contains(it2->hostname)) |
184 | | it1->hostname = it1->hostname + "," + it2->hostname; |
185 | | it1->directory = it1->directory + "," + it2->directory; |
186 | | fsInfos.erase(it2); |
187 | | it2 = it1; |
| 185 | int shouldConsolidate = 1; |
| 186 | // If both disks are local, let's see if they have the same |
| 187 | // st_dev. If so, it's two dirs on one device, if not, then |
| 188 | // it's two devices. |
| 189 | if(it1->isLocal && it2->isLocal) |
| 190 | { |
| 191 | struct stat it1_s, it2_s; |
| 192 | int ret1_s = stat(it1->directory.section(":", 1, 1) |
| 193 | .section(",", 0, 0), &it1_s); |
| 194 | int ret2_s = stat(it2->directory.section(":", 1, 1), |
| 195 | &it2_s); |
| 196 | if(!((ret1_s == 0 && ret2_s == 0) |
| 197 | && (it1_s.st_dev == it2_s.st_dev))) |
| 198 | { |
| 199 | shouldConsolidate = 0; |
| 200 | } |
| 201 | } |
| 202 | if(shouldConsolidate) |
| 203 | { |
| 204 | if (!it1->hostname.contains(it2->hostname)) |
| 205 | it1->hostname = it1->hostname + "," + it2->hostname; |
| 206 | it1->directory = it1->directory + "," + it2->directory; |
| 207 | fsInfos.erase(it2); |
| 208 | it2 = it1; |
| 209 | } |