Source
static inline unsigned int logical_to_bytes(struct scsi_device *sdev, sector_t blocks)
/* SPDX-License-Identifier: GPL-2.0 */
/*
* More than enough for everybody ;) The huge number of majors
* is a leftover from 16bit dev_t days, we don't really need that
* much numberspace.
*/
/*
* Time out in seconds for disks and Magneto-opticals (which are slower).
*/
/*
* Flush timeout is a multiplier over the standard device timeout which is
* user modifiable via sysfs but initially set to SD_TIMEOUT
*/
/*
* Number of allowed retries
*/
/*
* Size of the initial data buffer for mode and read capacity data
*/
/*
* Number of sectors at the end of the device to avoid multi-sector
* accesses to in the case of last_sector_bug
*/
enum {
SD_EXT_CDB_SIZE = 32, /* Extended CDB size */
SD_MEMPOOL_SIZE = 2, /* CDB pool size */
};
enum {
SD_DEF_XFER_BLOCKS = 0xffff,
SD_MAX_XFER_BLOCKS = 0xffffffff,
SD_MAX_WS10_BLOCKS = 0xffff,
SD_MAX_WS16_BLOCKS = 0x7fffff,
};
enum {
SD_LBP_FULL = 0, /* Full logical block provisioning */
SD_LBP_UNMAP, /* Use UNMAP command */
SD_LBP_WS16, /* Use WRITE SAME(16) with UNMAP bit */
SD_LBP_WS10, /* Use WRITE SAME(10) with UNMAP bit */
SD_LBP_ZERO, /* Use WRITE SAME(10) with zero payload */
SD_LBP_DISABLE, /* Discard disabled due to failed cmd */
};
enum {