Skip to content

Commit

Permalink
attempt to lock bd during subsequent mount operations
Browse files Browse the repository at this point in the history
  • Loading branch information
KrahJohlito committed Sep 21, 2024
1 parent ece2982 commit b703320
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions modules/iopcore/cdvdman/device-bdm.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,20 @@ void bdm_connect_bd(struct block_device *bd)
{
DPRINTF("connecting device %s%dp%d\n", bd->name, bd->devNr, bd->parNr);

// lock when performing additional device mount operations
if (g_bd != NULL)
WaitSema(bdm_io_sema);

if (g_bd == NULL && bd->devNr == cdvdman_settings.bdDeviceId) {
DPRINTF("attaching to %s%dp%d\n", bd->name, bd->devNr, bd->parNr);
g_bd = bd;
g_bd_sectors_per_sector = (2048 / bd->sectorSize);
// Free usage of block device
SignalSema(bdm_io_sema);
}

if (g_bd != NULL && g_bd != bd)
SignalSema(bdm_io_sema);
}

void bdm_disconnect_bd(struct block_device *bd)
Expand Down

0 comments on commit b703320

Please sign in to comment.