aboutsummaryrefslogtreecommitdiffstats
path: root/fs/udf/misc.c
diff options
context:
space:
mode:
authorMarcin Slusarz <marcin.slusarz@gmail.com>2008-02-08 07:20:42 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2008-02-08 12:22:35 -0500
commitc0b344385fa05f6bea462e707fcba89f9e2776c2 (patch)
tree391376739ffb0b5c9dfcf294c9f746d7ff2daf66 /fs/udf/misc.c
parent5e0f001736651f6f859aeca95f895c829d223cdb (diff)
udf: remove UDF_I_* macros and open code them
Signed-off-by: Marcin Slusarz <marcin.slusarz@gmail.com> Acked-by: Jan Kara <jack@suse.cz> Cc: Christoph Hellwig <hch@lst.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/udf/misc.c')
-rw-r--r--fs/udf/misc.c38
1 files changed, 19 insertions, 19 deletions
diff --git a/fs/udf/misc.c b/fs/udf/misc.c
index a3a513faddb0..2af44702633b 100644
--- a/fs/udf/misc.c
+++ b/fs/udf/misc.c
@@ -52,16 +52,16 @@ struct genericFormat *udf_add_extendedattr(struct inode *inode, uint32_t size,
52 int offset; 52 int offset;
53 uint16_t crclen; 53 uint16_t crclen;
54 54
55 ea = UDF_I_DATA(inode); 55 ea = UDF_I(inode)->i_ext.i_data;
56 if (UDF_I_LENEATTR(inode)) { 56 if (UDF_I(inode)->i_lenEAttr) {
57 ad = UDF_I_DATA(inode) + UDF_I_LENEATTR(inode); 57 ad = UDF_I(inode)->i_ext.i_data + UDF_I(inode)->i_lenEAttr;
58 } else { 58 } else {
59 ad = ea; 59 ad = ea;
60 size += sizeof(struct extendedAttrHeaderDesc); 60 size += sizeof(struct extendedAttrHeaderDesc);
61 } 61 }
62 62
63 offset = inode->i_sb->s_blocksize - udf_file_entry_alloc_offset(inode) - 63 offset = inode->i_sb->s_blocksize - udf_file_entry_alloc_offset(inode) -
64 UDF_I_LENALLOC(inode); 64 UDF_I(inode)->i_lenAlloc;
65 65
66 /* TODO - Check for FreeEASpace */ 66 /* TODO - Check for FreeEASpace */
67 67
@@ -69,21 +69,21 @@ struct genericFormat *udf_add_extendedattr(struct inode *inode, uint32_t size,
69 struct extendedAttrHeaderDesc *eahd; 69 struct extendedAttrHeaderDesc *eahd;
70 eahd = (struct extendedAttrHeaderDesc *)ea; 70 eahd = (struct extendedAttrHeaderDesc *)ea;
71 71
72 if (UDF_I_LENALLOC(inode)) 72 if (UDF_I(inode)->i_lenAlloc)
73 memmove(&ad[size], ad, UDF_I_LENALLOC(inode)); 73 memmove(&ad[size], ad, UDF_I(inode)->i_lenAlloc);
74 74
75 if (UDF_I_LENEATTR(inode)) { 75 if (UDF_I(inode)->i_lenEAttr) {
76 /* check checksum/crc */ 76 /* check checksum/crc */
77 if (eahd->descTag.tagIdent != 77 if (eahd->descTag.tagIdent !=
78 cpu_to_le16(TAG_IDENT_EAHD) || 78 cpu_to_le16(TAG_IDENT_EAHD) ||
79 le32_to_cpu(eahd->descTag.tagLocation) != 79 le32_to_cpu(eahd->descTag.tagLocation) !=
80 UDF_I_LOCATION(inode).logicalBlockNum) 80 UDF_I(inode)->i_location.logicalBlockNum)
81 return NULL; 81 return NULL;
82 } else { 82 } else {
83 struct udf_sb_info *sbi = UDF_SB(inode->i_sb); 83 struct udf_sb_info *sbi = UDF_SB(inode->i_sb);
84 84
85 size -= sizeof(struct extendedAttrHeaderDesc); 85 size -= sizeof(struct extendedAttrHeaderDesc);
86 UDF_I_LENEATTR(inode) += 86 UDF_I(inode)->i_lenEAttr +=
87 sizeof(struct extendedAttrHeaderDesc); 87 sizeof(struct extendedAttrHeaderDesc);
88 eahd->descTag.tagIdent = cpu_to_le16(TAG_IDENT_EAHD); 88 eahd->descTag.tagIdent = cpu_to_le16(TAG_IDENT_EAHD);
89 if (sbi->s_udfrev >= 0x0200) 89 if (sbi->s_udfrev >= 0x0200)
@@ -93,15 +93,15 @@ struct genericFormat *udf_add_extendedattr(struct inode *inode, uint32_t size,
93 eahd->descTag.tagSerialNum = 93 eahd->descTag.tagSerialNum =
94 cpu_to_le16(sbi->s_serial_number); 94 cpu_to_le16(sbi->s_serial_number);
95 eahd->descTag.tagLocation = cpu_to_le32( 95 eahd->descTag.tagLocation = cpu_to_le32(
96 UDF_I_LOCATION(inode).logicalBlockNum); 96 UDF_I(inode)->i_location.logicalBlockNum);
97 eahd->impAttrLocation = cpu_to_le32(0xFFFFFFFF); 97 eahd->impAttrLocation = cpu_to_le32(0xFFFFFFFF);
98 eahd->appAttrLocation = cpu_to_le32(0xFFFFFFFF); 98 eahd->appAttrLocation = cpu_to_le32(0xFFFFFFFF);
99 } 99 }
100 100
101 offset = UDF_I_LENEATTR(inode); 101 offset = UDF_I(inode)->i_lenEAttr;
102 if (type < 2048) { 102 if (type < 2048) {
103 if (le32_to_cpu(eahd->appAttrLocation) < 103 if (le32_to_cpu(eahd->appAttrLocation) <
104 UDF_I_LENEATTR(inode)) { 104 UDF_I(inode)->i_lenEAttr) {
105 uint32_t aal = 105 uint32_t aal =
106 le32_to_cpu(eahd->appAttrLocation); 106 le32_to_cpu(eahd->appAttrLocation);
107 memmove(&ea[offset - aal + size], 107 memmove(&ea[offset - aal + size],
@@ -111,7 +111,7 @@ struct genericFormat *udf_add_extendedattr(struct inode *inode, uint32_t size,
111 cpu_to_le32(aal + size); 111 cpu_to_le32(aal + size);
112 } 112 }
113 if (le32_to_cpu(eahd->impAttrLocation) < 113 if (le32_to_cpu(eahd->impAttrLocation) <
114 UDF_I_LENEATTR(inode)) { 114 UDF_I(inode)->i_lenEAttr) {
115 uint32_t ial = 115 uint32_t ial =
116 le32_to_cpu(eahd->impAttrLocation); 116 le32_to_cpu(eahd->impAttrLocation);
117 memmove(&ea[offset - ial + size], 117 memmove(&ea[offset - ial + size],
@@ -122,7 +122,7 @@ struct genericFormat *udf_add_extendedattr(struct inode *inode, uint32_t size,
122 } 122 }
123 } else if (type < 65536) { 123 } else if (type < 65536) {
124 if (le32_to_cpu(eahd->appAttrLocation) < 124 if (le32_to_cpu(eahd->appAttrLocation) <
125 UDF_I_LENEATTR(inode)) { 125 UDF_I(inode)->i_lenEAttr) {
126 uint32_t aal = 126 uint32_t aal =
127 le32_to_cpu(eahd->appAttrLocation); 127 le32_to_cpu(eahd->appAttrLocation);
128 memmove(&ea[offset - aal + size], 128 memmove(&ea[offset - aal + size],
@@ -138,7 +138,7 @@ struct genericFormat *udf_add_extendedattr(struct inode *inode, uint32_t size,
138 eahd->descTag.descCRC = cpu_to_le16(udf_crc((char *)eahd + 138 eahd->descTag.descCRC = cpu_to_le16(udf_crc((char *)eahd +
139 sizeof(tag), crclen, 0)); 139 sizeof(tag), crclen, 0));
140 eahd->descTag.tagChecksum = udf_tag_checksum(&eahd->descTag); 140 eahd->descTag.tagChecksum = udf_tag_checksum(&eahd->descTag);
141 UDF_I_LENEATTR(inode) += size; 141 UDF_I(inode)->i_lenEAttr += size;
142 return (struct genericFormat *)&ea[offset]; 142 return (struct genericFormat *)&ea[offset];
143 } 143 }
144 if (loc & 0x02) 144 if (loc & 0x02)
@@ -154,9 +154,9 @@ struct genericFormat *udf_get_extendedattr(struct inode *inode, uint32_t type,
154 uint8_t *ea = NULL; 154 uint8_t *ea = NULL;
155 uint32_t offset; 155 uint32_t offset;
156 156
157 ea = UDF_I_DATA(inode); 157 ea = UDF_I(inode)->i_ext.i_data;
158 158
159 if (UDF_I_LENEATTR(inode)) { 159 if (UDF_I(inode)->i_lenEAttr) {
160 struct extendedAttrHeaderDesc *eahd; 160 struct extendedAttrHeaderDesc *eahd;
161 eahd = (struct extendedAttrHeaderDesc *)ea; 161 eahd = (struct extendedAttrHeaderDesc *)ea;
162 162
@@ -164,7 +164,7 @@ struct genericFormat *udf_get_extendedattr(struct inode *inode, uint32_t type,
164 if (eahd->descTag.tagIdent != 164 if (eahd->descTag.tagIdent !=
165 cpu_to_le16(TAG_IDENT_EAHD) || 165 cpu_to_le16(TAG_IDENT_EAHD) ||
166 le32_to_cpu(eahd->descTag.tagLocation) != 166 le32_to_cpu(eahd->descTag.tagLocation) !=
167 UDF_I_LOCATION(inode).logicalBlockNum) 167 UDF_I(inode)->i_location.logicalBlockNum)
168 return NULL; 168 return NULL;
169 169
170 if (type < 2048) 170 if (type < 2048)
@@ -174,7 +174,7 @@ struct genericFormat *udf_get_extendedattr(struct inode *inode, uint32_t type,
174 else 174 else
175 offset = le32_to_cpu(eahd->appAttrLocation); 175 offset = le32_to_cpu(eahd->appAttrLocation);
176 176
177 while (offset < UDF_I_LENEATTR(inode)) { 177 while (offset < UDF_I(inode)->i_lenEAttr) {
178 gaf = (struct genericFormat *)&ea[offset]; 178 gaf = (struct genericFormat *)&ea[offset];
179 if (le32_to_cpu(gaf->attrType) == type && 179 if (le32_to_cpu(gaf->attrType) == type &&
180 gaf->attrSubtype == subtype) 180 gaf->attrSubtype == subtype)