Skip to content

ext4/crypto: Move out crypto related ops to crypto.c

Ritesh Harjani linux-ext4 linux-fscrypt 3 versions – Applied

Status from this message: Applied, thanks!

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest3 patches 1 replyApplied
  2. v23 patches 6 repliesSuperseded
  3. v1 RFC6 patches 4 repliesSuperseded

Changes in v3 from the cover letter

=========
1. Addressed review comments from Eric.

Patches in v3 Applied

#Subject and filesSizeRepliesApplied
1/3ext4: Move ext4 crypto code to its own file crypto.cfs/ext4/Makefile fs/ext4/crypto.c fs/ext4/ext4.h +1 more+131 -1220 replies
2/3ext4: Cleanup function defs from ext4.h into crypto.cfs/ext4/crypto.c fs/ext4/ext4.h+70 -640 replies
3/3ext4: Refactor and move ext4_ioctl_get_encryption_pwsalt()fs/ext4/crypto.c fs/ext4/ext4.h fs/ext4/ioctl.c+64 -570 replies

Reviews trailers per patch

All 3 patches have a Reviewed-by or Acked-by.

PatchEric Biggers
1/3R-b
2/3R-b
3/3R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v3 thread

Cover letter [PATCHv3 0/3] ext4/crypto: Move out crypto related ops to crypto.c

Hello,

Please find the v3 of this cleanup series. Thanks to Eric for his quick review of the patch series.

Description
=============
This is 1st in the series to cleanup ext4/super.c, since it has grown quite large. This moves out crypto related ops and few fs encryption related definitions to fs/ext4/crypto.c

I have tested "-g encrypt" xfstests group and don't see any surprises there. The changes are relatively straight forward since it is just moving/refactoring.

Currently these patches apply cleanly on ext4 tree's dev branch. Since in these series test_dummy_encryption related changes are dropped, hence I don't think that this should give any major conflict with Eric's series.

NOTE: I noticed we could move both ext4 & f2fs to use uuid_t lib API from include/linux/uuid.h for managing sb->s_encrypt_pw_salt.
That should kill custom implementations of uuid_is_zero()/uuid_is_nonzero(). But since I noticed it while writing this cover letter, so I would like to do those changes in a seperate patch series if that is ok. That way maybe we could cleanup tree wide changes in fs/ (if there are others too).

v2 -> v3
=========
1. Addressed review comments from Eric.

RFC -> v2
==========
1. Dropped all test_dummy_encryption related changes
(Eric has separately submitted a v3 for fixing more general problems with
that mount option).
2. Addressed Eric comments to:-
1. rename ext4_crypto.c -> crypto.c
2. Refactor out ext4_ioc_get_encryption_pwsalt() into crypto.c
3. Made ext4_fname_from_fscrypt_name() static since it is only being called from within crypto.c functions.

[v2] - https://lore.kernel.org/linux-ext4/[email protected]/T/#t
[RFC] - https://lore.kernel.org/linux-ext4/[email protected]/

Ritesh Harjani (3):
ext4: Move ext4 crypto code to its own file crypto.c
ext4: Cleanup function defs from ext4.h into crypto.c
ext4: Refactor and move ext4_ioctl_get_encryption_pwsalt()

 fs/ext4/Makefile |   1 +
 fs/ext4/crypto.c | 246 +++++++++++++++++++++++++++++++++++++++++++++++
 fs/ext4/ext4.h   |  76 +++------------
 fs/ext4/ioctl.c  |  59 +-----------
 fs/ext4/super.c  | 122 -----------------------
 5 files changed, 263 insertions(+), 241 deletions(-)
 create mode 100644 fs/ext4/crypto.c

--
2.31.1