Skip to content

Btrfs: just bunch of patches to ioctl.c

Timofey Titovets linux-btrfs 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v1 Latest posting 2/24 patches 5 repliesIn review
  2. v1 posting 1/24 patches 5 repliesSuperseded

Patches in v1 posting 2/2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4Btrfs: btrfs_dedupe_file_range() ioctl, remove 16MiB restrictionfs/btrfs/ioctl.c+94 -662 replies
2/4Btrfs: make should_defrag_range() understood compressed extentsfs/btrfs/ioctl.c+25 -30 replies
3/4Btrfs: allow btrfs_defrag_file() uncompress files on defragmentationfs/btrfs/btrfs_inode.h fs/btrfs/inode.c fs/btrfs/ioctl.c+13 -90 replies
4/4Btrfs: reduce size of struct btrfs_inodefs/btrfs/btrfs_inode.h+3 -33 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/4] [RESEND] Btrfs: just bunch of patches to ioctl.c

1st patch, remove 16MiB restriction from extent_same ioctl(), by doing iterations over passed range.

I did not see much difference in performance, so it's just remove logic restriction.

2-3 pathes, update defrag ioctl():
- Fix bad behaviour with full rewriting all compressed
extents in defrag range. (that also make autodefrag on compressed fs not so expensive)
- Allow userspace specify NONE as target compression type, that allow users to uncompress files by defragmentation with btrfs-progs
- Make defrag ioctl understood requested compression type and current compression type of extents, to make btrfs fi def -rc<type> idempotent operation.
i.e. now possible to say, make all extents compressed with lzo, and btrfs will not recompress lzo compressed data.
Same for zlib, zstd, none.
(patch to btrfs-progs in PR on kdave GitHub).

4th patch, reduce size of struct btrfs_inode
- btrfs_inode store fields like: prop_compress, defrag_compress and after 3rd patch, change_compress.
They use unsigned as a type, and use 12 bytes in sum. But change_compress is a bitflag, and prop_compress/defrag_compress only store compression type, that currently use 0-3 of 2^32-1.

So, set a bitfields on that vars, and reduce size of btrfs_inode:
1136 -> 1128.

Timofey Titovets (4):
Btrfs: btrfs_dedupe_file_range() ioctl, remove 16MiB restriction
Btrfs: make should_defrag_range() understood compressed extents
Btrfs: allow btrfs_defrag_file() uncompress files on defragmentation
Btrfs: reduce size of struct btrfs_inode

 fs/btrfs/btrfs_inode.h |   5 +-
 fs/btrfs/inode.c       |   4 +-
 fs/btrfs/ioctl.c       | 203 +++++++++++++++++++++++++++++++------------------
 3 files changed, 133 insertions(+), 79 deletions(-)
Signature · 1 line
2.15.1