aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorKirk McKusick <mckusick@FreeBSD.org>2020-06-23 21:28:26 +0000
committerKirk McKusick <mckusick@FreeBSD.org>2020-06-23 21:28:26 +0000
commit92c839a156ba96c821e8b6c16892f583115b6d40 (patch)
tree55e44e30e4630c6dcd9deacb182d0803d0e069c5 /lib
parent7ac5cc13b53504d85d91d30c16fe0a5a950b2589 (diff)
downloadsrc-92c839a156ba96c821e8b6c16892f583115b6d40.tar.gz
src-92c839a156ba96c821e8b6c16892f583115b6d40.zip
The libufs library needs to track and free the new fs_si structure
in addition to the fs_csp structure that it references. PR: 247425 Sponsored by: Netflix
Notes
Notes: svn path=/head/; revision=362559
Diffstat (limited to 'lib')
-rw-r--r--lib/libufs/libufs.h2
-rw-r--r--lib/libufs/sblock.c2
-rw-r--r--lib/libufs/type.c9
3 files changed, 7 insertions, 6 deletions
diff --git a/lib/libufs/libufs.h b/lib/libufs/libufs.h
index c11c38c15f26..ad990bbc0930 100644
--- a/lib/libufs/libufs.h
+++ b/lib/libufs/libufs.h
@@ -49,7 +49,7 @@ struct uufsd {
int d_fd; /* raw device file descriptor */
long d_bsize; /* device bsize */
ufs2_daddr_t d_sblock; /* superblock location */
- struct csum *d_sbcsum; /* Superblock summary info */
+ struct fs_summary_info *d_si; /* Superblock summary info */
caddr_t d_inoblock; /* inode block */
uint32_t d_inomin; /* low ino, not ino_t for ABI compat */
uint32_t d_inomax; /* high ino, not ino_t for ABI compat */
diff --git a/lib/libufs/sblock.c b/lib/libufs/sblock.c
index 53c8d44f6d65..54e6234633e3 100644
--- a/lib/libufs/sblock.c
+++ b/lib/libufs/sblock.c
@@ -88,7 +88,7 @@ sbread(struct uufsd *disk)
disk->d_ufs = 2;
disk->d_bsize = fs->fs_fsize / fsbtodb(fs, 1);
disk->d_sblock = fs->fs_sblockloc / disk->d_bsize;
- disk->d_sbcsum = fs->fs_csp;
+ disk->d_si = fs->fs_si;
return (0);
}
diff --git a/lib/libufs/type.c b/lib/libufs/type.c
index bcbb1914c497..653ef8ceeea1 100644
--- a/lib/libufs/type.c
+++ b/lib/libufs/type.c
@@ -69,9 +69,10 @@ ufs_disk_close(struct uufsd *disk)
free((char *)(uintptr_t)disk->d_name);
disk->d_name = NULL;
}
- if (disk->d_sbcsum != NULL) {
- free(disk->d_sbcsum);
- disk->d_sbcsum = NULL;
+ if (disk->d_si != NULL) {
+ free(disk->d_si->si_csp);
+ free(disk->d_si);
+ disk->d_si = NULL;
}
return (0);
}
@@ -164,7 +165,7 @@ again: if ((ret = stat(name, &st)) < 0) {
disk->d_mine = 0;
disk->d_ufs = 0;
disk->d_error = NULL;
- disk->d_sbcsum = NULL;
+ disk->d_si = NULL;
if (oname != name) {
name = strdup(name);