Problem with mounting a device second time.
ali nasir
supremenasir at yahoo.com
Thu Apr 19 11:09:02 UTC 2012
Hi,
Here is the output before the call to ioctl:
ff:ffffffff P /dev/rda UC=4294967293 BB=0 BC=4000 BS=512 MBS=512
00000001:00000000 P /dev/nvda UC=4294967293 BB=0 BC=637 BS=512 MBS=512
00000004:00000000 P /dev/fdda UC=1 BB=0 BC=1504 BS=512 MBS=512
00000005:00000000 P /dev/sdc0 UC=2 BB=0 BC=3862528 BS=512 MBS=512
00000007:00000000 L /dev/sdc01 UC=2 BB=135 BC=3858489 BS=512 MBS=512
Here is the output after the call to the ioctl.
ffffffff:ffffffff P /dev/rda UC=4294967293 BB=0 BC=4000 BS=512 MBS=512
00000001:00000000 P /dev/nvda UC=4294967293 BB=0 BC=637 BS=512 MBS=512
00000004:00000000 P /dev/fdda UC=1 BB=0 BC=1504 BS=512 MBS=512
00000005:00000000 P /dev/sdc0 UC=2 BB=0 BC=3862528 BS=512 MBS=512
00000007:00000000 L /dev/sdc01 UC=3 BB=135 BC=3858489 BS=512 MBS=512
The UC for /dev/sdc01 has increased by one. This only happens if i call the ioctl for the SYNCDEV. Any idea what could i be missing?
Regards,
Ali
------------------------------
On Thu 19 Apr, 2012 1:07 PM IST Sebastian Huber wrote:
>On 04/19/2012 09:15 AM, ali nasir wrote:
>> 1. Before calling the ioctl, we ensure that all the files are closed using the fclose.
>
>Ok.
>
>> 2. If we do the ioctl, the unmount() is still succesfull.
>
>Good.
>
>> 3. How do i find the remaining user of the disk? Is there a struct where i can see something?
>
>Please have a look at the following code:
>
>#include <rtems.h>
>#include <rtems/diskdevs.h>
>#include <rtems/shell.h>
>
>static int do_bdls(int argc, char **argv)
>{
> rtems_status_code sc = RTEMS_SUCCESSFUL;
> dev_t dev = (dev_t) -1;
> rtems_disk_device *dd = NULL;
>
> while (sc == RTEMS_SUCCESSFUL && (dd = rtems_disk_next(dev)) != NULL) {
> printf(
> "%08" PRIx32 ":%08" PRIx32 " %c %s UC=%u BB=%" PRIu32 " BC=%" PRIu32 " BS=%" PRIu32 " MBS=%" PRIu32 "\n",
> rtems_filesystem_dev_major_t(dev),
> rtems_filesystem_dev_minor_t(dev),
> dd->phys_dev == dd ? 'P' : 'L',
> dd->name,
> dd->uses,
> dd->start,
> dd->size,
> dd->block_size,
> dd->media_block_size
> );
> dev = rtems_disk_get_device_identifier(dd);
> sc = rtems_disk_release(dd);
> }
>
> return 0;
>}
>
>static rtems_shell_cmd_t bdls_command = {
> "bdls",
> "bdls",
> "bsp",
> do_bdls,
> NULL,
> NULL
>};
>
>You can call do_bdls() before and after the ioctl and watch the usage count 'UC=???'.
>
>-- Sebastian Huber, embedded brains GmbH
>
>Address : Obere Lagerstr. 30, D-82178 Puchheim, Germany
>Phone : +49 89 18 90 80 79-6
>Fax : +49 89 18 90 80 79-9
>E-Mail : sebastian.huber at embedded-brains.de
>PGP : Public key available on request.
>
>Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.
>_______________________________________________
>rtems-users mailing list
>rtems-users at rtems.org
>http://www.rtems.org/mailman/listinfo/rtems-users
More information about the users
mailing list