summaryrefslogtreecommitdiffstats
path: root/sys/kern/vfs_mount.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/kern/vfs_mount.c')
-rw-r--r--sys/kern/vfs_mount.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/sys/kern/vfs_mount.c b/sys/kern/vfs_mount.c
index e4256c7..164eb12 100644
--- a/sys/kern/vfs_mount.c
+++ b/sys/kern/vfs_mount.c
@@ -1353,14 +1353,18 @@ static int root_mount_complete;
* Hold root mount.
*/
struct root_hold_token *
-root_mount_hold(const char *identifier)
+root_mount_hold(const char *identifier, int how)
{
struct root_hold_token *h;
if (root_mounted())
return (NULL);
- h = malloc(sizeof *h, M_DEVBUF, M_ZERO | M_WAITOK);
+ h = malloc(sizeof *h, M_DEVBUF, M_ZERO | how);
+ if (h == NULL) {
+ printf("Unable to alloc root hold token for %s\n", identifier);
+ return (NULL);
+ }
h->who = identifier;
mtx_lock(&mountlist_mtx);
LIST_INSERT_HEAD(&root_holds, h, list);
OpenPOWER on IntegriCloud