~csurbhi/ubuntu/maverick/e2fsprogs/e2fsprogs.fix-505719

« back to all changes in this revision

Viewing changes to lib/ext2fs/swapfs.c

  • Committer: Bazaar Package Importer
  • Author(s): Matt Zimmerman
  • Date: 2004-09-19 09:43:14 UTC
  • mto: (8.1.1 lenny) (1.2.3 upstream)
  • mto: This revision was merged to the branch mainline in revision 3.
  • Revision ID: james.westby@ubuntu.com-20040919094314-2tafd19i76fhu6ei
Tags: upstream-1.35
ImportĀ upstreamĀ versionĀ 1.35

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
2
 * swapfs.c --- swap ext2 filesystem data structures
3
3
 * 
4
 
 * Copyright (C) 1995, 1996 Theodore Ts'o.
 
4
 * Copyright (C) 1995, 1996, 2002 Theodore Ts'o.
5
5
 *
6
6
 * %Begin-Header%
7
7
 * This file may be redistributed under the terms of the GNU Public
21
21
#ifdef EXT2FS_ENABLE_SWAPFS
22
22
void ext2fs_swap_super(struct ext2_super_block * sb)
23
23
{
 
24
        int i;
24
25
        sb->s_inodes_count = ext2fs_swab32(sb->s_inodes_count);
25
26
        sb->s_blocks_count = ext2fs_swab32(sb->s_blocks_count);
26
27
        sb->s_r_blocks_count = ext2fs_swab32(sb->s_r_blocks_count);
56
57
        sb->s_journal_inum = ext2fs_swab32(sb->s_journal_inum);
57
58
        sb->s_journal_dev = ext2fs_swab32(sb->s_journal_dev);
58
59
        sb->s_last_orphan = ext2fs_swab32(sb->s_last_orphan);
 
60
        sb->s_default_mount_opts = ext2fs_swab32(sb->s_default_mount_opts);
 
61
        sb->s_first_meta_bg = ext2fs_swab32(sb->s_first_meta_bg);
 
62
        sb->s_mkfs_time = ext2fs_swab32(sb->s_mkfs_time);
 
63
        for (i=0; i < 4; i++)
 
64
                sb->s_hash_seed[i] = ext2fs_swab32(sb->s_hash_seed[i]);
 
65
        for (i=0; i < 17; i++)
 
66
                sb->s_jnl_blocks[i] = ext2fs_swab32(sb->s_jnl_blocks[i]);
 
67
 
59
68
}
60
69
 
61
70
void ext2fs_swap_group_desc(struct ext2_group_desc *gdp)
89
98
        t->i_links_count = ext2fs_swab16(f->i_links_count);
90
99
        t->i_blocks = ext2fs_swab32(f->i_blocks);
91
100
        t->i_flags = ext2fs_swab32(f->i_flags);
92
 
        if (!islnk || f->i_blocks) {
 
101
        t->i_file_acl = ext2fs_swab32(f->i_file_acl);
 
102
        t->i_dir_acl = ext2fs_swab32(f->i_dir_acl);
 
103
        if (!islnk || ext2fs_inode_data_blocks(fs, t)) {
93
104
                for (i = 0; i < EXT2_N_BLOCKS; i++)
94
105
                        t->i_block[i] = ext2fs_swab32(f->i_block[i]);
95
106
        } else if (t != f) {
97
108
                        t->i_block[i] = f->i_block[i];
98
109
        }
99
110
        t->i_generation = ext2fs_swab32(f->i_generation);
100
 
        t->i_file_acl = ext2fs_swab32(f->i_file_acl);
101
 
        t->i_dir_acl = ext2fs_swab32(f->i_dir_acl);
102
111
        t->i_faddr = ext2fs_swab32(f->i_faddr);
103
112
 
104
113
        switch (fs->super->s_creator_os) {