Project

General

Profile

Actions

Bug #81

closed

remove 'is_z_a_power_of_x_le_y' from pcfs utils

Added by John Doe over 11 years ago. Updated over 10 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
cmd - userland programs
Start date:
2010-08-23
Due date:
% Done:

0%

Estimated time:
Difficulty:
Bite-size
Tags:
needs-triage
Gerrit CR:

Description

This piece in cmd/fs.d/pcfs/fsck/pcfs_common.c:

69 int 
70 is_z_a_power_of_x_le_y(int x, int y, int z)
71 {
72 int ispower = 0;
73 int pow = 1;
74
75 do {
76 if (pow == z) {
77 ispower = 1;
78 break;
79 }
80 pow *= x;
81 } while (pow <= y);
82
83 return (ispower);
84 }

is embarrassing, given that the ISP2 macro from <sys/sysmacros.h> is ancient, and that the above function is used in exactly one place only, in cmd/fs.d/pcfs/fsck/bpb.c, to check against a power of two ...

Dump the cruft. Recording this here as memory backup.
What about powerofx_le_y() in mkfs.c? Can that also die?
Thanks for spotting. The two files appear to originate from the same cut&pasted source, they share a lot including the cruft.

What do you think about fsck/inject.c ? Dump it completely in favour of doing such things with DTrace ?
I don't think that would be appropriate; DTrace really isn't intended
to be a fault injection framework.

Actions

Also available in: Atom PDF