Re: [PATCH 1/2] libiscsi, iser: Adjust data_length to include protection information

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

 



On 06/01/2014 11:19 AM, Sagi Grimberg wrote:
>  
> +/*
> + * data integrity helpers
> + */
> +static inline unsigned
> +iscsi_prot_len(unsigned data_len, unsigned sector_size)
> +{
> +	switch (sector_size) {
> +	case 512:
> +		return (data_len >> 9) * 8;
> +	case 1024:
> +		return (data_len >> 10) * 8;
> +	case 2048:
> +		return (data_len >> 11) * 8;
> +	case 4096:
> +		return (data_len >> 12) * 8;
> +	default:
> +		return (data_len >> ilog2(sector_size)) * 8;
> +	}
> +}
>  #endif

I do not think this should not be in the iscsi code.

--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux