Lines Matching refs:lim
105 static void sd_config_discard(struct scsi_disk *sdkp, struct queue_limits *lim,
108 struct queue_limits *lim);
125 struct queue_limits *lim) in sd_set_flush_flag() argument
128 lim->features |= BLK_FEAT_WRITE_CACHE; in sd_set_flush_flag()
130 lim->features |= BLK_FEAT_FUA; in sd_set_flush_flag()
132 lim->features &= ~BLK_FEAT_FUA; in sd_set_flush_flag()
134 lim->features &= ~(BLK_FEAT_WRITE_CACHE | BLK_FEAT_FUA); in sd_set_flush_flag()
173 struct queue_limits lim; in cache_type_store() local
178 lim = queue_limits_start_update(sdkp->disk->queue); in cache_type_store()
179 sd_set_flush_flag(sdkp, &lim); in cache_type_store()
181 ret = queue_limits_commit_update(sdkp->disk->queue, &lim); in cache_type_store()
471 struct queue_limits lim; in provisioning_mode_store() local
484 lim = queue_limits_start_update(sdkp->disk->queue); in provisioning_mode_store()
485 sd_config_discard(sdkp, &lim, mode); in provisioning_mode_store()
487 err = queue_limits_commit_update(sdkp->disk->queue, &lim); in provisioning_mode_store()
573 struct queue_limits lim; in max_write_same_blocks_store() local
595 lim = queue_limits_start_update(sdkp->disk->queue); in max_write_same_blocks_store()
596 sd_config_write_same(sdkp, &lim); in max_write_same_blocks_store()
598 err = queue_limits_commit_update(sdkp->disk->queue, &lim); in max_write_same_blocks_store()
850 static void sd_config_discard(struct scsi_disk *sdkp, struct queue_limits *lim, in sd_config_discard() argument
856 lim->discard_alignment = sdkp->unmap_alignment * logical_block_size; in sd_config_discard()
857 lim->discard_granularity = max(sdkp->physical_block_size, in sd_config_discard()
896 lim->max_hw_discard_sectors = max_blocks * in sd_config_discard()
943 static void sd_config_atomic(struct scsi_disk *sdkp, struct queue_limits *lim) in sd_config_atomic() argument
995 lim->atomic_write_hw_max = max_atomic * logical_block_size; in sd_config_atomic()
996 lim->atomic_write_hw_boundary = 0; in sd_config_atomic()
997 lim->atomic_write_hw_unit_min = unit_min * logical_block_size; in sd_config_atomic()
998 lim->atomic_write_hw_unit_max = unit_max * logical_block_size; in sd_config_atomic()
1091 struct queue_limits *lim) in sd_config_write_same() argument
1146 lim->max_write_zeroes_sectors = in sd_config_write_same()
2577 struct queue_limits *lim) in sd_config_protection() argument
2582 sd_dif_config_host(sdkp, lim); in sd_config_protection()
2631 struct queue_limits *lim, unsigned char *buffer) in read_capacity_16() argument
2705 lim->alignment_offset = alignment; in read_capacity_16()
2817 sd_read_capacity(struct scsi_disk *sdkp, struct queue_limits *lim, in sd_read_capacity() argument
2824 sector_size = read_capacity_16(sdkp, sdp, lim, buffer); in sd_read_capacity()
2844 sector_size = read_capacity_16(sdkp, sdp, lim, buffer); in sd_read_capacity()
2903 lim->logical_block_size = sector_size; in sd_read_capacity()
2904 lim->physical_block_size = sdkp->physical_block_size; in sd_read_capacity()
3336 struct queue_limits *lim) in sd_read_block_limits() argument
3377 sd_config_atomic(sdkp, lim); in sd_read_block_limits()
3398 struct queue_limits *lim) in sd_read_block_characteristics() argument
3416 lim->features &= ~(BLK_FEAT_ROTATIONAL | BLK_FEAT_ADD_RANDOM); in sd_read_block_characteristics()
3703 struct queue_limits lim; in sd_revalidate_disk() local
3727 lim = queue_limits_start_update(sdkp->disk->queue); in sd_revalidate_disk()
3734 sd_read_capacity(sdkp, &lim, buffer); in sd_revalidate_disk()
3748 lim.features |= (BLK_FEAT_ROTATIONAL | BLK_FEAT_ADD_RANDOM); in sd_revalidate_disk()
3752 sd_read_block_limits(sdkp, &lim); in sd_revalidate_disk()
3754 sd_read_block_characteristics(sdkp, &lim); in sd_revalidate_disk()
3755 sd_zbc_read_zones(sdkp, &lim, buffer); in sd_revalidate_disk()
3758 sd_config_discard(sdkp, &lim, sd_discard_mode(sdkp)); in sd_revalidate_disk()
3768 sd_config_protection(sdkp, &lim); in sd_revalidate_disk()
3775 sd_set_flush_flag(sdkp, &lim); in sd_revalidate_disk()
3782 lim.max_dev_sectors = logical_to_sectors(sdp, dev_max); in sd_revalidate_disk()
3785 lim.io_min = logical_to_bytes(sdp, sdkp->min_xfer_blocks); in sd_revalidate_disk()
3787 lim.io_min = 0; in sd_revalidate_disk()
3794 lim.io_opt = sdp->host->opt_sectors << SECTOR_SHIFT; in sd_revalidate_disk()
3796 lim.io_opt = min_not_zero(lim.io_opt, in sd_revalidate_disk()
3803 sd_config_write_same(sdkp, &lim); in sd_revalidate_disk()
3807 err = queue_limits_commit_update(sdkp->disk->queue, &lim); in sd_revalidate_disk()