Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F146422683
D2724.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D2724.diff
View Options
Index: head/sys/vm/vm_object.c
===================================================================
--- head/sys/vm/vm_object.c
+++ head/sys/vm/vm_object.c
@@ -2306,16 +2306,28 @@
}
}
+/*
+ * Return the vnode for the given object, or NULL if none exists.
+ * For tmpfs objects, the function may return NULL if there is
+ * no vnode allocated at the time of the call.
+ */
struct vnode *
vm_object_vnode(vm_object_t object)
{
+ struct vnode *vp;
VM_OBJECT_ASSERT_LOCKED(object);
- if (object->type == OBJT_VNODE)
- return (object->handle);
- if (object->type == OBJT_SWAP && (object->flags & OBJ_TMPFS) != 0)
- return (object->un_pager.swp.swp_tmpfs);
- return (NULL);
+ if (object->type == OBJT_VNODE) {
+ vp = object->handle;
+ KASSERT(vp != NULL, ("%s: OBJT_VNODE has no vnode", __func__));
+ } else if (object->type == OBJT_SWAP &&
+ (object->flags & OBJ_TMPFS) != 0) {
+ vp = object->un_pager.swp.swp_tmpfs;
+ KASSERT(vp != NULL, ("%s: OBJT_TMPFS has no vnode", __func__));
+ } else {
+ vp = NULL;
+ }
+ return (vp);
}
static int
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Mar 3, 2:04 PM (18 h, 54 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
29201993
Default Alt Text
D2724.diff (1 KB)
Attached To
Mode
D2724: Include path for tmpfs objects in vm.objects sysctl
Attached
Detach File
Event Timeline
Log In to Comment