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.
Details
mount -t tmpfs tmpfs /tmpfs
cp /bin/sh /tmpfs
/tmpfs/sh
vmstat -o | grep ' /tmpfs'
Diff Detail
- Lint
Lint Passed - Unit
No Test Coverage - Build Status
Buildable 20899 Build 20267: arc lint + arc unit
Event Timeline
sys/vm/vm_object.c | ||
---|---|---|
2383 | 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. |
Reviving a review from 3.5 years ago, thanks to a reminder from @emaste...
sys/vm/vm_object.c | ||
---|---|---|
2383 | (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. |
sys/vm/vm_object.c | ||
---|---|---|
2331 | This assertions and comment for vm_object_vnode() should be committed separately. |