[parted-devel] mklabel & mkfs warning

Håkon Løvdal hlovdal at gmail.com
Thu Nov 30 12:09:30 CET 2006


On 29/11/06, Otavio Salvador <otavio at debian.org> wrote:
> > From: Debarshi Ray <rishi at gnu.org>
> > Date: Thu, 30 Nov 2006 08:09:08 +0530
> > Subject: Cleanup _partition_warn_busy, _disk_warn_busy, _partition_warn_loss and _disk_warn_loss.
>
> I ack the patch. Does anybody has any comment on it? Otherwise I'll
> commit it.

Could we please also do something with the names of these warn functions
as well?  Currently I think the names are not obvious, for instance

	if (!_partition_warn_busy (src))
		goto error_destroy_disk;

Does this code mean destroy disk if parted has not warned about the
partition being busy?

Of course I understand what the function does from my understanding of
the expected behaviour of the parted program, but preferably the function
name should speak for itself.

I have no strong oppinion of what would be the best names, but probably
something like the following:

	if (!_ok_warn_partition_busy (src))
		goto error_destroy_disk;

	if (!_partition_busy_warning_accepted (src))
		goto error_destroy_disk;

	if (!_partition_busy_warning_ignored (src))
		goto error_destroy_disk;

Other suggestions? I think I prefer the first one for being both
simple and clear.

BR Håkon Løvdal


More information about the parted-devel mailing list