scoutfs: add offline flag, releasing, and fiemap

Now that we have basic file extents we can add a flag to extents to
track offline extents.  We have to initialize and test the flags as we
work with extents.  Truncation can be told to leave removed extents
around with no block mapping and the offline bit set.  Only staging with
the correct data version can write to the offline regions.  Demand
staging isn't implemented yet.  Reads from offline extents are treated
like sparse regions.

Truncation is a straight forward iteration over the portions of existing
extents which overlap with the truncated blocks.

Writing to offline extents has to first remove the existing offline
extent before then adding the new allocated extents.  The 'changes'
mechanism relied on being able to search the current items to find the
changes that should be made before making any changes.  This doesn't
work for finding merge candidates for the new allocated insertion
because the old offline extent change won't have been applied yet.  We
replace the change mechanism with straight forward item modification and
unwinding.

The generic block fiemap can't communicate offline extents and iterates
over blocks instead of extents.  We add our fiemap that iterates
over extents and sets the 'UNKNOWN' flag on offline extents.

Signed-off-by: Zach Brown <zab@versity.com>
This commit is contained in:
Zach Brown
2017-05-16 10:48:12 -07:00
parent e34f8db4a9
commit 4084d3d9dc
4 changed files with 473 additions and 224 deletions
+1
View File
@@ -145,6 +145,7 @@ static const struct inode_operations scoutfs_file_iops = {
.getxattr = scoutfs_getxattr,
.listxattr = scoutfs_listxattr,
.removexattr = scoutfs_removexattr,
.fiemap = scoutfs_data_fiemap,
};
static const struct inode_operations scoutfs_special_iops = {