aboutsummaryrefslogtreecommitdiff
path: root/lib/libufs/cgroup.c
diff options
context:
space:
mode:
authorPawel Jakub Dawidek <pjd@FreeBSD.org>2006-10-31 21:21:48 +0000
committerPawel Jakub Dawidek <pjd@FreeBSD.org>2006-10-31 21:21:48 +0000
commitcf4652e74b0f8e112f0bfbb32af44e6e233c546a (patch)
treeacdaac6c56590c6a8eda8da3cf77f486f7819343 /lib/libufs/cgroup.c
parent9cd394ea9657da13e9bceeadb5d18ec743c77fc5 (diff)
downloadsrc-cf4652e74b0f8e112f0bfbb32af44e6e233c546a.tar.gz
src-cf4652e74b0f8e112f0bfbb32af44e6e233c546a.zip
Implement cgwrite1(3) function which stored a given cylinder group on disk.
Sponsored by: home.pl
Notes
Notes: svn path=/head/; revision=163835
Diffstat (limited to 'lib/libufs/cgroup.c')
-rw-r--r--lib/libufs/cgroup.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/libufs/cgroup.c b/lib/libufs/cgroup.c
index d615b18dd32b..2185682e098f 100644
--- a/lib/libufs/cgroup.c
+++ b/lib/libufs/cgroup.c
@@ -71,3 +71,17 @@ cgread1(struct uufsd *disk, int c)
disk->d_lcg = c;
return (1);
}
+
+int
+cgwrite1(struct uufsd *disk, int c)
+{
+ struct fs *fs;
+
+ fs = &disk->d_fs;
+ if (bwrite(disk, fsbtodb(fs, cgtod(fs, c)),
+ disk->d_cgunion.d_buf, fs->fs_bsize) == -1) {
+ ERROR(disk, "unable to write cylinder group");
+ return (-1);
+ }
+ return (0);
+}