Init implementation of IsoFileSrc.

Ecma119Image, defined for first time in this commit, is the context for image 
written. It keeps the low level objects needed during image written.

IsoFileSrc is the low level object that takes care about the info needed to
write file contents to image. It takes care about reading from Stream in 2K
block chunks. To prevent the same file be written twice to image, we keep in
Ecma119Image a search tree, indexed by the triple key (fs, device, inode) that
uniquelly identifies a source.
This commit is contained in:
Vreixo Formoso
2007-12-15 13:13:49 +01:00
parent dd83f85d09
commit 7b241176fb
6 changed files with 247 additions and 88 deletions

View File

@ -104,14 +104,17 @@ int fsrc_get_id(IsoStream *stream, unsigned int *fs_id, dev_t *dev_id,
}
src = (IsoFileSource*)stream->data;
fs = src->get_filesystem(src);
*fs_id = fs->get_id(fs);
if (fs_id == 0) {
return 0;
}
result = src->stat(src, &info);
if (result < 0) {
return result;
}
fs = src->get_filesystem(src);
*fs_id = fs->get_id(fs);
*dev_id = info.st_dev;
*ino_id = info.st_ino;
return ISO_SUCCESS;