Lines Matching refs:disk
51 cgballoc(struct uufsd *disk) in cgballoc() argument
58 fs = &disk->d_fs; in cgballoc()
59 cgp = &disk->d_cg; in cgballoc()
76 cgbfree(struct uufsd *disk, ufs2_daddr_t bno, long size) in cgbfree() argument
84 fs = &disk->d_fs; in cgbfree()
86 if (cgread1(disk, cg) != 1) in cgbfree()
88 cgp = &disk->d_cg; in cgbfree()
133 return cgwrite(disk); in cgbfree()
137 cgialloc(struct uufsd *disk) in cgialloc() argument
146 fs = &disk->d_fs; in cgialloc()
147 cgp = &disk->d_cg; in cgialloc()
164 if (bwrite(disk, ino_to_fsba(fs, in cgialloc()
182 cgread(struct uufsd *disk) in cgread() argument
185 if (disk->d_ccg >= disk->d_fs.fs_ncg) in cgread()
187 return (cgread1(disk, disk->d_ccg++)); in cgread()
194 cgread1(struct uufsd *disk, int c) in cgread1() argument
197 if (cgget(disk->d_fd, &disk->d_fs, c, &disk->d_cg) == 0) { in cgread1()
198 disk->d_lcg = c; in cgread1()
201 ERROR(disk, NULL); in cgread1()
203 ERROR(disk, failmsg); in cgread1()
208 ERROR(disk, "cylinder group checks failed"); in cgread1()
211 ERROR(disk, "read error from block device"); in cgread1()
214 ERROR(disk, strerror(errno)); in cgread1()
256 cgwrite(struct uufsd *disk) in cgwrite() argument
259 return (cgwrite1(disk, disk->d_cg.cg_cgx)); in cgwrite()
263 cgwrite1(struct uufsd *disk, int cg) in cgwrite1() argument
267 if (cg == disk->d_cg.cg_cgx) { in cgwrite1()
268 if (ufs_disk_write(disk) == -1) { in cgwrite1()
269 ERROR(disk, "failed to open disk for writing"); in cgwrite1()
272 if (cgput(disk->d_fd, &disk->d_fs, &disk->d_cg) == 0) in cgwrite1()
274 ERROR(disk, NULL); in cgwrite1()
276 ERROR(disk, failmsg); in cgwrite1()
281 ERROR(disk, "unable to write cylinder group"); in cgwrite1()
284 ERROR(disk, strerror(errno)); in cgwrite1()
291 disk->d_cg.cg_cgx, cg); in cgwrite1()
292 ERROR(disk, errmsg); in cgwrite1()