path: root/lib/libufs/type.c
diff options
authorKirk McKusick <mckusick@FreeBSD.org>2022-07-25 01:10:39 +0000
committerKirk McKusick <mckusick@FreeBSD.org>2022-07-25 01:12:25 +0000
commit82e72f1d12fa8a3baaefe46509d9aa33406cbf4d (patch)
treef36eea2b4154ac7b6f79cba1ff9eecb6543b9856 /lib/libufs/type.c
parentbf24d17fda75cc89a92248715d52a73f23adc89c (diff)
Add d_sblockloc to libufs(3) disk structure to allow options to be added.
By making the disk block parameter used by the libufs(3) sbread(3) function visible, applications using sbread(3) can set their own addition options such as using the STDSB_NOHASHFAIL request to say that they want the superblock read to succeed even when the superblock checkhash is incorrect. While here also add an error message when a check-hash failure is detected.
Diffstat (limited to 'lib/libufs/type.c')
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/libufs/type.c b/lib/libufs/type.c
index a060f8ec5abf..ac5b8d17e84c 100644
--- a/lib/libufs/type.c
+++ b/lib/libufs/type.c
@@ -168,6 +168,7 @@ again: if ((ret = stat(name, &st)) < 0) {
disk->d_ufs = 0;
disk->d_error = NULL;
disk->d_si = NULL;
+ disk->d_sblockloc = STDSB;
if (oname != name) {
name = strdup(name);