aboutsummaryrefslogtreecommitdiff
path: root/lib/libufs/sblock.c
diff options
context:
space:
mode:
authorJuli Mallett <jmallett@FreeBSD.org>2003-01-27 01:57:15 +0000
committerJuli Mallett <jmallett@FreeBSD.org>2003-01-27 01:57:15 +0000
commitfe8b86a06d78f92e9a10cbe6ec132925d323c014 (patch)
tree4a7108f7b9b6bcaa390e9b87ff4b9d4371e343e1 /lib/libufs/sblock.c
parent75741c049747f5e8441b1006116a7dcbc8247e7c (diff)
downloadsrc-fe8b86a06d78f92e9a10cbe6ec132925d323c014.tar.gz
src-fe8b86a06d78f92e9a10cbe6ec132925d323c014.zip
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.
Notes
Notes: svn path=/head/; revision=109913
Diffstat (limited to 'lib/libufs/sblock.c')
-rw-r--r--lib/libufs/sblock.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/libufs/sblock.c b/lib/libufs/sblock.c
index d769edb29142..455fee0bcb77 100644
--- a/lib/libufs/sblock.c
+++ b/lib/libufs/sblock.c
@@ -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;