Opened 12 years ago

Closed 11 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:
Has a Patch: no Platform: All

Description

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 Changed 12 years ago by korli

Milestone: R1

comment:2 Changed 12 years ago by wkornewald

Type: bugenhancement

comment:3 Changed 12 years ago by korli

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

comment:4 Changed 12 years ago by wkornewald

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 Changed 12 years ago by bonefish

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 Changed 11 years ago by axeld

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.