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

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

 



Hi Alan,

>> +     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.

   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.
   
   The code in earlier version is also set to default value 9:
            num_sectors = size >> 9;	/* File size in 512-byte blocks */
	    min_sectors = 1;
            if (curlun->cdrom) {
        		num_sectors &= ~3;	/* Reduce to a multiple of 2048 */
        		min_sectors = 300*4;	/* Smallest track is 300 frames */
   So I think we should set l_blkbits to 9 for cdrom.

   Do you have any suggestions?


> Alan Stern

- Xianglong

Member of the CSR plc group of companies. CSR plc registered in England and Wales, registered number 4187346, registered office Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, United Kingdom
More information can be found at www.csr.com. Follow CSR on Twitter at http://twitter.com/CSR_PLC and read our blog at www.csr.com/blog
?頨{.n?????%??橆??w?{.n???{殺???緡w*jg炳????▏?拷G??98夸:+v??鋟喓???茶庫全??ㄑ搬?????


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

  Powered by Linux