Commit 7896b631 authored by Adrian Bunk's avatar Adrian Bunk Committed by Linus Torvalds

fs/ecryptfs/: possible cleanups

- make the following needlessly global code static:
  - crypto.c:ecryptfs_lower_offset_for_extent()
  - crypto.c:key_tfm_list
  - crypto.c:key_tfm_list_mutex
  - inode.c:ecryptfs_getxattr()
  - main.c:ecryptfs_init_persistent_file()

- remove the no longer used mmap.c:ecryptfs_lower_page_cache

- #if 0 the unused read_write.c:ecryptfs_read()
Signed-off-by: default avatarAdrian Bunk <bunk@kernel.org>
Cc: Michael Halcrow <mhalcrow@us.ibm.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 162c0d91
...@@ -376,7 +376,7 @@ static int encrypt_scatterlist(struct ecryptfs_crypt_stat *crypt_stat, ...@@ -376,7 +376,7 @@ static int encrypt_scatterlist(struct ecryptfs_crypt_stat *crypt_stat,
* *
* Convert an eCryptfs page index into a lower byte offset * Convert an eCryptfs page index into a lower byte offset
*/ */
void ecryptfs_lower_offset_for_extent(loff_t *offset, loff_t extent_num, static void ecryptfs_lower_offset_for_extent(loff_t *offset, loff_t extent_num,
struct ecryptfs_crypt_stat *crypt_stat) struct ecryptfs_crypt_stat *crypt_stat)
{ {
(*offset) = ((crypt_stat->extent_size (*offset) = ((crypt_stat->extent_size
...@@ -1802,8 +1802,8 @@ ecryptfs_process_key_cipher(struct crypto_blkcipher **key_tfm, ...@@ -1802,8 +1802,8 @@ ecryptfs_process_key_cipher(struct crypto_blkcipher **key_tfm,
} }
struct kmem_cache *ecryptfs_key_tfm_cache; struct kmem_cache *ecryptfs_key_tfm_cache;
struct list_head key_tfm_list; static struct list_head key_tfm_list;
struct mutex key_tfm_list_mutex; static struct mutex key_tfm_list_mutex;
int ecryptfs_init_crypto(void) int ecryptfs_init_crypto(void)
{ {
......
...@@ -322,9 +322,6 @@ struct ecryptfs_key_tfm { ...@@ -322,9 +322,6 @@ struct ecryptfs_key_tfm {
unsigned char cipher_name[ECRYPTFS_MAX_CIPHER_NAME_SIZE + 1]; unsigned char cipher_name[ECRYPTFS_MAX_CIPHER_NAME_SIZE + 1];
}; };
extern struct list_head key_tfm_list;
extern struct mutex key_tfm_list_mutex;
/** /**
* This struct is to enable a mount-wide passphrase/salt combo. This * This struct is to enable a mount-wide passphrase/salt combo. This
* is more or less a stopgap to provide similar functionality to other * is more or less a stopgap to provide similar functionality to other
...@@ -525,7 +522,6 @@ extern struct kmem_cache *ecryptfs_header_cache_0; ...@@ -525,7 +522,6 @@ extern struct kmem_cache *ecryptfs_header_cache_0;
extern struct kmem_cache *ecryptfs_header_cache_1; extern struct kmem_cache *ecryptfs_header_cache_1;
extern struct kmem_cache *ecryptfs_header_cache_2; extern struct kmem_cache *ecryptfs_header_cache_2;
extern struct kmem_cache *ecryptfs_xattr_cache; extern struct kmem_cache *ecryptfs_xattr_cache;
extern struct kmem_cache *ecryptfs_lower_page_cache;
extern struct kmem_cache *ecryptfs_key_record_cache; extern struct kmem_cache *ecryptfs_key_record_cache;
extern struct kmem_cache *ecryptfs_key_sig_cache; extern struct kmem_cache *ecryptfs_key_sig_cache;
extern struct kmem_cache *ecryptfs_global_auth_tok_cache; extern struct kmem_cache *ecryptfs_global_auth_tok_cache;
...@@ -576,8 +572,6 @@ int ecryptfs_truncate(struct dentry *dentry, loff_t new_length); ...@@ -576,8 +572,6 @@ int ecryptfs_truncate(struct dentry *dentry, loff_t new_length);
int ecryptfs_inode_test(struct inode *inode, void *candidate_lower_inode); int ecryptfs_inode_test(struct inode *inode, void *candidate_lower_inode);
int ecryptfs_inode_set(struct inode *inode, void *lower_inode); int ecryptfs_inode_set(struct inode *inode, void *lower_inode);
void ecryptfs_init_inode(struct inode *inode, struct inode *lower_inode); void ecryptfs_init_inode(struct inode *inode, struct inode *lower_inode);
ssize_t ecryptfs_getxattr(struct dentry *dentry, const char *name, void *value,
size_t size);
ssize_t ssize_t
ecryptfs_getxattr_lower(struct dentry *lower_dentry, const char *name, ecryptfs_getxattr_lower(struct dentry *lower_dentry, const char *name,
void *value, size_t size); void *value, size_t size);
...@@ -631,8 +625,6 @@ int ecryptfs_keyring_auth_tok_for_sig(struct key **auth_tok_key, ...@@ -631,8 +625,6 @@ int ecryptfs_keyring_auth_tok_for_sig(struct key **auth_tok_key,
char *sig); char *sig);
int ecryptfs_write_zeros(struct file *file, pgoff_t index, int start, int ecryptfs_write_zeros(struct file *file, pgoff_t index, int start,
int num_zeros); int num_zeros);
void ecryptfs_lower_offset_for_extent(loff_t *offset, loff_t extent_num,
struct ecryptfs_crypt_stat *crypt_stat);
int ecryptfs_write_lower(struct inode *ecryptfs_inode, char *data, int ecryptfs_write_lower(struct inode *ecryptfs_inode, char *data,
loff_t offset, size_t size); loff_t offset, size_t size);
int ecryptfs_write_lower_page_segment(struct inode *ecryptfs_inode, int ecryptfs_write_lower_page_segment(struct inode *ecryptfs_inode,
...@@ -646,8 +638,6 @@ int ecryptfs_read_lower_page_segment(struct page *page_for_ecryptfs, ...@@ -646,8 +638,6 @@ int ecryptfs_read_lower_page_segment(struct page *page_for_ecryptfs,
pgoff_t page_index, pgoff_t page_index,
size_t offset_in_page, size_t size, size_t offset_in_page, size_t size,
struct inode *ecryptfs_inode); struct inode *ecryptfs_inode);
int ecryptfs_read(char *data, loff_t offset, size_t size,
struct file *ecryptfs_file);
struct page *ecryptfs_get_locked_page(struct file *file, loff_t index); struct page *ecryptfs_get_locked_page(struct file *file, loff_t index);
#endif /* #ifndef ECRYPTFS_KERNEL_H */ #endif /* #ifndef ECRYPTFS_KERNEL_H */
...@@ -954,7 +954,7 @@ ecryptfs_getxattr_lower(struct dentry *lower_dentry, const char *name, ...@@ -954,7 +954,7 @@ ecryptfs_getxattr_lower(struct dentry *lower_dentry, const char *name,
return rc; return rc;
} }
ssize_t static ssize_t
ecryptfs_getxattr(struct dentry *dentry, const char *name, void *value, ecryptfs_getxattr(struct dentry *dentry, const char *name, void *value,
size_t size) size_t size)
{ {
......
...@@ -117,7 +117,7 @@ void __ecryptfs_printk(const char *fmt, ...) ...@@ -117,7 +117,7 @@ void __ecryptfs_printk(const char *fmt, ...)
* *
* Returns zero on success; non-zero otherwise * Returns zero on success; non-zero otherwise
*/ */
int ecryptfs_init_persistent_file(struct dentry *ecryptfs_dentry) static int ecryptfs_init_persistent_file(struct dentry *ecryptfs_dentry)
{ {
struct ecryptfs_inode_info *inode_info = struct ecryptfs_inode_info *inode_info =
ecryptfs_inode_to_private(ecryptfs_dentry->d_inode); ecryptfs_inode_to_private(ecryptfs_dentry->d_inode);
......
...@@ -34,8 +34,6 @@ ...@@ -34,8 +34,6 @@
#include <linux/scatterlist.h> #include <linux/scatterlist.h>
#include "ecryptfs_kernel.h" #include "ecryptfs_kernel.h"
struct kmem_cache *ecryptfs_lower_page_cache;
/** /**
* ecryptfs_get_locked_page * ecryptfs_get_locked_page
* *
......
...@@ -293,6 +293,7 @@ int ecryptfs_read_lower_page_segment(struct page *page_for_ecryptfs, ...@@ -293,6 +293,7 @@ int ecryptfs_read_lower_page_segment(struct page *page_for_ecryptfs,
return rc; return rc;
} }
#if 0
/** /**
* ecryptfs_read * ecryptfs_read
* @data: The virtual address into which to write the data read (and * @data: The virtual address into which to write the data read (and
...@@ -371,3 +372,4 @@ int ecryptfs_read(char *data, loff_t offset, size_t size, ...@@ -371,3 +372,4 @@ int ecryptfs_read(char *data, loff_t offset, size_t size,
out: out:
return rc; return rc;
} }
#endif /* 0 */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment