OpenSolaris

Printable Version Enter a New Search
Bug ID 6458839
Synopsis remove 'is_z_a_power_of_x_le_y' from pcfs utils
State 1-Dispatched (Default State)
Category:Subcategory utility:filesystem
Keywords oss-bite-size | oss-request | swill
Sponsor
Submitter
Reported Against
Duplicate Of
Introduced In
Commit to Fix
Fixed In
Release Fixed
Related Bugs 6582028
Submit Date 10-August-2006
Last Update Date 3-December-2007
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.
Work Around
N/A
Comments
N/A