Skip to content

btrfs: convert to the new mount API

Josef Bacik linux-btrfs 3 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest19 patches 8 repliesIn review
  2. v218 patches 14 repliesSuperseded
  3. v118 patches 9 repliesSuperseded

Changes in v3 from the cover letter

- Fixed up the various review comments from Dave and Anand.
- Added a patch to drop the deprecated mount options we currently have.

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/19fs: indicate request originates from old mount apifs/namespace.c+11 -00 replies
2/19btrfs: split out the mount option validation code into its own helperfs/btrfs/super.c+37 -290 replies
3/19btrfs: set default compress type at btrfs_init_fs_info timefs/btrfs/disk-io.c+3 -70 replies
4/19btrfs: move space cache settings into open_ctreefs/btrfs/disk-io.c fs/btrfs/super.c fs/btrfs/super.h+50 -240 replies
5/19btrfs: do not allow free space tree rebuild on extent tree v2fs/btrfs/disk-io.c+5 -10 replies
6/19btrfs: split out ro->rw and rw->ro helpers into their own functionsfs/btrfs/super.c+120 -1130 replies
7/19btrfs: add a NOSPACECACHE mount option flagfs/btrfs/disk-io.c fs/btrfs/fs.h+2 -00 replies
8/19btrfs: add fs_parameter definitionsfs/btrfs/super.c+127 -10 replies
9/19btrfs: add parse_param callback for the new mount apifs/btrfs/super.c+382 -00 replies
10/19btrfs: add fs context handling functionsfs/btrfs/super.c+35 -10 replies
11/19btrfs: add reconfigure callback for fs_contextfs/btrfs/super.c fs/btrfs/zoned.c fs/btrfs/zoned.h+203 -290 replies
12/19btrfs: add get_tree callback for new mount APIfs/btrfs/super.c+206 -40 replies
13/19btrfs: handle the ro->rw transition for mounting different subovlsfs/btrfs/super.c+132 -10 replies
14/19btrfs: switch to the new mount APIfs/btrfs/disk-io.c fs/btrfs/super.c fs/btrfs/super.h+60 -410 replies
15/19btrfs: move the device specific mount options to super.cfs/btrfs/disk-io.c fs/btrfs/super.c+25 -230 replies
16/19btrfs: remove old mount API codefs/btrfs/fs.h fs/btrfs/super.c fs/btrfs/super.h+13 -10810 replies
17/19btrfs: move one shot mount option clearing to super.cfs/btrfs/disk-io.c fs/btrfs/disk-io.h fs/btrfs/super.c+16 -160 replies
18/19btrfs: set clear_cache if we use usebackuprootfs/btrfs/disk-io.c fs/btrfs/super.c+12 -30 replies
19/19btrfs: remove code for inode_cache and recovery mount optionsfs/btrfs/super.c+0 -350 replies

Reviews trailers per patch

4 of 19 patches have a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchChristoph HellwigChristian BraunerNeal GompaAnand Jain
SeriesR-b R-b
1/19R-b
2/19
3/19
4/19
5/19
6/19
7/19
8/19
9/19
10/19R-b
11/19
12/19R-b
13/19R-b
14/19
15/19
16/19
17/19
18/19
19/19

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 4 reviewers.

Read the v3 thread

Cover letter [PATCH v3 00/19] btrfs: convert to the new mount API

v2->v3:
- Fixed up the various review comments from Dave and Anand.
- Added a patch to drop the deprecated mount options we currently have.

v1->v2:
- Fixed up some nits and paste errors.
- Fixed build failure with !ZONED.
- Fixed accidentally dropping BINARY_MOUNTDATA flag.
- Added Reviewed-by's collected up to this point.

These have run through our CI a few times, they haven't introduced any regressions.

--- Original email ---
Hello,

These patches convert us to use the new mount API. Christian tried to do this a few months ago, but ran afoul of our preference to have a bunch of small changes. I started this series before I knew he had tried to convert us, so there's a fair bit that's different, but I did copy his approach for the remount bit. I've linked to the original patch where I took inspiration, Christian let me know if you want some other annotation for credit, I wasn't really sure the best way to do that.

There are a few preparatory patches in the beginning, and then cleanups at the end. I took each call back one at a time to try and make it as small as possible. The resulting code is less, but the diffstat shows more insertions that deletions. This is because there are some big comment blocks around some of the more subtle things that we're doing to hopefully make it more clear.

This is currently running through our CI. I thought it was fine last week but we had a bunch of new failures when I finished up the remount behavior. However today I discovered this was a regression in btrfs-progs, and I'm re-running the tests with the fixes. If anything major breaks in the CI I'll resend with fixes, but I'm pretty sure these patches will pass without issue.

I utilized __maybe_unused liberally to make sure everything compiled while applied. The only "big" patch is where I went and removed the old API. If requested I can break that up a bit more, but I didn't think it was necessary. I did make sure to keep it in its own patch, so the switch to the new mount API path only has things we need to support the new mount API, and then the next patch removes the old code. Thanks,

Josef

Christian Brauner (1):
fs: indicate request originates from old mount api

Josef Bacik (18):
btrfs: split out the mount option validation code into its own helper
btrfs: set default compress type at btrfs_init_fs_info time
btrfs: move space cache settings into open_ctree
btrfs: do not allow free space tree rebuild on extent tree v2
btrfs: split out ro->rw and rw->ro helpers into their own functions
btrfs: add a NOSPACECACHE mount option flag
btrfs: add fs_parameter definitions
btrfs: add parse_param callback for the new mount api
btrfs: add fs context handling functions
btrfs: add reconfigure callback for fs_context
btrfs: add get_tree callback for new mount API
btrfs: handle the ro->rw transition for mounting different subovls
btrfs: switch to the new mount API
btrfs: move the device specific mount options to super.c
btrfs: remove old mount API code
btrfs: move one shot mount option clearing to super.c
btrfs: set clear_cache if we use usebackuproot
btrfs: remove code for inode_cache and recovery mount options

 fs/btrfs/disk-io.c |   85 +-
 fs/btrfs/disk-io.h |    1 -
 fs/btrfs/fs.h      |   15 +-
 fs/btrfs/super.c   | 2357 +++++++++++++++++++++++---------------------
 fs/btrfs/super.h   |    5 +-
 fs/btrfs/zoned.c   |   16 +-
 fs/btrfs/zoned.h   |    6 +-
 fs/namespace.c     |   11 +
 8 files changed, 1263 insertions(+), 1233 deletions(-)
Signature · 1 line
2.41.0