Re: 答复: [PATCH] gadget: mass_storage: adapt logic block size to bound block devices

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



+ num_sectors = size >> curlun->l_blkbits; /* File size in logic-block-size blocks */
      min_sectors = 1;
     if (curlun->cdrom) {
num_sectors &= ~3; /* Reduce to a multiple of 2048 */

And as long as you're using variable logical block sizes, you might as
well set l_blkbits here to 11, because cdroms always use a block size
of 2048.

On Tue, 16 Aug 2011 12:09:23 +0200, Xianglong Du <Xianglong.Du@xxxxxxx> wrote:
   I've test cdrom as mass storage according to your suggestion:
            if (curlun->cdrom)
                      curlun->l_blkbits = 11;
   but it seems that the cdrom doesn't work:
FAT: logical sector size too small for device (logical sector size = 512)
   after set l_blkbits to 9 for cdrom, it works properly.

Shouldn't you be using ISO some-numbers fs (ie. CD-ROM file system) if you decide
to emulate a CD-ROM?

--
Best regards,                                         _     _
.o. | Liege of Serenely Enlightened Majesty of      o' \,=./ `o
..o | Computer Science,  Michal "mina86" Nazarewicz    (o o)
ooo +-----<email/xmpp: mnazarewicz@xxxxxxxxxx>-----ooO--(_)--Ooo--
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux