• Home
  • Raw
  • Download

Lines Matching +full:- +full:fs

2  * dupfs.c --- duplicate a ext2 filesystem handle
6 * %Begin-Header%
9 * %End-Header%
25 ext2_filsys fs; in ext2fs_dup_handle() local
30 retval = ext2fs_get_mem(sizeof(struct struct_ext2_filsys), &fs); in ext2fs_dup_handle()
34 *fs = *src; in ext2fs_dup_handle()
35 fs->device_name = 0; in ext2fs_dup_handle()
36 fs->super = 0; in ext2fs_dup_handle()
37 fs->orig_super = 0; in ext2fs_dup_handle()
38 fs->group_desc = 0; in ext2fs_dup_handle()
39 fs->inode_map = 0; in ext2fs_dup_handle()
40 fs->block_map = 0; in ext2fs_dup_handle()
41 fs->badblocks = 0; in ext2fs_dup_handle()
42 fs->dblist = 0; in ext2fs_dup_handle()
43 fs->mmp_buf = 0; in ext2fs_dup_handle()
44 fs->mmp_cmp = 0; in ext2fs_dup_handle()
45 fs->mmp_fd = -1; in ext2fs_dup_handle()
47 io_channel_bumpcount(fs->io); in ext2fs_dup_handle()
48 if (fs->icache) in ext2fs_dup_handle()
49 fs->icache->refcount++; in ext2fs_dup_handle()
51 retval = ext2fs_get_mem(strlen(src->device_name)+1, &fs->device_name); in ext2fs_dup_handle()
54 strcpy(fs->device_name, src->device_name); in ext2fs_dup_handle()
56 retval = ext2fs_get_mem(SUPERBLOCK_SIZE, &fs->super); in ext2fs_dup_handle()
59 memcpy(fs->super, src->super, SUPERBLOCK_SIZE); in ext2fs_dup_handle()
61 retval = ext2fs_get_mem(SUPERBLOCK_SIZE, &fs->orig_super); in ext2fs_dup_handle()
64 memcpy(fs->orig_super, src->orig_super, SUPERBLOCK_SIZE); in ext2fs_dup_handle()
66 retval = ext2fs_get_array(fs->desc_blocks, fs->blocksize, in ext2fs_dup_handle()
67 &fs->group_desc); in ext2fs_dup_handle()
70 memcpy(fs->group_desc, src->group_desc, in ext2fs_dup_handle()
71 (size_t) fs->desc_blocks * fs->blocksize); in ext2fs_dup_handle()
73 if (src->inode_map) { in ext2fs_dup_handle()
74 retval = ext2fs_copy_bitmap(src->inode_map, &fs->inode_map); in ext2fs_dup_handle()
78 if (src->block_map) { in ext2fs_dup_handle()
79 retval = ext2fs_copy_bitmap(src->block_map, &fs->block_map); in ext2fs_dup_handle()
83 if (src->badblocks) { in ext2fs_dup_handle()
84 retval = ext2fs_badblocks_copy(src->badblocks, &fs->badblocks); in ext2fs_dup_handle()
88 if (src->dblist) { in ext2fs_dup_handle()
89 retval = ext2fs_copy_dblist(src->dblist, &fs->dblist); in ext2fs_dup_handle()
93 if (src->mmp_buf) { in ext2fs_dup_handle()
94 retval = ext2fs_get_mem(src->blocksize, &fs->mmp_buf); in ext2fs_dup_handle()
97 memcpy(fs->mmp_buf, src->mmp_buf, src->blocksize); in ext2fs_dup_handle()
99 if (src->mmp_fd >= 0) { in ext2fs_dup_handle()
100 fs->mmp_fd = dup(src->mmp_fd); in ext2fs_dup_handle()
101 if (fs->mmp_fd < 0) { in ext2fs_dup_handle()
106 if (src->mmp_cmp) { in ext2fs_dup_handle()
107 int align = ext2fs_get_dio_alignment(src->mmp_fd); in ext2fs_dup_handle()
109 retval = ext2fs_get_memalign(src->blocksize, align, in ext2fs_dup_handle()
110 &fs->mmp_cmp); in ext2fs_dup_handle()
113 memcpy(fs->mmp_cmp, src->mmp_cmp, src->blocksize); in ext2fs_dup_handle()
115 *dest = fs; in ext2fs_dup_handle()
118 ext2fs_free(fs); in ext2fs_dup_handle()