Opened 15 years ago

Closed 14 years ago

#975 closed enhancement (fixed)

the filesystem API should support sparse files for the call "get_file_map"

Reported by: korli Owned by: axeld
Priority: normal Milestone: R1
Component: System/Kernel Version: R1/pre-alpha1
Keywords: Cc:
Blocked By: Blocking:
Platform: All


the UDF filesystem uses sparse files (with blank chunks). The current API doesn't allow to describe such files. A proposed solution is to add a field "blank" to the struct file_io_vec for such blank chunks.

Change History (6)

comment:1 by korli, 15 years ago

Milestone: R1

comment:2 by wkornewald, 15 years ago

Type: bugenhancement

comment:3 by korli, 15 years ago

I wouldn't call this an enhancement given the impact on the UDF filesystem, anyway ...

comment:4 by wkornewald, 15 years ago

Hmm, I just found that bug doesn't fit (it's about extending the API), but feel free to change it to "bug". We'll need to define how we want to use Trac for release planning (what role do type and priority play, etc.) at some point.

comment:5 by bonefish, 15 years ago

Adding at least read support for sparse files to the file cache (which would suffice for UDF) should require relatively few changes. It wouldn't even be necessary to add another field to file_io_vec; one could simply use a negative offset as indicator.

In fact the only two changes necessary should be to

  • replace negative offsets by LONG_LONG_MIN in file_cache.cpp:get_file_map() and
  • use a small wrapper for vfs_read_pages() which simply clears the pages in case of a negative offset.

comment:6 by axeld, 14 years ago

Resolution: fixed
Status: newclosed

Implemented in hrev28648. Sparse files report a disk offset of -1 for the sparse extents, read_file_io_vec_pages() will then zero them out.

Note: See TracTickets for help on using tickets.