@@ -58,7 +58,7 @@ static inline void adfs_writeval(unsigned char *p, int len, unsigned int val)
58
58
#define bufoff (_bh ,_idx ) \
59
59
({ int _buf = _idx >> blocksize_bits; \
60
60
int _off = _idx - (_buf << blocksize_bits);\
61
- (u8 *)(_bh[_buf]->b_data + _off); \
61
+ (void *)(_bh[_buf]->b_data + _off); \
62
62
})
63
63
64
64
/*
@@ -139,18 +139,18 @@ static int adfs_dir_read(struct super_block *sb, u32 indaddr,
139
139
if (ret )
140
140
return ret ;
141
141
142
- memcpy ( & dir -> dirhead , bufoff (dir -> bh , 0 ), sizeof ( dir -> dirhead ) );
143
- memcpy ( & dir -> dirtail , bufoff (dir -> bh , 2007 ), sizeof ( dir -> dirtail ) );
142
+ dir -> dirhead = bufoff (dir -> bh , 0 );
143
+ dir -> newtail = bufoff (dir -> bh , 2007 );
144
144
145
- if (dir -> dirhead . startmasseq != dir -> dirtail . new . endmasseq ||
146
- memcmp (& dir -> dirhead . startname , & dir -> dirtail . new . endname , 4 ))
145
+ if (dir -> dirhead -> startmasseq != dir -> newtail -> endmasseq ||
146
+ memcmp (& dir -> dirhead -> startname , & dir -> newtail -> endname , 4 ))
147
147
goto bad_dir ;
148
148
149
- if (memcmp (& dir -> dirhead . startname , "Nick" , 4 ) &&
150
- memcmp (& dir -> dirhead . startname , "Hugo" , 4 ))
149
+ if (memcmp (& dir -> dirhead -> startname , "Nick" , 4 ) &&
150
+ memcmp (& dir -> dirhead -> startname , "Hugo" , 4 ))
151
151
goto bad_dir ;
152
152
153
- if (adfs_dir_checkbyte (dir ) != dir -> dirtail . new . dircheckbyte )
153
+ if (adfs_dir_checkbyte (dir ) != dir -> newtail -> dircheckbyte )
154
154
goto bad_dir ;
155
155
156
156
return 0 ;
@@ -275,7 +275,7 @@ static int adfs_f_read(struct super_block *sb, u32 indaddr, unsigned int size,
275
275
if (ret )
276
276
adfs_error (sb , "unable to read directory" );
277
277
else
278
- dir -> parent_id = adfs_readval (dir -> dirtail . new . dirparent , 3 );
278
+ dir -> parent_id = adfs_readval (dir -> newtail -> dirparent , 3 );
279
279
280
280
return ret ;
281
281
}
@@ -322,7 +322,6 @@ static int adfs_f_iterate(struct adfs_dir *dir, struct dir_context *ctx)
322
322
static int
323
323
adfs_f_update (struct adfs_dir * dir , struct object_info * obj )
324
324
{
325
- struct super_block * sb = dir -> sb ;
326
325
int ret ;
327
326
328
327
ret = adfs_dir_find_entry (dir , obj -> indaddr );
@@ -336,33 +335,26 @@ adfs_f_update(struct adfs_dir *dir, struct object_info *obj)
336
335
/*
337
336
* Increment directory sequence number
338
337
*/
339
- dir -> bh [ 0 ] -> b_data [ 0 ] += 1 ;
340
- dir -> bh [ dir -> nr_buffers - 1 ] -> b_data [ sb -> s_blocksize - 6 ] += 1 ;
338
+ dir -> dirhead -> startmasseq += 1 ;
339
+ dir -> newtail -> endmasseq += 1 ;
341
340
342
341
ret = adfs_dir_checkbyte (dir );
343
342
/*
344
343
* Update directory check byte
345
344
*/
346
- dir -> bh [ dir -> nr_buffers - 1 ] -> b_data [ sb -> s_blocksize - 1 ] = ret ;
345
+ dir -> newtail -> dircheckbyte = ret ;
347
346
348
347
#if 1
349
- {
350
- const unsigned int blocksize_bits = sb -> s_blocksize_bits ;
351
-
352
- memcpy (& dir -> dirhead , bufoff (dir -> bh , 0 ), sizeof (dir -> dirhead ));
353
- memcpy (& dir -> dirtail , bufoff (dir -> bh , 2007 ), sizeof (dir -> dirtail ));
354
-
355
- if (dir -> dirhead .startmasseq != dir -> dirtail .new .endmasseq ||
356
- memcmp (& dir -> dirhead .startname , & dir -> dirtail .new .endname , 4 ))
348
+ if (dir -> dirhead -> startmasseq != dir -> newtail -> endmasseq ||
349
+ memcmp (& dir -> dirhead -> startname , & dir -> newtail -> endname , 4 ))
357
350
goto bad_dir ;
358
351
359
- if (memcmp (& dir -> dirhead . startname , "Nick" , 4 ) &&
360
- memcmp (& dir -> dirhead . startname , "Hugo" , 4 ))
352
+ if (memcmp (& dir -> dirhead -> startname , "Nick" , 4 ) &&
353
+ memcmp (& dir -> dirhead -> startname , "Hugo" , 4 ))
361
354
goto bad_dir ;
362
355
363
- if (adfs_dir_checkbyte (dir ) != dir -> dirtail . new . dircheckbyte )
356
+ if (adfs_dir_checkbyte (dir ) != dir -> newtail -> dircheckbyte )
364
357
goto bad_dir ;
365
- }
366
358
#endif
367
359
ret = 0 ;
368
360
out :
0 commit comments