aboutsummaryrefslogtreecommitdiff
path: root/lib/libufs/type.c
diff options
context:
space:
mode:
authorJuli Mallett <jmallett@FreeBSD.org>2003-01-23 21:32:56 +0000
committerJuli Mallett <jmallett@FreeBSD.org>2003-01-23 21:32:56 +0000
commitd934deeff98d3d201cf2a3a015fdd447019762cc (patch)
tree6eb6853728a2a0d0fab5107f2f3030b022c1a9a9 /lib/libufs/type.c
parente0c2da42ecff6f4cfa4c677fa99b3b30ff7ffe5e (diff)
downloadsrc-d934deeff98d3d201cf2a3a015fdd447019762cc.tar.gz
src-d934deeff98d3d201cf2a3a015fdd447019762cc.zip
API to fillout a blank disk. For e.g. newfs.
Notes
Notes: svn path=/head/; revision=109755
Diffstat (limited to 'lib/libufs/type.c')
-rw-r--r--lib/libufs/type.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/lib/libufs/type.c b/lib/libufs/type.c
index 4b8066ce2e3a..41eacfd6a977 100644
--- a/lib/libufs/type.c
+++ b/lib/libufs/type.c
@@ -111,6 +111,18 @@ ufs_disk_close(struct uufsd *disk)
int
ufs_disk_fillout(struct uufsd *disk, const char *name)
{
+ if (ufs_disk_fillout_blank(disk, name) == -1) {
+ return -1;
+ }
+ if (sbread(disk) == -1) {
+ ERROR(disk, "could not read superblock to fill out disk");
+ return -1;
+ }
+}
+
+int
+ufs_disk_fillout_blank(struct uufsd *disk, const char *name)
+{
struct stat st;
struct fstab *fs;
const char *oname;
@@ -161,10 +173,5 @@ again: if (stat(name, &st) < 0) {
}
disk->d_name = name;
- if (sbread(disk) == -1) {
- ERROR(disk, "could not read superblock to fill out disk");
- return -1;
- }
-
return 0;
}