summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2021-09-17xfs: remove xfs_trans_set_refcount_flagsrefcount-intent-cleanups_2021-09-17Darrick J. Wong
Remove this single-use helper. Signed-off-by: Darrick J. Wong <djwong@kernel.org>
2021-09-17xfs: clean up refcount log intent item tracepoint callsitesDarrick J. Wong
Pass the incore refcount intent structure to the tracepoints instead of open-coding the argument passing. Signed-off-by: Darrick J. Wong <djwong@kernel.org>
2021-09-17xfs: pass refcount intent directly through the log intent codeDarrick J. Wong
Pass the incore refcount intent through the CUI logging code instead of repeatedly boxing and unboxing parameters. We'll clean up the tracepoints shortly. Signed-off-by: Darrick J. Wong <djwong@kernel.org>
2021-09-17xfs: prepare refcount btree tracepoints for wideningDarrick J. Wong
Prepare the rest of refcount btree tracepoints for use with realtime reflink by making them take the btree cursor object as a parameter. This will save us a lot of trouble later on. Remove the xfs_refcount_recover_extent tracepoint since it's already covered by other refcount tracepoints. Signed-off-by: Darrick J. Wong <djwong@kernel.org>
2021-09-17xfs: create specialized classes for refcount tracepointsDarrick J. Wong
The only user of the "ag" tracepoint event classes is the refcount btree, so rename them to make that obvious and make them take the btree cursor to simplify the arguments. This will save us a lot of trouble later on. Signed-off-by: Darrick J. Wong <djwong@kernel.org>
2021-09-17xfs: give refcount btree cursor error tracepoints their own classDarrick J. Wong
Convert all the refcount tracepoints to use the btree error tracepoint class. Signed-off-by: Darrick J. Wong <djwong@kernel.org>
2021-09-17xfs: remove useless oinfo arg from xfs_refcount_adjustDarrick J. Wong
All callers pass NULL here, so eliminate the unnecessary argument. Signed-off-by: Darrick J. Wong <djwong@kernel.org>
2021-09-17xfs: apply noalloc mode to inode allocations toonoalloc-ags_2021-09-17Darrick J. Wong
Don't allow inode allocations from this group if it's marked noalloc. Signed-off-by: Darrick J. Wong <djwong@kernel.org>
2021-09-17xfs: enable userspace to hide an AG from allocationDarrick J. Wong
Add an administrative interface so that userspace can hide an allocation group from block allocation. Signed-off-by: Darrick J. Wong <djwong@kernel.org>
2021-09-17xfs: create a noalloc mode for allocation groupsDarrick J. Wong
Create a new noalloc state for the per-AG structure that will disable block allocation in this AG. We accomplish this by subtracting from fdblocks all the free blocks in this AG, hiding those blocks from the allocator, and preventing freed blocks from updating fdblocks until we're ready to lift noalloc mode. Note that we reduce the free block count of the filesystem so that we can prevent transactions from entering the allocator looking for "free" space that we've turned off incore. Signed-off-by: Darrick J. Wong <djwong@kernel.org>
2021-09-17xfs: compact flag bits in the perag structureDarrick J. Wong
Compact the flags in the per-ag structure so that we use less space. Signed-off-by: Darrick J. Wong <djwong@kernel.org>
2021-09-17xfs: enable realtime rmap btreerealtime-rmap_2021-09-17Darrick J. Wong
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
2021-09-17xfs: online repair of the realtime rmap btreeDarrick J. Wong
Repair the realtime rmap btree while mounted. Signed-off-by: Darrick J. Wong <djwong@kernel.org>
2021-09-17xfs: online repair of realtime bitmapsDarrick J. Wong
Rebuild the realtime bitmap from the realtime rmap btree. Signed-off-by: Darrick J. Wong <djwong@kernel.org>
2021-09-17xfs: repair inodes that have realtime extentsDarrick J. Wong
Plumb into the inode core repair code the ability to search for extents on realtime devices. Signed-off-by: Darrick J. Wong <djwong@kernel.org>
2021-09-17xfs: online repair of realtime file bmapsDarrick J. Wong
Repair the block mappings of realtime files. Signed-off-by: Darrick J. Wong <djwong@kernel.org>
2021-09-17xfs: walk the rt reverse mapping tree when rebuilding rmapDarrick J. Wong
When we're rebuilding the data device rmap, if we encounter an "rmap" format fork, we have to walk the (realtime) rmap btree inode to build the appropriate mappings. Signed-off-by: Darrick J. Wong <djwong@kernel.org>
2021-09-17xfs: scan rt rmap when we're doing an intense rmap checkDarrick J. Wong
Teach the bmbt scrubber how to perform a comprehensive check that the rmapbt does not contain /any/ mappings that are not described by bmbt records when it's dealing with a realtime file. Signed-off-by: Darrick J. Wong <djwong@kernel.org>
2021-09-17xfs: cross-reference the realtime rmapbtDarrick J. Wong
Teach the data fork and realtime bitmap scrubbers to cross-reference information with the realtime rmap btree. Signed-off-by: Darrick J. Wong <djwong@kernel.org>
2021-09-17xfs: cross-reference realtime bitmap to realtime rmapbt scrubberDarrick J. Wong
When we're checking the realtime rmap btree entries, cross-reference those entries with the realtime bitmap too. Signed-off-by: Darrick J. Wong <djwong@kernel.org>
2021-09-17xfs: scrub the realtime rmapbtDarrick J. Wong
Check the realtime reverse mapping btree against the rtbitmap, and modify the rtbitmap scrub to check against the rtrmapbt. Signed-off-by: Darrick J. Wong <djwong@kernel.org>
2021-09-17xfs: fix scrub tracepoints when inode-rooted btrees are involvedDarrick J. Wong
Fix a couple of minor mistakes in the scrub tracepoints that can manifest when inode-rooted btrees are enabled. The existing code worked fine for bmap btrees, but we should tighten the code up to be less sloppy. Signed-off-by: Darrick J. Wong <djwong@kernel.org>
2021-09-17xfs: report realtime rmap btree corruption errors to the health systemDarrick J. Wong
Whenever we encounter corrupt realtime rmap btree blocks, we should report that to the health monitoring system for later reporting. Signed-off-by: Darrick J. Wong <djwong@kernel.org>
2021-09-17xfs: add realtime rmap btree when adding rt volumeDarrick J. Wong
If we're adding a realtime section to the filesystem, create the rt rmap btree inode before we start adding rt space. Signed-off-by: Darrick J. Wong <djwong@kernel.org>
2021-09-17xfs: wire up getfsmap to the realtime reverse mapping btreeDarrick J. Wong
Connect the getfsmap ioctl to the realtime rmapbt. Signed-off-by: Darrick J. Wong <djwong@kernel.org>
2021-09-17xfs: rearrange xfs_fsmap.c a little bitDarrick J. Wong
The order of the functions in this file has gotten a little confusing over the years. Specifically, the two data device implementations (bnobt and rmapbt) could be adjacent in the source code instead of split in two by the logdev and rtdev fsmap implementations. We're about to add more functionality to this file, so rearrange things now. Signed-off-by: Darrick J. Wong <djwong@kernel.org>
2021-09-17xfs: fix confusing variable names in xfs_rmap_item.cDarrick J. Wong
Variable names in this code module are inconsistent and confusing. xfs_map_extent describe file mappings, so rename them "map". xfs_rmap_intents describe block mapping intents, so rename them "ri". Signed-off-by: Darrick J. Wong <djwong@kernel.org>
2021-09-17xfs: check that the rtrmapbt maxlevels doesn't increase when growing fsDarrick J. Wong
The size of filesystem transaction reservations depends on the maximum height (maxlevels) of the realtime btrees. Since we don't want a grow operation to increase the reservation size enough that we'll fail the minimum log size checks on the next mount, constrain growfs operations if they would cause an increase in those maxlevels. Signed-off-by: Darrick J. Wong <djwong@kernel.org>
2021-09-17xfs: create routine to allocate and initialize a realtime rmap btree inodeDarrick J. Wong
Create a library routine to allocate and initialize an empty realtime rmapbt inode. We'll use this for mkfs and repair. Signed-off-by: Darrick J. Wong <djwong@kernel.org>
2021-09-17xfs: wire up rmap map and unmap to the realtime rmapbtDarrick J. Wong
Connect the map and unmap reverse-mapping operations to the realtime rmapbt via the deferred operation callbacks. This enables us to perform rmap operations against the correct btree. Signed-off-by: Darrick J. Wong <djwong@kernel.org>
2021-09-17xfs: use realtime EFI to free extents when realtime rmap is enabledDarrick J. Wong
When rmap is enabled, XFS expects a certain order of operations, which is: 1) remove the file mapping, 2) remove the reverse mapping, and then 3) free the blocks. xfs_bmap_del_extent_real tries to do 1 and 3 in the same transaction, which means that when rtrmap is enabled, we have to use realtime EFIs to maintain the expected order. Signed-off-by: Darrick J. Wong <djwong@kernel.org>
2021-09-17xfs: wire up a new inode fork type for the realtime rmapDarrick J. Wong
Plumb in the pieces we need to embed the root of the realtime rmap btree in an inode's data fork, complete with new fork type and on-disk interpretation functions. Signed-off-by: Darrick J. Wong <djwong@kernel.org>
2021-09-17xfs: add metadata reservations for realtime rmap btreesDarrick J. Wong
Reserve some free blocks so that we will always have enough free blocks in the data volume to handle expansion of the realtime rmap btree. Signed-off-by: Darrick J. Wong <djwong@kernel.org>
2021-09-17xfs: add realtime reverse map inode to metadata directoryDarrick J. Wong
Add a metadir path to select the realtime rmap btree inode and load it at mount time. The rtrmapbt inode will have a unique extent format code, which means that we also have to update the inode validation and flush routines to look for it. Signed-off-by: Darrick J. Wong <djwong@kernel.org>
2021-09-17xfs: attach dquots to rt metadata files when starting quotaDarrick J. Wong
Attach dquots to the realtime metadata files when starting up quotas, since the resources used by them are charged to the root dquot. Signed-off-by: Darrick J. Wong <djwong@kernel.org>
2021-09-17xfs: add realtime rmap btree block detection to log recoveryDarrick J. Wong
Identify rtrmapbt blocks in the log correctly so that we can validate them during log recovery. Signed-off-by: Darrick J. Wong <djwong@kernel.org>
2021-09-17xfs: support recovering rmap intent items targetting realtime extentsDarrick J. Wong
Now that we have rmap on the realtime device, log recovery has to support remapping extents on the realtime volume. Make this work. Signed-off-by: Darrick J. Wong <djwong@kernel.org>
2021-09-17xfs: add a realtime flag to the rmap update log redo itemsDarrick J. Wong
Extend the rmap update (RUI) log items with a new realtime flag that indicates that the updates apply against the realtime rmapbt. We'll wire up the actual rmap code later. Signed-off-by: Darrick J. Wong <djwong@kernel.org>
2021-09-17xfs: prepare rmap functions to deal with rtrmapbtDarrick J. Wong
Prepare the high-level rmap functions to deal with the new realtime rmapbt and its slightly different conventions. Provide the ability to talk to either rmapbt or rtrmapbt formats from the same high level code. Signed-off-by: Darrick J. Wong <djwong@kernel.org>
2021-09-17xfs: add realtime rmap btree operationsDarrick J. Wong
Implement the generic btree operations needed to manipulate rtrmap btree blocks. This is different from the regular rmapbt in that we allocate space from the filesystem at large, and are neither constrained to the free space nor any particular AG. Signed-off-by: Darrick J. Wong <djwong@kernel.org>
2021-09-17xfs: realtime rmap btree transaction reservationsDarrick J. Wong
Make sure that there's enough log reservation to handle mapping and unmapping realtime extents. We have to reserve enough space to handle a split in the rtrmapbt to add the record and a second split in the regular rmapbt to record the rtrmapbt split. Signed-off-by: Darrick J. Wong <djwong@kernel.org>
2021-09-17xfs: define the on-disk realtime rmap btree formatDarrick J. Wong
Start filling out the rtrmap btree implementation. Start with the on-disk btree format; add everything needed to read, write and manipulate rmap btree blocks. This prepares the way for connecting the btree operations implementation. Signed-off-by: Darrick J. Wong <djwong@kernel.org>
2021-09-17xfs: introduce realtime rmap btree definitionsDarrick J. Wong
Add new realtime rmap btree definitions. The realtime rmap btree will be rooted from a hidden inode, but has its own shape and therefore needs to have most of its own separate types. Signed-off-by: Darrick J. Wong <djwong@kernel.org>
2021-09-17xfs: widen xfs_rmap_irec fields to handle realtime rmapbtDarrick J. Wong
Change the startblock and blockcount fields of xfs_rmap_irec to be 64 bits wide. This enables us to use the same high level rmap code for either tree. We'll also collect all the resulting breakage fixes here. Signed-off-by: Darrick J. Wong <djwong@kernel.org>
2021-09-17xfs: remove xfs_trans_set_rmap_flagsrmap-intent-cleanups_2021-09-17Darrick J. Wong
Remove this single-use helper. Signed-off-by: Darrick J. Wong <djwong@kernel.org>
2021-09-17xfs: clean up rmap log intent item tracepoint callsitesDarrick J. Wong
Pass the incore rmap structure to the tracepoints instead of open-coding the argument passing. Signed-off-by: Darrick J. Wong <djwong@kernel.org>
2021-09-17xfs: pass rmap space mapping directly through the log intent codeDarrick J. Wong
Pass the incore rmap space mapping through the RUI logging code instead of repeatedly boxing and unboxing parameters. We'll clean up the tracepoints shortly. Signed-off-by: Darrick J. Wong <djwong@kernel.org>
2021-09-17xfs: prepare rmap btree tracepoints for wideningDarrick J. Wong
Prepare the rmap btree tracepoints for use with realtime rmap btrees by making them take the btree cursor object as a parameter. This will save us a lot of trouble later on. Signed-off-by: Darrick J. Wong <djwong@kernel.org>
2021-09-17xfs: give rmap btree cursor error tracepoints their own classDarrick J. Wong
Create a new tracepoint class for btree-related errors, then convert all the rmap tracepoints to use it. Also fix the one tracepoint that was abusing the old class by making it a separate tracepoint. Signed-off-by: Darrick J. Wong <djwong@kernel.org>
2021-09-17xfs: widen btree maxlevels computation to handle 64-bit record countsbtree-cleanups_2021-09-17Darrick J. Wong
Rework xfs_btree_compute_maxlevels to handle larger record counts, since we're about to add support for very large indices for the realtime rmap btree. Signed-off-by: Darrick J. Wong <djwong@kernel.org>