If we don't know where the sblock is (e.g. filling out a blank disk), then
get it from the fs structure. Really libufs should have interfaces to generate both what we export, and what we import, based on eachother, and this should be full of redundant code to make sure everything is right... But really, we don't even deal with checksums, so plenty of room to improve.
This commit is contained in:
parent
75741c0497
commit
fe8b86a06d
@ -99,6 +99,10 @@ sbwrite(struct uufsd *disk, int all)
|
||||
|
||||
fs = &disk->d_fs;
|
||||
|
||||
if (!disk->d_sblock) {
|
||||
disk->d_sblock = disk->d_fs.fs_sblockloc / disk->d_bsize;
|
||||
}
|
||||
|
||||
if (bwrite(disk, disk->d_sblock, fs, SBLOCKSIZE) == -1) {
|
||||
ERROR(disk, "failed to write superblock");
|
||||
return -1;
|
||||
|
Loading…
x
Reference in New Issue
Block a user