Page MenuHomeFreeBSD

Include path for tmpfs objects in vm.objects sysctl
ClosedPublic

Authored by vangyzen on Jun 3 2015, 12:17 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Nov 17, 1:39 PM
Unknown Object (File)
Sun, Nov 17, 12:43 PM
Unknown Object (File)
Sep 26 2024, 11:36 PM
Unknown Object (File)
Sep 19 2024, 12:33 PM
Unknown Object (File)
Sep 19 2024, 8:58 AM
Unknown Object (File)
Sep 10 2024, 8:20 AM
Unknown Object (File)
Sep 2 2024, 10:32 PM
Unknown Object (File)
Sep 2 2024, 3:33 AM

Details

Summary

This applies the fix in r283924 to the vm.objects sysctl
added by r283624 so the output will include the vnode
information (i.e. path) for tmpfs objects.

Test Plan

mount -t tmpfs tmpfs /tmpfs
cp /bin/sh /tmpfs
/tmpfs/sh
vmstat -o | grep ' /tmpfs'

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

vangyzen retitled this revision from to Include path for tmpfs objects in vm.objects sysctl.
vangyzen updated this object.
vangyzen edited the test plan for this revision. (Show Details)
vangyzen added reviewers: jhb, kib.
sys/vm/vm_object.c
2322 ↗(On Diff #5909)

Probably an assertion is due that if vpp != NULL, *vpp is not NULL.

In fact, I would structure the code somewhat different. I would first check object->type == OBJT_VNODE || object->type == OBJT_SWAP && ... TMPFS_NODE) with the plain if. In the body of the if() then block, the vm_object_vnode() call would happen and KASSERT(), return. Then the switch for other object types would follow.

Also, if you set *vpp to NULL after the if, callers would not need to nullify the argument. This sounds less error-prone.

vangyzen edited the summary of this revision. (Show Details)
  • Include path for tmpfs objects in vm.objects sysctl
  • add assertion suggested by kib

Reviving a review from 3.5 years ago, thanks to a reminder from @emaste...

sys/vm/vm_object.c
2322 ↗(On Diff #5909)

(This comment was previously against line 2348.)

Since the assertion is on the return value of vm_object_vnode, I put it in that function. Also, *vpp is always set, so callers don't need to initialize. Thanks for those suggestions.

This revision is now accepted and ready to land.Nov 19 2018, 10:31 PM
kib added inline comments.
sys/vm/vm_object.c
2331 ↗(On Diff #50615)

This assertions and comment for vm_object_vnode() should be committed separately.

This revision was automatically updated to reflect the committed changes.