Page MenuHomeFreeBSD

Define M_UFSMNT in ffs_subr.c
Needs RevisionPublic

Authored by delphij on May 30 2020, 6:36 PM.

Details

Reviewers
mckusick
chs
Summary

Define M_UFSMNT in ffs_subr.c instead of ufs_vfsops.c.

This fixes build for kernels using GEOM_LABEL but not UFS.

Test Plan

build

Diff Detail

Repository
rS FreeBSD src repository
Lint
Lint OK
Unit
No Unit Test Coverage
Build Status
Buildable 31396
Build 29020: arc lint + arc unit

Event Timeline

delphij created this revision.May 30 2020, 6:36 PM
delphij requested review of this revision.May 30 2020, 6:36 PM
mckusick accepted this revision.Wed, Jun 24, 6:22 AM

This looks like a reasonable change to me.

Note that the files in the above diffs are a few revisions back from the head of the tree. Notably -r362292 moved a number of functions from ffs_subr.c to ffs_vfsops.c. But this change should still apply to the corresponding files at the head of tree.

This revision is now accepted and ready to land.Wed, Jun 24, 6:22 AM
chs added a comment.Wed, Jun 24, 5:05 PM

The intention is that ffs_subr.c should only contain functions that are shared by the ufs kernel module and the libufs userland library. At some point the geom_label kernel module started using ffs_subr.c too even though that is cross-module direct reference, which is problematic when not all of the modules are statically included in the base kernel. Now that I moved the functions which are only needed by the ufs kernel module elsewhere, geom_label's instance of ffs_subr.c no longer references M_UFSMNT, so this change is not necessary.

Moving the definition of M_UFSMNT to ffs_subr.c would result in two copies of M_UFSMNT in a system where UFS is not statically included in the base kernel but loaded as a module later, and I suspect that would cause problems.

Having read Chuck's argument, I agree with it. I was thinking that the g_label_ufs.c routines passed in M_UFSMNT as their malloc type. But they do not. They use M_GEOM malloc type. So there is no need for them to have an definition for M_UFSMNT.

mckusick requested changes to this revision.Tue, Jun 30, 6:25 PM

Per the above commentary, this change should be withdrawn.

This revision now requires changes to proceed.Tue, Jun 30, 6:25 PM