aboutsummaryrefslogtreecommitdiffstats
path: root/fs/udf/truncate.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/udf/truncate.c')
-rw-r--r--fs/udf/truncate.c34
1 files changed, 17 insertions, 17 deletions
diff --git a/fs/udf/truncate.c b/fs/udf/truncate.c
index 5c1bf921f400..8eb1d24ce5ce 100644
--- a/fs/udf/truncate.c
+++ b/fs/udf/truncate.c
@@ -75,16 +75,16 @@ void udf_truncate_tail_extent(struct inode *inode)
75 int8_t etype = -1, netype; 75 int8_t etype = -1, netype;
76 int adsize; 76 int adsize;
77 77
78 if (UDF_I_ALLOCTYPE(inode) == ICBTAG_FLAG_AD_IN_ICB || 78 if (UDF_I(inode)->i_alloc_type == ICBTAG_FLAG_AD_IN_ICB ||
79 inode->i_size == UDF_I_LENEXTENTS(inode)) 79 inode->i_size == UDF_I(inode)->i_lenExtents)
80 return; 80 return;
81 /* Are we going to delete the file anyway? */ 81 /* Are we going to delete the file anyway? */
82 if (inode->i_nlink == 0) 82 if (inode->i_nlink == 0)
83 return; 83 return;
84 84
85 if (UDF_I_ALLOCTYPE(inode) == ICBTAG_FLAG_AD_SHORT) 85 if (UDF_I(inode)->i_alloc_type == ICBTAG_FLAG_AD_SHORT)
86 adsize = sizeof(short_ad); 86 adsize = sizeof(short_ad);
87 else if (UDF_I_ALLOCTYPE(inode) == ICBTAG_FLAG_AD_LONG) 87 else if (UDF_I(inode)->i_alloc_type == ICBTAG_FLAG_AD_LONG)
88 adsize = sizeof(long_ad); 88 adsize = sizeof(long_ad);
89 else 89 else
90 BUG(); 90 BUG();
@@ -117,7 +117,7 @@ void udf_truncate_tail_extent(struct inode *inode)
117 } 117 }
118 /* This inode entry is in-memory only and thus we don't have to mark 118 /* This inode entry is in-memory only and thus we don't have to mark
119 * the inode dirty */ 119 * the inode dirty */
120 UDF_I_LENEXTENTS(inode) = inode->i_size; 120 UDF_I(inode)->i_lenExtents = inode->i_size;
121 brelse(epos.bh); 121 brelse(epos.bh);
122} 122}
123 123
@@ -130,18 +130,18 @@ void udf_discard_prealloc(struct inode *inode)
130 int8_t etype = -1, netype; 130 int8_t etype = -1, netype;
131 int adsize; 131 int adsize;
132 132
133 if (UDF_I_ALLOCTYPE(inode) == ICBTAG_FLAG_AD_IN_ICB || 133 if (UDF_I(inode)->i_alloc_type == ICBTAG_FLAG_AD_IN_ICB ||
134 inode->i_size == UDF_I_LENEXTENTS(inode)) 134 inode->i_size == UDF_I(inode)->i_lenExtents)
135 return; 135 return;
136 136
137 if (UDF_I_ALLOCTYPE(inode) == ICBTAG_FLAG_AD_SHORT) 137 if (UDF_I(inode)->i_alloc_type == ICBTAG_FLAG_AD_SHORT)
138 adsize = sizeof(short_ad); 138 adsize = sizeof(short_ad);
139 else if (UDF_I_ALLOCTYPE(inode) == ICBTAG_FLAG_AD_LONG) 139 else if (UDF_I(inode)->i_alloc_type == ICBTAG_FLAG_AD_LONG)
140 adsize = sizeof(long_ad); 140 adsize = sizeof(long_ad);
141 else 141 else
142 adsize = 0; 142 adsize = 0;
143 143
144 epos.block = UDF_I_LOCATION(inode); 144 epos.block = UDF_I(inode)->i_location;
145 145
146 /* Find the last extent in the file */ 146 /* Find the last extent in the file */
147 while ((netype = udf_next_aext(inode, &epos, &eloc, &elen, 1)) != -1) { 147 while ((netype = udf_next_aext(inode, &epos, &eloc, &elen, 1)) != -1) {
@@ -153,7 +153,7 @@ void udf_discard_prealloc(struct inode *inode)
153 lbcount -= elen; 153 lbcount -= elen;
154 extent_trunc(inode, &epos, eloc, etype, elen, 0); 154 extent_trunc(inode, &epos, eloc, etype, elen, 0);
155 if (!epos.bh) { 155 if (!epos.bh) {
156 UDF_I_LENALLOC(inode) = 156 UDF_I(inode)->i_lenAlloc =
157 epos.offset - 157 epos.offset -
158 udf_file_entry_alloc_offset(inode); 158 udf_file_entry_alloc_offset(inode);
159 mark_inode_dirty(inode); 159 mark_inode_dirty(inode);
@@ -174,7 +174,7 @@ void udf_discard_prealloc(struct inode *inode)
174 } 174 }
175 /* This inode entry is in-memory only and thus we don't have to mark 175 /* This inode entry is in-memory only and thus we don't have to mark
176 * the inode dirty */ 176 * the inode dirty */
177 UDF_I_LENEXTENTS(inode) = lbcount; 177 UDF_I(inode)->i_lenExtents = lbcount;
178 brelse(epos.bh); 178 brelse(epos.bh);
179} 179}
180 180
@@ -190,9 +190,9 @@ void udf_truncate_extents(struct inode *inode)
190 loff_t byte_offset; 190 loff_t byte_offset;
191 int adsize; 191 int adsize;
192 192
193 if (UDF_I_ALLOCTYPE(inode) == ICBTAG_FLAG_AD_SHORT) 193 if (UDF_I(inode)->i_alloc_type == ICBTAG_FLAG_AD_SHORT)
194 adsize = sizeof(short_ad); 194 adsize = sizeof(short_ad);
195 else if (UDF_I_ALLOCTYPE(inode) == ICBTAG_FLAG_AD_LONG) 195 else if (UDF_I(inode)->i_alloc_type == ICBTAG_FLAG_AD_LONG)
196 adsize = sizeof(long_ad); 196 adsize = sizeof(long_ad);
197 else 197 else
198 BUG(); 198 BUG();
@@ -227,7 +227,7 @@ void udf_truncate_extents(struct inode *inode)
227 0, indirect_ext_len); 227 0, indirect_ext_len);
228 } else { 228 } else {
229 if (!epos.bh) { 229 if (!epos.bh) {
230 UDF_I_LENALLOC(inode) = 230 UDF_I(inode)->i_lenAlloc =
231 lenalloc; 231 lenalloc;
232 mark_inode_dirty(inode); 232 mark_inode_dirty(inode);
233 } else { 233 } else {
@@ -275,7 +275,7 @@ void udf_truncate_extents(struct inode *inode)
275 indirect_ext_len); 275 indirect_ext_len);
276 } else { 276 } else {
277 if (!epos.bh) { 277 if (!epos.bh) {
278 UDF_I_LENALLOC(inode) = lenalloc; 278 UDF_I(inode)->i_lenAlloc = lenalloc;
279 mark_inode_dirty(inode); 279 mark_inode_dirty(inode);
280 } else { 280 } else {
281 struct allocExtDesc *aed = 281 struct allocExtDesc *aed =
@@ -325,7 +325,7 @@ void udf_truncate_extents(struct inode *inode)
325 (sb->s_blocksize - 1)) != 0)); 325 (sb->s_blocksize - 1)) != 0));
326 } 326 }
327 } 327 }
328 UDF_I_LENEXTENTS(inode) = inode->i_size; 328 UDF_I(inode)->i_lenExtents = inode->i_size;
329 329
330 brelse(epos.bh); 330 brelse(epos.bh);
331} 331}