Skip the allocation of the root hold token if the mount already happened.
This commit is contained in:
parent
393cf853a7
commit
d24d45d9a9
@ -1357,6 +1357,9 @@ root_mount_hold(const char *identifier)
|
|||||||
{
|
{
|
||||||
struct root_hold_token *h;
|
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 | M_WAITOK);
|
||||||
h->who = identifier;
|
h->who = identifier;
|
||||||
mtx_lock(&mountlist_mtx);
|
mtx_lock(&mountlist_mtx);
|
||||||
@ -1372,6 +1375,8 @@ void
|
|||||||
root_mount_rel(struct root_hold_token *h)
|
root_mount_rel(struct root_hold_token *h)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
if (h == NULL)
|
||||||
|
return;
|
||||||
mtx_lock(&mountlist_mtx);
|
mtx_lock(&mountlist_mtx);
|
||||||
LIST_REMOVE(h, list);
|
LIST_REMOVE(h, list);
|
||||||
wakeup(&root_holds);
|
wakeup(&root_holds);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user