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)
Mar 4 2024, 7:45 AM
Unknown Object (File)
Mar 4 2024, 4:08 AM
Unknown Object (File)
Jan 12 2024, 9:32 PM
Unknown Object (File)
Jan 9 2024, 10:05 PM
Unknown Object (File)
Dec 22 2023, 9:12 PM
Unknown Object (File)
Nov 30 2023, 11:25 PM
Unknown Object (File)
Nov 22 2023, 12:11 PM
Unknown Object (File)
Oct 29 2023, 7:16 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.