aboutsummaryrefslogtreecommitdiffstats
path: root/fs/udf/udfend.h
diff options
context:
space:
mode:
Diffstat (limited to 'fs/udf/udfend.h')
-rw-r--r--fs/udf/udfend.h20
1 files changed, 19 insertions, 1 deletions
diff --git a/fs/udf/udfend.h b/fs/udf/udfend.h
index 450daab35a13..c4bd1203f857 100644
--- a/fs/udf/udfend.h
+++ b/fs/udf/udfend.h
@@ -7,75 +7,93 @@
7static inline kernel_lb_addr lelb_to_cpu(lb_addr in) 7static inline kernel_lb_addr lelb_to_cpu(lb_addr in)
8{ 8{
9 kernel_lb_addr out; 9 kernel_lb_addr out;
10
10 out.logicalBlockNum = le32_to_cpu(in.logicalBlockNum); 11 out.logicalBlockNum = le32_to_cpu(in.logicalBlockNum);
11 out.partitionReferenceNum = le16_to_cpu(in.partitionReferenceNum); 12 out.partitionReferenceNum = le16_to_cpu(in.partitionReferenceNum);
13
12 return out; 14 return out;
13} 15}
14 16
15static inline lb_addr cpu_to_lelb(kernel_lb_addr in) 17static inline lb_addr cpu_to_lelb(kernel_lb_addr in)
16{ 18{
17 lb_addr out; 19 lb_addr out;
20
18 out.logicalBlockNum = cpu_to_le32(in.logicalBlockNum); 21 out.logicalBlockNum = cpu_to_le32(in.logicalBlockNum);
19 out.partitionReferenceNum = cpu_to_le16(in.partitionReferenceNum); 22 out.partitionReferenceNum = cpu_to_le16(in.partitionReferenceNum);
23
20 return out; 24 return out;
21} 25}
22 26
23static inline kernel_timestamp lets_to_cpu(timestamp in) 27static inline kernel_timestamp lets_to_cpu(timestamp in)
24{ 28{
25 kernel_timestamp out; 29 kernel_timestamp out;
30
26 memcpy(&out, &in, sizeof(timestamp)); 31 memcpy(&out, &in, sizeof(timestamp));
27 out.typeAndTimezone = le16_to_cpu(in.typeAndTimezone); 32 out.typeAndTimezone = le16_to_cpu(in.typeAndTimezone);
28 out.year = le16_to_cpu(in.year); 33 out.year = le16_to_cpu(in.year);
34
29 return out; 35 return out;
30} 36}
31 37
32static inline short_ad lesa_to_cpu(short_ad in) 38static inline short_ad lesa_to_cpu(short_ad in)
33{ 39{
34 short_ad out; 40 short_ad out;
41
35 out.extLength = le32_to_cpu(in.extLength); 42 out.extLength = le32_to_cpu(in.extLength);
36 out.extPosition = le32_to_cpu(in.extPosition); 43 out.extPosition = le32_to_cpu(in.extPosition);
44
37 return out; 45 return out;
38} 46}
39 47
40static inline short_ad cpu_to_lesa(short_ad in) 48static inline short_ad cpu_to_lesa(short_ad in)
41{ 49{
42 short_ad out; 50 short_ad out;
51
43 out.extLength = cpu_to_le32(in.extLength); 52 out.extLength = cpu_to_le32(in.extLength);
44 out.extPosition = cpu_to_le32(in.extPosition); 53 out.extPosition = cpu_to_le32(in.extPosition);
54
45 return out; 55 return out;
46} 56}
47 57
48static inline kernel_long_ad lela_to_cpu(long_ad in) 58static inline kernel_long_ad lela_to_cpu(long_ad in)
49{ 59{
50 kernel_long_ad out; 60 kernel_long_ad out;
61
51 out.extLength = le32_to_cpu(in.extLength); 62 out.extLength = le32_to_cpu(in.extLength);
52 out.extLocation = lelb_to_cpu(in.extLocation); 63 out.extLocation = lelb_to_cpu(in.extLocation);
64
53 return out; 65 return out;
54} 66}
55 67
56static inline long_ad cpu_to_lela(kernel_long_ad in) 68static inline long_ad cpu_to_lela(kernel_long_ad in)
57{ 69{
58 long_ad out; 70 long_ad out;
71
59 out.extLength = cpu_to_le32(in.extLength); 72 out.extLength = cpu_to_le32(in.extLength);
60 out.extLocation = cpu_to_lelb(in.extLocation); 73 out.extLocation = cpu_to_lelb(in.extLocation);
74
61 return out; 75 return out;
62} 76}
63 77
64static inline kernel_extent_ad leea_to_cpu(extent_ad in) 78static inline kernel_extent_ad leea_to_cpu(extent_ad in)
65{ 79{
66 kernel_extent_ad out; 80 kernel_extent_ad out;
81
67 out.extLength = le32_to_cpu(in.extLength); 82 out.extLength = le32_to_cpu(in.extLength);
68 out.extLocation = le32_to_cpu(in.extLocation); 83 out.extLocation = le32_to_cpu(in.extLocation);
84
69 return out; 85 return out;
70} 86}
71 87
72static inline timestamp cpu_to_lets(kernel_timestamp in) 88static inline timestamp cpu_to_lets(kernel_timestamp in)
73{ 89{
74 timestamp out; 90 timestamp out;
91
75 memcpy(&out, &in, sizeof(timestamp)); 92 memcpy(&out, &in, sizeof(timestamp));
76 out.typeAndTimezone = cpu_to_le16(in.typeAndTimezone); 93 out.typeAndTimezone = cpu_to_le16(in.typeAndTimezone);
77 out.year = cpu_to_le16(in.year); 94 out.year = cpu_to_le16(in.year);
95
78 return out; 96 return out;
79} 97}
80 98
81#endif /* __UDF_ENDIAN_H */ 99#endif /* __UDF_ENDIAN_H */