Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1505871

[PATCH 02/26] fscrypto: Constify struct inode pointer

From Richard Weinberger <richard@nod.at>
Newsgroups linux.kernel
Subject [PATCH 02/26] fscrypto: Constify struct inode pointer
Date 2016-10-21 15:00 +0200
Message-ID <suHAu-5DG-25@gated-at.bofh.it> (permalink)
References <suHqN-5zP-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Some filesystems, such as UBIFS, maintain a const pointer
for struct inode.

Signed-off-by: Richard Weinberger <richard@nod.at>
---
 fs/crypto/crypto.c       | 12 +++++++-----
 include/linux/fscrypto.h | 12 +++++++-----
 2 files changed, 14 insertions(+), 10 deletions(-)

diff --git a/fs/crypto/crypto.c b/fs/crypto/crypto.c
index 1c2f9516b4be..8c59912feebb 100644
--- a/fs/crypto/crypto.c
+++ b/fs/crypto/crypto.c
@@ -147,7 +147,7 @@ typedef enum {
 	FS_ENCRYPT,
 } fscrypt_direction_t;
 
-static int do_crypto(struct inode *inode,
+static int do_crypto(const struct inode *inode,
 		     fscrypt_direction_t rw, pgoff_t index,
 		     struct scatterlist *src, struct scatterlist *dst,
 		     unsigned int cryptlen, gfp_t gfp_flags)
@@ -212,7 +212,7 @@ static int do_page_crypto(struct inode *inode,
 	return do_crypto(inode, rw, index, &src, &dst, PAGE_SIZE, gfp_flags);
 }
 
-static int do_buf_crypto(struct inode *inode,
+static int do_buf_crypto(const struct inode *inode,
 			 fscrypt_direction_t rw, pgoff_t index,
 			 const void *src_buf, const void *dst_buf,
 			 unsigned int buflen, gfp_t gfp_flags)
@@ -287,7 +287,7 @@ errout:
 }
 EXPORT_SYMBOL(fscrypt_encrypt_page);
 
-int fscrypt_encrypt_buffer(struct inode *inode, const void *plaintext_buf,
+int fscrypt_encrypt_buffer(const struct inode *inode, const void *plaintext_buf,
 			   const void *ciphertext_buf, unsigned int buflen,
 			   pgoff_t index, gfp_t gfp_flags)
 {
@@ -296,8 +296,10 @@ int fscrypt_encrypt_buffer(struct inode *inode, const void *plaintext_buf,
 }
 EXPORT_SYMBOL(fscrypt_encrypt_buffer);
 
-int fscrypt_decrypt_buffer(struct inode *inode, const void *ciphertext_buf,
-			   const void *plaintext_buf, unsigned int buflen,
+int fscrypt_decrypt_buffer(const struct inode *inode,
+			   const void *ciphertext_buf,
+			   const void *plaintext_buf,
+			   unsigned int buflen,
 			   pgoff_t index, gfp_t gfp_flags)
 {
 	return do_buf_crypto(inode, FS_DECRYPT, index, ciphertext_buf,
diff --git a/include/linux/fscrypto.h b/include/linux/fscrypto.h
index a9628b4882e7..d18ee29cf69a 100644
--- a/include/linux/fscrypto.h
+++ b/include/linux/fscrypto.h
@@ -273,11 +273,13 @@ extern void fscrypt_pullback_bio_page(struct page **, bool);
 extern void fscrypt_restore_control_page(struct page *);
 extern int fscrypt_zeroout_range(struct inode *, pgoff_t, sector_t,
 						unsigned int);
-int fscrypt_encrypt_buffer(struct inode *inode, const void *plaintext_buf,
+int fscrypt_encrypt_buffer(const struct inode *inode, const void *plaintext_buf,
 			   const void *ciphertext_buf, unsigned int buflen,
 			   pgoff_t index, gfp_t gfp_flags);
-int fscrypt_decrypt_buffer(struct inode *inode, const void *ciphertext_buf,
-			   const void *plaintext_buf, unsigned int buflen,
+int fscrypt_decrypt_buffer(const struct inode *inode,
+			   const void *ciphertext_buf,
+			   const void *plaintext_buf,
+			   unsigned int buflen,
 			   pgoff_t index, gfp_t gfp_flags);
 /* policy.c */
 extern int fscrypt_process_policy(struct file *, const struct fscrypt_policy *);
@@ -291,8 +293,8 @@ extern int fscrypt_get_encryption_info(struct inode *);
 extern void fscrypt_put_encryption_info(struct inode *, struct fscrypt_info *);
 
 /* fname.c */
-extern int fscrypt_setup_filename(struct inode *, const struct qstr *,
-				int lookup, struct fscrypt_name *);
+extern int fscrypt_setup_filename(struct inode *dir, const struct qstr *iname,
+			   int lookup, struct fscrypt_name *fname);
 extern void fscrypt_free_filename(struct fscrypt_name *);
 extern u32 fscrypt_fname_encrypted_size(struct inode *, u32);
 extern int fscrypt_fname_alloc_buffer(struct inode *, u32,
-- 
2.7.3

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 00/26] UBIFS File Encryption Richard Weinberger <richard@nod.at> - 2016-10-21 14:50 +0200
  [PATCH 26/26] ubifs: Raise write version to 5 Richard Weinberger <richard@nod.at> - 2016-10-21 14:50 +0200
    Re: [PATCH 26/26] ubifs: Raise write version to 5 Michael Halcrow <mhalcrow@google.com> - 2016-10-21 19:40 +0200
      Re: [PATCH 26/26] ubifs: Raise write version to 5 Theodore Ts'o <tytso@mit.edu> - 2016-10-21 19:50 +0200
        Re: [PATCH 26/26] ubifs: Raise write version to 5 Eric Biggers <ebiggers@google.com> - 2016-10-21 20:20 +0200
          Re: [PATCH 26/26] ubifs: Raise write version to 5 Theodore Ts'o <tytso@mit.edu> - 2016-10-22 00:40 +0200
        Re: [PATCH 26/26] ubifs: Raise write version to 5 Richard Weinberger <richard@nod.at> - 2016-10-24 09:10 +0200
  [PATCH 05/26] ubifs: Define UBIFS crypto context xattr Richard Weinberger <richard@nod.at> - 2016-10-21 14:50 +0200
  [PATCH 10/26] ubifs: Enforce crypto policy in ->link and ->rename Richard Weinberger <richard@nod.at> - 2016-10-21 14:50 +0200
  [PATCH 15/26] ubifs: Implement encrypt/decrypt for all IO Richard Weinberger <richard@nod.at> - 2016-10-21 15:00 +0200
    Re: [PATCH 15/26] ubifs: Implement encrypt/decrypt for all IO Michael Halcrow <mhalcrow@google.com> - 2016-10-21 19:20 +0200
      Re: [PATCH 15/26] ubifs: Implement encrypt/decrypt for all IO Richard Weinberger <richard@nod.at> - 2016-10-21 19:30 +0200
        Re: [PATCH 15/26] ubifs: Implement encrypt/decrypt for all IO Michael Halcrow <mhalcrow@google.com> - 2016-10-21 20:00 +0200
          Re: [PATCH 15/26] ubifs: Implement encrypt/decrypt for all IO Richard Weinberger <richard@nod.at> - 2016-10-21 20:30 +0200
    Re: [PATCH 15/26] ubifs: Implement encrypt/decrypt for all IO Eric Biggers <ebiggers@google.com> - 2016-10-21 20:30 +0200
      Re: [PATCH 15/26] ubifs: Implement encrypt/decrypt for all IO Richard Weinberger <richard@nod.at> - 2016-10-24 09:10 +0200
  [PATCH 07/26] ubifs: Massage ubifs_listxattr() for encryption context Richard Weinberger <richard@nod.at> - 2016-10-21 15:00 +0200
  [PATCH 13/26] ubifs: Enforce crypto policy in mmap Richard Weinberger <richard@nod.at> - 2016-10-21 15:00 +0200
  [PATCH 11/26] ubifs: Preload crypto context in ->lookup() Richard Weinberger <richard@nod.at> - 2016-10-21 15:00 +0200
  [PATCH 21/26] ubifs: Rename tnc_read_node_nm Richard Weinberger <richard@nod.at> - 2016-10-21 15:00 +0200
  [PATCH 12/26] ubifs: Massage assert in ubifs_xattr_set() wrt. fscrypto Richard Weinberger <richard@nod.at> - 2016-10-21 15:00 +0200
  [PATCH 02/26] fscrypto: Constify struct inode pointer Richard Weinberger <richard@nod.at> - 2016-10-21 15:00 +0200
    Re: [PATCH 02/26] fscrypto: Constify struct inode pointer Theodore Ts'o <tytso@mit.edu> - 2016-10-21 17:00 +0200
      Re: [PATCH 02/26] fscrypto: Constify struct inode pointer Richard Weinberger <richard@nod.at> - 2016-10-21 17:20 +0200
  [PATCH 22/26] ubifs: Add full hash lookup support Richard Weinberger <richard@nod.at> - 2016-10-21 15:00 +0200
  [PATCH 24/26] ubifs: Implement UBIFS_FLG_DOUBLE_HASH Richard Weinberger <richard@nod.at> - 2016-10-21 15:00 +0200
  [PATCH 25/26] ubifs: Implement UBIFS_FLG_ENCRYPTION Richard Weinberger <richard@nod.at> - 2016-10-21 15:00 +0200
    Re: [PATCH 25/26] ubifs: Implement UBIFS_FLG_ENCRYPTION Eric Biggers <ebiggers@google.com> - 2016-10-21 20:40 +0200
      Re: [PATCH 25/26] ubifs: Implement UBIFS_FLG_ENCRYPTION Richard Weinberger <richard@nod.at> - 2016-10-24 09:00 +0200
        Re: [PATCH 25/26] ubifs: Implement UBIFS_FLG_ENCRYPTION Theodore Ts'o <tytso@mit.edu> - 2016-10-24 15:50 +0200
  [PATCH 17/26] ubifs: Make r5 hash binary string aware Richard Weinberger <richard@nod.at> - 2016-10-21 15:00 +0200
  [PATCH 20/26] ubifs: Add support for encrypted symlinks Richard Weinberger <richard@nod.at> - 2016-10-21 15:00 +0200
    Re: [PATCH 20/26] ubifs: Add support for encrypted symlinks Eric Biggers <ebiggers@google.com> - 2016-10-21 20:50 +0200
      Re: [PATCH 20/26] ubifs: Add support for encrypted symlinks Richard Weinberger <richard@nod.at> - 2016-10-24 09:00 +0200
  [PATCH 23/26] ubifs: Use a random number for cookies Richard Weinberger <richard@nod.at> - 2016-10-21 15:00 +0200
  [PATCH 08/26] ubifs: Implement directory open operation Richard Weinberger <richard@nod.at> - 2016-10-21 15:00 +0200
  [PATCH 14/26] ubifs: Introduce new data node field, compr_size Richard Weinberger <richard@nod.at> - 2016-10-21 15:00 +0200
  [PATCH 16/26] ubifs: Relax checks in ubifs_validate_entry() Richard Weinberger <richard@nod.at> - 2016-10-21 15:00 +0200
  [PATCH 18/26] ubifs: Constify struct inode pointer in ubifs_crypt_is_encrypted() Richard Weinberger <richard@nod.at> - 2016-10-21 15:00 +0200
  [PATCH 06/26] ubifs: Add skeleton for fscrypto Richard Weinberger <richard@nod.at> - 2016-10-21 15:10 +0200
  Re: [PATCH 01/26] fscrypto: Add buffer operations Christoph Hellwig <hch@infradead.org> - 2016-10-21 15:10 +0200
    Re: [PATCH 01/26] fscrypto: Add buffer operations Richard Weinberger <richard@nod.at> - 2016-10-21 15:20 +0200
      Re: [PATCH 01/26] fscrypto: Add buffer operations Christoph Hellwig <hch@infradead.org> - 2016-10-21 15:30 +0200
        Re: [PATCH 01/26] fscrypto: Add buffer operations Theodore Ts'o <tytso@mit.edu> - 2016-10-21 17:20 +0200
        Re: [PATCH 01/26] fscrypto: Add buffer operations Richard Weinberger <richard@nod.at> - 2016-10-24 09:10 +0200
  [PATCH 09/26] ubifs: Implement file open operation Richard Weinberger <richard@nod.at> - 2016-10-21 15:10 +0200
  [PATCH 03/26] ubifs: Export ubifs_check_dir_empty() Richard Weinberger <richard@nod.at> - 2016-10-21 15:10 +0200
  [PATCH 04/26] ubifs: Export xattr get and set functions Richard Weinberger <richard@nod.at> - 2016-10-21 15:10 +0200
  [PATCH 01/26] fscrypto: Add buffer operations Richard Weinberger <richard@nod.at> - 2016-10-21 15:10 +0200

csiph-web