Home | History | Annotate | Download | only in misc

Lines Matching refs:hdr

57 static void write_header(int fd, struct ext2_image_hdr *hdr, int blocksize)
74 if (hdr)
75 memcpy(header_buf, hdr, sizeof(struct ext2_image_hdr));
92 struct ext2_image_hdr hdr;
97 memset(&hdr, 0, sizeof(struct ext2_image_hdr));
99 hdr.offset_super = lseek(fd, 0, SEEK_CUR);
106 hdr.offset_inode = lseek(fd, 0, SEEK_CUR);
114 hdr.offset_blockmap = lseek(fd, 0, SEEK_CUR);
121 hdr.offset_inodemap = lseek(fd, 0, SEEK_CUR);
128 hdr.magic_number = EXT2_ET_MAGIC_E2IMAGE;
129 strcpy(hdr.magic_descriptor, "Ext2 Image 1.0");
130 gethostname(hdr.fs_hostname, sizeof(hdr.fs_hostname));
131 strncpy(hdr.fs_device_name, device_name, sizeof(hdr.fs_device_name)-1);
132 hdr.fs_device_name[sizeof(hdr.fs_device_name) - 1] = 0;
133 hdr.fs_blocksize = fs->blocksize;
136 hdr.fs_device = st.st_rdev;
139 hdr.image_device = st.st_dev;
140 hdr.image_inode = st.st_ino;
142 memcpy(hdr.fs_uuid, fs->super->s_uuid, sizeof(hdr.fs_uuid));
144 hdr.image_time = time(0);
145 write_header(fd, &hdr, fs->blocksize);