nvmet.h (715a1284d89a740b197b3bad5eb20d36a397382f) nvmet.h (193fcf371f9e3705c14a0bf1d4bfc44af0f7c124)
1/* SPDX-License-Identifier: GPL-2.0 */
2/*
3 * Copyright (c) 2015-2016 HGST, a Western Digital Company.
4 */
5
6#ifndef _NVMET_H
7#define _NVMET_H
8

--- 589 unchanged lines hidden (view full) ---

598
599static inline bool nvmet_ns_has_pi(struct nvmet_ns *ns)
600{
601 if (!IS_ENABLED(CONFIG_BLK_DEV_INTEGRITY))
602 return false;
603 return ns->pi_type && ns->metadata_size == sizeof(struct t10_pi_tuple);
604}
605
1/* SPDX-License-Identifier: GPL-2.0 */
2/*
3 * Copyright (c) 2015-2016 HGST, a Western Digital Company.
4 */
5
6#ifndef _NVMET_H
7#define _NVMET_H
8

--- 589 unchanged lines hidden (view full) ---

598
599static inline bool nvmet_ns_has_pi(struct nvmet_ns *ns)
600{
601 if (!IS_ENABLED(CONFIG_BLK_DEV_INTEGRITY))
602 return false;
603 return ns->pi_type && ns->metadata_size == sizeof(struct t10_pi_tuple);
604}
605
606static inline __le64 nvmet_sect_to_lba(struct nvmet_ns *ns, sector_t sect)
607{
608 return cpu_to_le64(sect >> (ns->blksize_shift - SECTOR_SHIFT));
609}
610
611static inline sector_t nvmet_lba_to_sect(struct nvmet_ns *ns, __le64 lba)
612{
613 return le64_to_cpu(lba) << (ns->blksize_shift - SECTOR_SHIFT);
614}
615
606#endif /* _NVMET_H */
616#endif /* _NVMET_H */