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:
Juli Mallett 2003-01-27 01:57:15 +00:00
parent 75741c0497
commit fe8b86a06d

View File

@ -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;