[RTEMS Project] #2415: Duplicate code in Untar_FromMemory(), Untar_FromFile() and rtems_tarfs_load()
RTEMS trac
trac at rtems.org
Tue May 17 05:55:33 UTC 2016
#2415: Duplicate code in Untar_FromMemory(), Untar_FromFile() and
rtems_tarfs_load()
-----------------------------+---------------------
Reporter: sebastian.huber | Owner:
Type: defect | Status: new
Priority: normal | Milestone: 4.11.1
Component: General | Version: 4.10
Severity: normal | Resolution:
Keywords: |
-----------------------------+---------------------
Comment (by chrisj):
Replying to [comment:2 sebastian.huber]:
> We should at least refactor the general TAR file iteration into an
iterator function and use different visitor functions.
I have changed untar.c (need to post for review) to have a ProcessHeader
call and the in-memory and file versions now share that code to handle the
semantics. The only differences are the writes to the files. Further work
could be done to make the code share more if there is a need. The
important part is shared.
> Another option for this direct mapping of some read-only content into an
IMFS linear file would be mmap().
[ implementation here https://git.rtems.org/chrisj/rtl.git/tree/mmap.c ]
I think this is the other way around. The current tar functionality takes
some memory and makes files in the IMFS while mmap takes a file and makes
it appear as memory.
--
Ticket URL: <http://devel.rtems.org/ticket/2415#comment:3>
RTEMS Project <http://www.rtems.org/>
RTEMS Project
More information about the bugs
mailing list