Home | History | Annotate | Download | only in misc

Lines Matching refs:hdr

55 static void write_header(int fd, struct ext2_image_hdr *hdr, int blocksize)
72 if (hdr)
73 memcpy(header_buf, hdr, sizeof(struct ext2_image_hdr));
90 struct ext2_image_hdr hdr;
95 memset(&hdr, 0, sizeof(struct ext2_image_hdr));
97 hdr.offset_super = lseek(fd, 0, SEEK_CUR);
104 hdr.offset_inode = lseek(fd, 0, SEEK_CUR);
112 hdr.offset_blockmap = lseek(fd, 0, SEEK_CUR);
119 hdr.offset_inodemap = lseek(fd, 0, SEEK_CUR);
126 hdr.magic_number = EXT2_ET_MAGIC_E2IMAGE;
127 strcpy(hdr.magic_descriptor, "Ext2 Image 1.0");
128 gethostname(hdr.fs_hostname, sizeof(hdr.fs_hostname));
129 strncpy(hdr.fs_device_name, device_name, sizeof(hdr.fs_device_name)-1);
130 hdr.fs_device_name[sizeof(hdr.fs_device_name) - 1] = 0;
131 hdr.fs_blocksize = fs->blocksize;
134 hdr.fs_device = st.st_rdev;
137 hdr.image_device = st.st_dev;
138 hdr.image_inode = st.st_ino;
140 memcpy(hdr.fs_uuid, fs->super->s_uuid, sizeof(hdr.fs_uuid));
142 hdr.image_time = time(0);
143 write_header(fd, &hdr, fs->blocksize);