mm: fix exec activate_mm vs TLB shootdown and lazy tlb switching race
[linux/fpc-iii.git] / fs / udf / udfend.h
bloba4363ac2cfeb89ee118f3425bd27501919f5434c
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef __UDF_ENDIAN_H
3 #define __UDF_ENDIAN_H
5 #include <asm/byteorder.h>
6 #include <linux/string.h>
8 static inline struct kernel_lb_addr lelb_to_cpu(struct lb_addr in)
10 struct kernel_lb_addr out;
12 out.logicalBlockNum = le32_to_cpu(in.logicalBlockNum);
13 out.partitionReferenceNum = le16_to_cpu(in.partitionReferenceNum);
15 return out;
18 static inline struct lb_addr cpu_to_lelb(struct kernel_lb_addr in)
20 struct lb_addr out;
22 out.logicalBlockNum = cpu_to_le32(in.logicalBlockNum);
23 out.partitionReferenceNum = cpu_to_le16(in.partitionReferenceNum);
25 return out;
28 static inline struct short_ad lesa_to_cpu(struct short_ad in)
30 struct short_ad out;
32 out.extLength = le32_to_cpu(in.extLength);
33 out.extPosition = le32_to_cpu(in.extPosition);
35 return out;
38 static inline struct short_ad cpu_to_lesa(struct short_ad in)
40 struct short_ad out;
42 out.extLength = cpu_to_le32(in.extLength);
43 out.extPosition = cpu_to_le32(in.extPosition);
45 return out;
48 static inline struct kernel_long_ad lela_to_cpu(struct long_ad in)
50 struct kernel_long_ad out;
52 out.extLength = le32_to_cpu(in.extLength);
53 out.extLocation = lelb_to_cpu(in.extLocation);
55 return out;
58 static inline struct long_ad cpu_to_lela(struct kernel_long_ad in)
60 struct long_ad out;
62 out.extLength = cpu_to_le32(in.extLength);
63 out.extLocation = cpu_to_lelb(in.extLocation);
65 return out;
68 static inline struct kernel_extent_ad leea_to_cpu(struct extent_ad in)
70 struct kernel_extent_ad out;
72 out.extLength = le32_to_cpu(in.extLength);
73 out.extLocation = le32_to_cpu(in.extLocation);
75 return out;
78 #endif /* __UDF_ENDIAN_H */