> [...] > > > Thus in principle also Move() should have something like a `bool > > > force' > > > parameter; or maybe `uint32 options' where options can be > > > B_MOVE_PARTITION_ALL, B_MOVE_PARTITION_FORCE, > > > B_MOVE_PARTITION_IGNORE_CONTENTS. > > > > Does B_MOVE_PARITION_ALL succeed iff you can move all partitions? > > Yep. > > > And > > is FORCE then "move as many as you can, destroying those that say > > they > > can't be moved" > > All partitions claiming, that they can be moved in principle, are > tried > to be moved. If moving any of them fails, the complete Move() reports > an error. So it's `move all partitions whose disk systems reported > them > as movable'. Since the respective syscall for Move() will internally > do > the equivalent of a ValidateMove() first, the shadow partitions won't > be touched, if it fails. Sounds okay. > > and IGNORE "just move it and wipe out the contents"? > > That would have the same semantics as deleting the partition and re- > creating it at the new position. Alternatively the partition could be > moved indeed, which would save all descendants, that don't use > absolute > addressing. I changed the KDiskSystem::SupportsMoving() parameter from > `whileMounted' to `isNoOp', which is equivalent in case of file > systems, but gives more info for partitioning systems. So, all > descendants for which moving is a no-op would survive. Don't know, if > that is desired though -- one would probably use FORCE in this case > anyway. > > I'm not even sure, that IGNORE would be used in practice. How I > imagined DriveSetup to work when the user moves a partition, would be > to do a ValidateMove() to find out whether descendant partitions are > movable or not, ask the user something like `Partitions X, Y, Z are > not > movable. Their data will be destroyed, when proceeding. [Nuke Them] > [[Cancel]]'. So, FORCE would be used, otherwise (if all descendants > are > movable) ALL. Hence I only added a `bool force' parameter. But I can > change that, if you think, that other variant is better. No, I think having the bool is fine. I agree, I don't really think IGNORE would be used in general. > > > Finally there's BPartition::ValidateMove(), which is a bit tricky. > > > I > > > think, it would be quite difficult to try to negotiate a value > > > that > > > all > > > affected disk systems are happy with. So I would only try to fine > > > a > > > value acceptable for the partitioning system responsible for the > > > partition in question and its contained disk system, and fail > > > after > > > one > > > or two unsuccessful iterations. For the descendants I would only > > > ask, > > > if they are OK with the new value and just fail, if any of them is > > > not. > > > > Sounds fair. We could always try something more thorough if we ever > > find ourselves with lots of free time on our hands. :-) > > Hehe, if that will ever happen... ;-) Any day now... :-) -Tyler