~xnox/+junk/temp

« back to all changes in this revision

Viewing changes to extras/ext4_utils/ext4_utils.c

  • Committer: Package Import Robot
  • Author(s): Loïc Minier
  • Date: 2013-02-18 16:33:46 UTC
  • mfrom: (3.1.3 raring)
  • Revision ID: package-import@ubuntu.com-20130218163346-5nrw4cgh7t4t0k8a
Tags: 4.2.2+git20130218-1
* Add myself to Uploaders with Marcin's permission; also sponsor NEW
  android-tools-fsutils binary package.
* Improve long descriptions a bit.

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
#include <fcntl.h>
26
26
#include <sys/stat.h>
27
27
#include <sys/types.h>
 
28
#include <stddef.h>
28
29
#include <string.h>
29
30
 
30
31
#ifdef USE_MINGW
362
363
   block group */
363
364
void ext4_update_free()
364
365
{
365
 
        unsigned int i;
 
366
        u32 i;
366
367
 
367
368
        for (i = 0; i < aux_info.groups; i++) {
368
369
                u32 bg_free_blocks = get_free_blocks(i);
369
370
                u32 bg_free_inodes = get_free_inodes(i);
 
371
                u16 crc;
370
372
 
371
373
                aux_info.bg_desc[i].bg_free_blocks_count = bg_free_blocks;
372
374
                aux_info.sb->s_free_blocks_count_lo += bg_free_blocks;
375
377
                aux_info.sb->s_free_inodes_count += bg_free_inodes;
376
378
 
377
379
                aux_info.bg_desc[i].bg_used_dirs_count += get_directories(i);
 
380
 
 
381
                aux_info.bg_desc[i].bg_flags = get_bg_flags(i);
 
382
 
 
383
                crc = ext4_crc16(~0, aux_info.sb->s_uuid, sizeof(aux_info.sb->s_uuid));
 
384
                crc = ext4_crc16(crc, &i, sizeof(i));
 
385
                crc = ext4_crc16(crc, &aux_info.bg_desc[i], offsetof(struct ext2_group_desc, bg_checksum));
 
386
                aux_info.bg_desc[i].bg_checksum = crc;
378
387
        }
379
388
}
380
389