Lines Matching refs:disk
51 sbread(struct uufsd *disk)
59 ERROR(disk, NULL);
61 fs = &disk->d_fs;
65 if (bread(disk, superblock, disk->d_sb, SBLOCKSIZE) == -1) {
66 ERROR(disk, "non-existent or truncated superblock");
70 disk->d_ufs = 1;
73 disk->d_ufs = 2;
76 if (disk->d_ufs)
79 disk->d_ufs = 0;
81 if (superblock == -1 || disk->d_ufs == 0) {
85 * which to associate this disk/filesystem.
87 ERROR(disk, "no usable known superblock found");
91 disk->d_bsize = fs->fs_fsize / fsbtodb(fs, 1);
92 disk->d_sblock = superblock / disk->d_bsize;
101 ERROR(disk, "failed to allocate space for summary information");
109 if (bread(disk, fsbtodb(fs, fs->fs_csaddr + i), block, size)
111 ERROR(disk, "Failed to read sb summary information");
119 disk->d_sbcsum = fs->fs_csp;
125 sbwrite(struct uufsd *disk, int all)
132 ERROR(disk, NULL);
134 fs = &disk->d_fs;
136 if (!disk->d_sblock) {
137 disk->d_sblock = disk->d_fs.fs_sblockloc / disk->d_bsize;
140 if (bwrite(disk, disk->d_sblock, fs, SBLOCKSIZE) == -1) {
141 ERROR(disk, "failed to write superblock");
148 space = (uint8_t *)disk->d_sbcsum;
153 if (bwrite(disk, fsbtodb(fs, fs->fs_csaddr + i), space, size)
155 ERROR(disk, "Failed to write sb summary information");
162 if (bwrite(disk, fsbtodb(fs, cgsblock(fs, i)),
164 ERROR(disk, "failed to update a superblock");