diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2012-04-06 14:30:07 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2012-05-29 23:28:37 -0400 |
commit | c4c995430a94e7d94526fcb347c4ba4b2ae82500 (patch) | |
tree | 00dd49eb6252305e90106a375fc3fa12d25f4d1b /fs/hpfs/ea.c | |
parent | 4085e155b14a89ee36f7bfc5bd07294b0c34b0e6 (diff) |
hpfs: get rid of bitfields in struct fnode
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/hpfs/ea.c')
-rw-r--r-- | fs/hpfs/ea.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/fs/hpfs/ea.c b/fs/hpfs/ea.c index 7cd0092771f4..bcaafcd2666a 100644 --- a/fs/hpfs/ea.c +++ b/fs/hpfs/ea.c | |||
@@ -91,7 +91,7 @@ int hpfs_read_ea(struct super_block *s, struct fnode *fnode, char *key, | |||
91 | } | 91 | } |
92 | a = le32_to_cpu(fnode->ea_secno); | 92 | a = le32_to_cpu(fnode->ea_secno); |
93 | len = le32_to_cpu(fnode->ea_size_l); | 93 | len = le32_to_cpu(fnode->ea_size_l); |
94 | ano = fnode->ea_anode; | 94 | ano = fnode_in_anode(fnode); |
95 | pos = 0; | 95 | pos = 0; |
96 | while (pos < len) { | 96 | while (pos < len) { |
97 | ea = (struct extended_attribute *)ex; | 97 | ea = (struct extended_attribute *)ex; |
@@ -148,7 +148,7 @@ char *hpfs_get_ea(struct super_block *s, struct fnode *fnode, char *key, int *si | |||
148 | } | 148 | } |
149 | a = le32_to_cpu(fnode->ea_secno); | 149 | a = le32_to_cpu(fnode->ea_secno); |
150 | len = le32_to_cpu(fnode->ea_size_l); | 150 | len = le32_to_cpu(fnode->ea_size_l); |
151 | ano = fnode->ea_anode; | 151 | ano = fnode_in_anode(fnode); |
152 | pos = 0; | 152 | pos = 0; |
153 | while (pos < len) { | 153 | while (pos < len) { |
154 | char ex[4 + 255 + 1 + 8]; | 154 | char ex[4 + 255 + 1 + 8]; |
@@ -209,7 +209,7 @@ void hpfs_set_ea(struct inode *inode, struct fnode *fnode, const char *key, | |||
209 | } | 209 | } |
210 | a = le32_to_cpu(fnode->ea_secno); | 210 | a = le32_to_cpu(fnode->ea_secno); |
211 | len = le32_to_cpu(fnode->ea_size_l); | 211 | len = le32_to_cpu(fnode->ea_size_l); |
212 | ano = fnode->ea_anode; | 212 | ano = fnode_in_anode(fnode); |
213 | pos = 0; | 213 | pos = 0; |
214 | while (pos < len) { | 214 | while (pos < len) { |
215 | char ex[4 + 255 + 1 + 8]; | 215 | char ex[4 + 255 + 1 + 8]; |
@@ -276,7 +276,7 @@ void hpfs_set_ea(struct inode *inode, struct fnode *fnode, const char *key, | |||
276 | fnode->ea_size_l = cpu_to_le32(le16_to_cpu(fnode->ea_size_s)); | 276 | fnode->ea_size_l = cpu_to_le32(le16_to_cpu(fnode->ea_size_s)); |
277 | fnode->ea_size_s = cpu_to_le16(0); | 277 | fnode->ea_size_s = cpu_to_le16(0); |
278 | fnode->ea_secno = cpu_to_le32(n); | 278 | fnode->ea_secno = cpu_to_le32(n); |
279 | fnode->ea_anode = cpu_to_le32(0); | 279 | fnode->flags &= ~FNODE_anode; |
280 | mark_buffer_dirty(bh); | 280 | mark_buffer_dirty(bh); |
281 | brelse(bh); | 281 | brelse(bh); |
282 | } | 282 | } |
@@ -288,9 +288,9 @@ void hpfs_set_ea(struct inode *inode, struct fnode *fnode, const char *key, | |||
288 | secno q = hpfs_alloc_sector(s, fno, 1, 0); | 288 | secno q = hpfs_alloc_sector(s, fno, 1, 0); |
289 | if (!q) goto bail; | 289 | if (!q) goto bail; |
290 | fnode->ea_secno = cpu_to_le32(q); | 290 | fnode->ea_secno = cpu_to_le32(q); |
291 | fnode->ea_anode = 0; | 291 | fnode->flags &= ~FNODE_anode; |
292 | len++; | 292 | len++; |
293 | } else if (!fnode->ea_anode) { | 293 | } else if (!fnode_in_anode(fnode)) { |
294 | if (hpfs_alloc_if_possible(s, le32_to_cpu(fnode->ea_secno) + len)) { | 294 | if (hpfs_alloc_if_possible(s, le32_to_cpu(fnode->ea_secno) + len)) { |
295 | len++; | 295 | len++; |
296 | } else { | 296 | } else { |
@@ -310,7 +310,7 @@ void hpfs_set_ea(struct inode *inode, struct fnode *fnode, const char *key, | |||
310 | anode->u.external[0].length = cpu_to_le32(len); | 310 | anode->u.external[0].length = cpu_to_le32(len); |
311 | mark_buffer_dirty(bh); | 311 | mark_buffer_dirty(bh); |
312 | brelse(bh); | 312 | brelse(bh); |
313 | fnode->ea_anode = 1; | 313 | fnode->flags |= FNODE_anode; |
314 | fnode->ea_secno = cpu_to_le32(a_s);*/ | 314 | fnode->ea_secno = cpu_to_le32(a_s);*/ |
315 | secno new_sec; | 315 | secno new_sec; |
316 | int i; | 316 | int i; |
@@ -338,7 +338,7 @@ void hpfs_set_ea(struct inode *inode, struct fnode *fnode, const char *key, | |||
338 | len = (pos + 511) >> 9; | 338 | len = (pos + 511) >> 9; |
339 | } | 339 | } |
340 | } | 340 | } |
341 | if (fnode->ea_anode) { | 341 | if (fnode_in_anode(fnode)) { |
342 | if (hpfs_add_sector_to_btree(s, le32_to_cpu(fnode->ea_secno), | 342 | if (hpfs_add_sector_to_btree(s, le32_to_cpu(fnode->ea_secno), |
343 | 0, len) != -1) { | 343 | 0, len) != -1) { |
344 | len++; | 344 | len++; |
@@ -351,16 +351,16 @@ void hpfs_set_ea(struct inode *inode, struct fnode *fnode, const char *key, | |||
351 | h[1] = strlen(key); | 351 | h[1] = strlen(key); |
352 | h[2] = size & 0xff; | 352 | h[2] = size & 0xff; |
353 | h[3] = size >> 8; | 353 | h[3] = size >> 8; |
354 | if (hpfs_ea_write(s, le32_to_cpu(fnode->ea_secno), fnode->ea_anode, le32_to_cpu(fnode->ea_size_l), 4, h)) goto bail; | 354 | if (hpfs_ea_write(s, le32_to_cpu(fnode->ea_secno), fnode_in_anode(fnode), le32_to_cpu(fnode->ea_size_l), 4, h)) goto bail; |
355 | if (hpfs_ea_write(s, le32_to_cpu(fnode->ea_secno), fnode->ea_anode, le32_to_cpu(fnode->ea_size_l) + 4, h[1] + 1, key)) goto bail; | 355 | if (hpfs_ea_write(s, le32_to_cpu(fnode->ea_secno), fnode_in_anode(fnode), le32_to_cpu(fnode->ea_size_l) + 4, h[1] + 1, key)) goto bail; |
356 | if (hpfs_ea_write(s, le32_to_cpu(fnode->ea_secno), fnode->ea_anode, le32_to_cpu(fnode->ea_size_l) + 5 + h[1], size, data)) goto bail; | 356 | if (hpfs_ea_write(s, le32_to_cpu(fnode->ea_secno), fnode_in_anode(fnode), le32_to_cpu(fnode->ea_size_l) + 5 + h[1], size, data)) goto bail; |
357 | fnode->ea_size_l = cpu_to_le32(pos); | 357 | fnode->ea_size_l = cpu_to_le32(pos); |
358 | ret: | 358 | ret: |
359 | hpfs_i(inode)->i_ea_size += 5 + strlen(key) + size; | 359 | hpfs_i(inode)->i_ea_size += 5 + strlen(key) + size; |
360 | return; | 360 | return; |
361 | bail: | 361 | bail: |
362 | if (le32_to_cpu(fnode->ea_secno)) | 362 | if (le32_to_cpu(fnode->ea_secno)) |
363 | if (fnode->ea_anode) hpfs_truncate_btree(s, le32_to_cpu(fnode->ea_secno), 1, (le32_to_cpu(fnode->ea_size_l) + 511) >> 9); | 363 | if (fnode_in_anode(fnode)) hpfs_truncate_btree(s, le32_to_cpu(fnode->ea_secno), 1, (le32_to_cpu(fnode->ea_size_l) + 511) >> 9); |
364 | else hpfs_free_sectors(s, le32_to_cpu(fnode->ea_secno) + ((le32_to_cpu(fnode->ea_size_l) + 511) >> 9), len - ((le32_to_cpu(fnode->ea_size_l) + 511) >> 9)); | 364 | else hpfs_free_sectors(s, le32_to_cpu(fnode->ea_secno) + ((le32_to_cpu(fnode->ea_size_l) + 511) >> 9), len - ((le32_to_cpu(fnode->ea_size_l) + 511) >> 9)); |
365 | else fnode->ea_secno = fnode->ea_size_l = cpu_to_le32(0); | 365 | else fnode->ea_secno = fnode->ea_size_l = cpu_to_le32(0); |
366 | } | 366 | } |