aboutsummaryrefslogtreecommitdiff
path: root/stand/libsa/ufs.c
diff options
context:
space:
mode:
authorKirk McKusick <mckusick@FreeBSD.org>2020-06-19 01:02:53 +0000
committerKirk McKusick <mckusick@FreeBSD.org>2020-06-19 01:02:53 +0000
commit34816cb9aeca7b0ad3289c2de04cad0cd1b111ed (patch)
treedbd015863000afa619bfa39c47b28ff33045c0e1 /stand/libsa/ufs.c
parent349eddbd07d112698c5c6e51a3e8126759f651a6 (diff)
downloadsrc-34816cb9aeca7b0ad3289c2de04cad0cd1b111ed.tar.gz
src-34816cb9aeca7b0ad3289c2de04cad0cd1b111ed.zip
Move the pointers stored in the superblock into a separate
fs_summary_info structure. This change was originally done by the CheriBSD project as they need larger pointers that do not fit in the existing superblock. This cleanup of the superblock eases the task of the commit that immediately follows this one. Suggested by: brooks Reviewed by: kib PR: 246983 Sponsored by: Netflix
Notes
Notes: svn path=/head/; revision=362358
Diffstat (limited to 'stand/libsa/ufs.c')
-rw-r--r--stand/libsa/ufs.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/stand/libsa/ufs.c b/stand/libsa/ufs.c
index 317d6e9fdb1c..02d13aa29722 100644
--- a/stand/libsa/ufs.c
+++ b/stand/libsa/ufs.c
@@ -678,7 +678,11 @@ out:
if (rc) {
if (fp->f_buf)
free(fp->f_buf);
- free(fp->f_fs);
+ if (fp->f_fs != NULL) {
+ free(fp->f_fs->fs_csp);
+ free(fp->f_fs->fs_si);
+ free(fp->f_fs);
+ }
free(fp);
}
return (rc);
@@ -723,7 +727,11 @@ ufs_close(f)
}
if (fp->f_buf)
free(fp->f_buf);
- free(fp->f_fs);
+ if (fp->f_fs != NULL) {
+ free(fp->f_fs->fs_csp);
+ free(fp->f_fs->fs_si);
+ free(fp->f_fs);
+ }
free(fp);
return (0);
}