]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
ceph: Remove gfp_t argument from ceph_fscrypt_encrypt_*()
authorEric Biggers <ebiggers@kernel.org>
Thu, 10 Jul 2025 06:07:53 +0000 (23:07 -0700)
committerEric Biggers <ebiggers@kernel.org>
Thu, 10 Jul 2025 19:33:17 +0000 (12:33 -0700)
This argument is no longer used, so remove it.

Reviewed-by: Alex Markuze <amarkuze@redhat.com>
Link: https://lore.kernel.org/r/20250710060754.637098-7-ebiggers@kernel.org
Signed-off-by: Eric Biggers <ebiggers@kernel.org>
fs/ceph/crypto.c
fs/ceph/crypto.h
fs/ceph/file.c
fs/ceph/inode.c

index 6d04d528ed03851d8c3d3897cd7b8b60ff652bfa..91e62db0c205030b6a9b0ada4df01ec4eeda894f 100644 (file)
@@ -516,8 +516,7 @@ int ceph_fscrypt_decrypt_block_inplace(const struct inode *inode,
 
 int ceph_fscrypt_encrypt_block_inplace(const struct inode *inode,
                                  struct page *page, unsigned int len,
-                                 unsigned int offs, u64 lblk_num,
-                                 gfp_t gfp_flags)
+                                 unsigned int offs, u64 lblk_num)
 {
        struct ceph_client *cl = ceph_inode_to_client(inode);
 
@@ -641,9 +640,8 @@ int ceph_fscrypt_decrypt_extents(struct inode *inode, struct page **page,
  * @page: pointer to page array
  * @off: offset into the file that the data starts
  * @len: max length to encrypt
- * @gfp: gfp flags to use for allocation
  *
- * Decrypt an array of cleartext pages and return the amount of
+ * Encrypt an array of cleartext pages and return the amount of
  * data encrypted. Any data in the page prior to the start of the
  * first complete block in the read is ignored. Any incomplete
  * crypto blocks at the end of the array are ignored.
@@ -651,7 +649,7 @@ int ceph_fscrypt_decrypt_extents(struct inode *inode, struct page **page,
  * Returns the length of the encrypted data or a negative errno.
  */
 int ceph_fscrypt_encrypt_pages(struct inode *inode, struct page **page, u64 off,
-                               int len, gfp_t gfp)
+                               int len)
 {
        int i, num_blocks;
        u64 baseblk = off >> CEPH_FSCRYPT_BLOCK_SHIFT;
@@ -672,7 +670,7 @@ int ceph_fscrypt_encrypt_pages(struct inode *inode, struct page **page, u64 off,
 
                fret = ceph_fscrypt_encrypt_block_inplace(inode, page[pgidx],
                                CEPH_FSCRYPT_BLOCK_SIZE, pgoffs,
-                               baseblk + i, gfp);
+                               baseblk + i);
                if (fret < 0) {
                        if (ret == 0)
                                ret = fret;
index d0768239a1c9c96bc0b992b6160f334e19a47f89..6db28464ff80326cb4cf17c2d493af0d4ebe8d04 100644 (file)
@@ -155,15 +155,14 @@ int ceph_fscrypt_decrypt_block_inplace(const struct inode *inode,
                                  unsigned int offs, u64 lblk_num);
 int ceph_fscrypt_encrypt_block_inplace(const struct inode *inode,
                                  struct page *page, unsigned int len,
-                                 unsigned int offs, u64 lblk_num,
-                                 gfp_t gfp_flags);
+                                 unsigned int offs, u64 lblk_num);
 int ceph_fscrypt_decrypt_pages(struct inode *inode, struct page **page,
                               u64 off, int len);
 int ceph_fscrypt_decrypt_extents(struct inode *inode, struct page **page,
                                 u64 off, struct ceph_sparse_extent *map,
                                 u32 ext_cnt);
 int ceph_fscrypt_encrypt_pages(struct inode *inode, struct page **page, u64 off,
-                              int len, gfp_t gfp);
+                              int len);
 
 static inline struct page *ceph_fscrypt_pagecache_page(struct page *page)
 {
@@ -246,8 +245,7 @@ static inline int ceph_fscrypt_decrypt_block_inplace(const struct inode *inode,
 
 static inline int ceph_fscrypt_encrypt_block_inplace(const struct inode *inode,
                                          struct page *page, unsigned int len,
-                                         unsigned int offs, u64 lblk_num,
-                                         gfp_t gfp_flags)
+                                         unsigned int offs, u64 lblk_num)
 {
        return 0;
 }
@@ -269,7 +267,7 @@ static inline int ceph_fscrypt_decrypt_extents(struct inode *inode,
 
 static inline int ceph_fscrypt_encrypt_pages(struct inode *inode,
                                             struct page **page, u64 off,
-                                            int len, gfp_t gfp)
+                                            int len)
 {
        return 0;
 }
index a7254cab44cc2e24186f5aa67169f11857e7b8de..9b79da6d1aee762572b5a8401f5ef77bf1632985 100644 (file)
@@ -1992,8 +1992,7 @@ ceph_sync_write(struct kiocb *iocb, struct iov_iter *from, loff_t pos,
 
                if (IS_ENCRYPTED(inode)) {
                        ret = ceph_fscrypt_encrypt_pages(inode, pages,
-                                                        write_pos, write_len,
-                                                        GFP_KERNEL);
+                                                        write_pos, write_len);
                        if (ret < 0) {
                                doutc(cl, "encryption failed with %d\n", ret);
                                ceph_release_page_vector(pages, num_pages);
index 06cd2963e41ee0e65e0b7920287130e04f4fb51f..fc543075b827a9d0138fda91174e1e099caed33c 100644 (file)
@@ -2436,8 +2436,7 @@ static int fill_fscrypt_truncate(struct inode *inode,
                /* encrypt the last block */
                ret = ceph_fscrypt_encrypt_block_inplace(inode, page,
                                                    CEPH_FSCRYPT_BLOCK_SIZE,
-                                                   0, block,
-                                                   GFP_KERNEL);
+                                                   0, block);
                if (ret)
                        goto out;
        }